-
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
getfenv() is gone in Lua 5.3 #3156
Comments
the same problem, my init.lua calls node.flashindex ("_ init") (). Remove
it in version 5.3 it works, as if it had. In version 5.1 it is mandatory,
still tested both ...
Em qui., 11 de jun. de 2020 às 19:35, Lukáš Voborský <
notifications@github.com> escreveu:
… I'm sorry I don't have time to study the issue myself now. So maybe I am
reporting something while the issue is on the other side of the keyboard. I
guess this has some easy solution.
Expected behavior
LFS example working under Lua 5.3
Actual behavior
node.flashindex("_init")()
Lua error: _init.lua:55: attempt to call a nil value (global 'getfenv')
stack traceback:
_init.lua:55: in main chunk
stdin:1: in main chunk
[C]: in ?
[C]: in ?
Test code
Standard LFS example
<http:///nodemcu/nodemcu-firmware/tree/master/lua_examples/lfs> loaded in
LFS.
node.flashindex("_init")()
NodeMCU startup banner
NodeMCU 3.0.0.0 built with Docker provided by frightanic.com
branch: watertank
commit: 78ab92f
release: 2.0.0-master_20170202 +523
release DTS: 202006112149
SSL: false
build type: float
LFS: 0x10000 bytes total capacity
modules: enduser_setup,file,gpio,http,net,node,rtcmem,rtctime,sjson,sntp,sun,tmr,uart,wifi
build 2020-06-11 22:06 powered by Lua 5.3.5 on SDK 3.0.1-dev(fce080e)
Hardware
ESP8266 ESP-12E
—
You are receiving this because you are subscribed to this thread.
Reply to this email directly, view it on GitHub
<#3156>, or unsubscribe
<https://github.com/notifications/unsubscribe-auth/AB4XEYV2T6ABVWCT7N4Q3PDRWFLZHANCNFSM4N3Z67KA>
.
--
Luciano M. Mercucci
|
This is not a LFS issue; Lua 5.2 (and therefore 5.3) removed the @TerryE will have to update his |
Lua has subversion releases, e.g 5.1.x and these are not breaking, but going from Lua 5.1 to 5.3 is itself a breaking change. I've tried to implement as many of the 5.1 compatibility features as possible but as Nathaniel says the environment architecture was a breaking change on 5.2. We need really need to go through all examples and modules including the In the meantime, as a workaround, you will see that |
Will there also be a solution for loadfile/dofile? |
If you want search lists, why not just stick to |
It seems to me that simple modification should fix the issue: - local G=getfenv()
+ local G=_ENV or getfenv()
G.LFS = setmetatable(lfs_t,lfs_t) However I don't know what's wrong now as I get immediate restart with |
Lukas, that's because
|
I suspect @vsky279's objective is a replacement |
Yes. This means that new Lua developers can use LFS from the get-go without needing an ALso the whole idea of |
As @nwf guessed, my goal was to have So executing whole See _init.lua |
FWIW, I think
can just be
and similarly for the other uses of Regardless of that, tho', please do feel free to open a PR. |
I'm sorry I don't have time to study the issue myself now. So maybe I am reporting something while the issue is on the other side of the keyboard. I guess this has some easy solution.
Expected behavior
LFS example working under Lua 5.3
Actual behavior
Test code
Standard LFS example loaded in LFS.
NodeMCU startup banner
Hardware
ESP8266 ESP-12E
The text was updated successfully, but these errors were encountered: