Closed junchih closed 6 months ago
The lua ecosystem needs some love see:
The incentive for patching the interpreter is to increase purity and avoid loading inadvertendly stuff from /usr/local/share/. We could always wrap but someone using ";;" (i.e. "add default") in its LUA_PATH could inadvertendly break stuff. What could be interesting is to add your test cases to https://github.com/NixOS/nixpkgs/pull/177556 .
you can use lua.withPackages(p: [ p.cqueues ]);
to create a lua with the packages you need.
Sorry, don't have much free time to read all the resources.
Let's see how the issue infects daily development work.
require "mypkg"
, and the expecting loading file is mypkg/init.lua
. Testing with nix-shell + lua5_1 will pass, but still could not be interpreted by downloaded original lua 5.1 without any additional configuration.luajit ./main.lua
will surely failed. But weird, the ./main.lua
was just tested by me with the luajit of the OS hosted one. With both same luajit version number, and both same zero configuration.And of course, with correcting LUA_PATH
env, this issue could be nonsense. But I don't think some logically unnecessary configurations is good idea for libraries to be portable and maintaining.
bottomline was: you are right, things are broken and this is bad. Patches/tests welcomes
should be fixed by https://github.com/NixOS/nixpkgs/pull/286822
should be fixed on master see those tests https://github.com/NixOS/nixpkgs/blob/6c0dc5723dac06bfa0ebc2f28b3b3a76ad0e9aac/pkgs/development/interpreters/lua-5/tests/default.nix#L42 . I'll let you close once you are confident that fixed the issue
Describe the bug
Will behave differently on host luajit, nixpkg luajit and nixpkg lua5_1.
Expected behavior
LUA_PATH_DEFAULT
ofluaconf.h
, there is not way lua runtime will automatically defaultly load something like./myPkg/init.lua
, but lua5_1 of nixpkg 22.05 will do this. I'm new to nix, can't see why?Screenshots
On macOS 12.5.1, LuaJIT 2.1.0-beta3
On luajit of nixpkgs 22.05 with helping of shell.nix
On lua5_1 of nixpkgs 22.05 with helping of shell.nix
Notify maintainers
@teto, https://github.com/NixOS/nixpkgs/commit/88842910b52c146bc5ef9c78eed34e5e570ef76c
Metadata