-
Notifications
You must be signed in to change notification settings - Fork 3.1k
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Lua 5.1 to 5.3 Realignment Phase 2 and baseline 5.3 #2912
Conversation
Well, the baseline Lua53 code and the overall shared build system is available for peer review. The first (4) commits are as per my original post. The last two are small tweaks to work around PR #2793. In terms of reviewing these patches, I am sorry to say that they are large.
(I've had to cancel my holiday in Greece, because I can't travel because of a ME/CFS relapse. So I will have more time to kill on this.) The Travis fails are due to some merge gremlin with Gregor's enhanced BuildInfo patch. I will sweep this resolution up in the next commit. |
Gosh this Anyway what I've done in this last commit is to go through all of the Lua Test Suite in detail removing any temporary changes which I did to get lua53 to compile and run the tests, debugging issues as I went along. The tests run clean with minimal and explained differences. CD to At the top level change There were some genuine bugs, and also some test assumptions that were invalid: e.g. the various base library functions and modules are in I have been focusing on Still got to port LFS -- my next commit. |
This latest commit includes the LFS functionality and various cascade fixes to allow the Lua test suite to run will only known variations from standard to accommodate LFS running and in particular running the test suite as LFS images so that we hammer the core against execution from LFS. This all runs within the The This madatory malloc/free paring feature makes LFS on The next tranche of work is hammering the on-ESP firmware build. |
OK, this latest push largely adds LFS support. But in more detail
Yet TODO:
You must include At the moment I am bootstrapping the ESP by using the I am getting to the point where I desperately need other testers to get involved, and in particular regression test the Lua 5.1 option. There are quite a few changes here to align the Lua 5.1 and Lua 5.3 runtimes so that the modules work with both. Once we are happy that at least Lua 5.1 is stable, then we can merge this into dev, since at the moment you need to do an explicit |
compiling this branch using marcel's docker nodemcu-build img is getting me to ld error :
what am i missing here? |
An offline PM:
//Terry If you are getting this message then you are testing the LUA=51 variant. Try |
ok, no worries. using docker run .. -e LUA=53 ... does the trick, compilation is ok ;) |
test code is:
first problem: running following as esplorer block-command results in reset:
second problem: running these line per line results in require error:
running as block-command all file operations is fine. reset comes only when require is being added. compiling test.lua to test.lc is still failure:
btw i'm using d1. so far haven't encountered other problems with this branch. |
@fikin Nikolay, thanks; that is brilliant. I will track these down tomorrow. |
When building with #define LUA_USE_MODULES_ENCODER the build breaks
|
Hi again Terry,
The file |
@fikin @HHHartmann sorry for not updating on this. Job for tomorrow. I've been adding another feature requested by @jmattsson: support for the luac.cross -F myLFS.img -e init.lua which will load a compiled LFS image into the luac.cross -F myLFS.img -o myLFS-a8000.bin -a 0x402a8000 will create an ESP binary LFS based at 0x402a8000 that you can use |
I've tracked down and fixed a couple of these.
Will post another update tomorrow. |
You also need to replace the link in #ifndef _SDK_OVERRIDE_ESPCONN_H_
#define _SDK_OVERRIDE_ESPCONN_H_
// Pull in the correct lwIP header
#include "../../app/include/lwip/app/espconn.h"
#endif |
@TerryE Not sure about this, but did you address the |
Yes, I am using the Lua 5.1 variant at this moment on this ESPlorer issue. |
Changes in 32e161b Interface consistency across the Lua 5.1 and 5.3 versions
UART fixes
ADC module
|
Thanks Terry for this commit, I hope it will fix several issues. #ifndef _SDK_OVERRIDE_ESPCONN_H_
#define _SDK_OVERRIDE_ESPCONN_H_
// Pull in the correct lwIP header
#include "../../app/include/lwip/app/espconn.h"
#endif I don't even know if the include guard is needed here. Maybe a oneliner is sufficient here. |
@HHHartmann You're right, for this use case we don't even need the include guard. I'd be "happy" with adopting the one-line-#include as a poor man's symlink. |
@TerryE Terry I am having problems loading an LFS image.
The device hangs here until reset #define LUA_FLASH_STORE 0x40000 and added several modules I commonly use |
@TerryE Terry I built from a clean clone only changing I get the following error building luac.cross
There is also a symbolic link in Loading an LFS image built with this build yields the same results as mentioned above. Going back to pre 53 firmware for now. |
IIRC, total is used in a The symbolic link issue is really an interoperability problem of docker on WinX using samba SMB which doesn't support symlinks across mount points. You are the expert on docker over Windows. What is the best practice workaround for this flaw in docker? I can't debug your LFS reload because I am not psychic; I don't have your test case. Email me a Zip of your LFS code and your config so I can reproduce it. Thanks. |
For the symlink please see #2912 (comment) and @jmattsson s comment thereafter. |
Gregor, I understand what the symlink issue is. My point is that the why is nothing directly to do with NodeMCU but rather this is a bug or functional limitation of how docker operates over Windows: if you want your source root to be a winX file tree in NTFS, then Docker uses Samba to expose this to the container. NTFS and Linux FS all support some form of symbolic linking. Samba doesn't, because the two implementations aren't fully consistent and it is difficult to map this functionality. |
Terry as I recall this is an issue of git under Windows. Marcel pointed out somewhere that a plugin or an extension (not sure of the terminology) for git world have to be installed on the client machine. See #2856 for more info. |
AFAIK, using git on Windows works with fixes as per the referenced issue; ditto git within a container so long as the root is within a container FS. The symlink problem arises when using git within the container with the root referencing a Samba mapped mount point. This is annoying, but as you point out we can use a |
rebase to latest encounters one compile problem, namely gregor's findings about unused "size_t totl = sizelstring(l);". i'll begin experimenting with it now. @marcelstoer , @TerryE how do you see merging it to dev branch? is there something to be helped with? for 51 vs 53 building? |
Gregor sorry for the illness related sabbatical. Back in the loop now. The load seems to be working, but the issue is do with an optimisation to remove a reboot. If you externally reset the ESP then so should find that the LFS has actually loaded. I will do a fix for this. |
@TerryE Terry, so glad to hear that you are back in the saddle and please don't excuse yourself for being ill. |
Gregor, I tried loading This second triggers EM: errors when doing an |
@HHHartmann, Sorry about the delay. I had a mind fart during merging the 51 and 53 variants of
I just want to check out LFS reload for 5.1 and rebaseline against current |
Superseded by #3075 -> closing |
Addresses: #2808, #2839 (partial), #2858, #2890
To be addressed before merge: #2783
dev
branch rather than formaster
.docs/*
.Overview
This is a huge PR. Sorry for this, but by nature, I can't practically release this in chunks. As per #2890 (comment), I have reorganised this into a series of commits:
Updates to app/lua to realign APIs. This is a reasonably large path to the Lua 5.1 codebase, implementing the Lua 5.3 version improved ROTables and the introduction of Function subtypes so that the modules can use the same API for building within both 5.1 and 5.3.
Updates to app/modules and supporting directories to realign APIs. A general cleanup of the modules to use the stricter Lua API implemented in (1)
Add the standard Lua 5.3.5 as a reference baseline. This is just the standard Lua 5.3.5 source without any changes reorganised into our current directory hierarchy. This is purely for baselining purposes. Note that the Lua Test Suite is included.
First pass of Lua53 changes to make runable Lua53. This includes the core changes needed to be able to build
LUA=53
and download a runnable Lua 5.3 firmware image onto the ESP, albeit with some limitations as discussed below. This has been tested against the Lua test suite within theluac.cross -e
environment.In this form, the build works for the default
LUA=51
target, and as a minimum prerequisite for merge, we should have solidly tested this against both the firmware andluac.cross
variants.We should also have a stable and usable (albeit with agreed deficiencies)
LUA=53
target.I will create the initial PR with only (1) above and then add (2) - (4).
Still outstanding to be added before merge
Special Request. Please review holistically at the first instance. If necessary make changes and email me your patch. Given the 1000s of individual line changes here, if we use the Github review API and commenting system, this PR will become rapidly unworkable.