-
-
Notifications
You must be signed in to change notification settings - Fork 18.1k
Closed
Labels
0.kind: bugSomething is brokenSomething is broken6.topic: luaLua is a powerful, efficient, lightweight, embeddable scripting language.Lua is a powerful, efficient, lightweight, embeddable scripting language.
Description
Describe the bug
-- "tasting.lua"
print(string.gsub(package.path, ";", "\n").."\n")Will behave differently on host luajit, nixpkg luajit and nixpkg lua5_1.
Expected behavior
- From
LUA_PATH_DEFAULTofluaconf.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? - luajit and lua5_1 of nixpkg 22.05 behave differently. luajit will load all lua module from system path, lua5_1 will load all package from working directory. And both differently with my host luajit, which load module from both working directory and system path.
- Anyway, seems same patch both in lua5_1 and luajit, https://github.com/NixOS/nixpkgs/blob/22.05/pkgs/development/interpreters/luajit/default.nix#L62-L69, but luajit doesn't work expectly, so the default luajit from nixpkg 22.05 can't do anything as a standalone lua interpreter.
Screenshots
On macOS 12.5.1, LuaJIT 2.1.0-beta3
./?.lua
/usr/local/share/luajit-2.1.0-beta3/?.lua
/usr/local/share/lua/5.1/?.lua
/usr/local/share/lua/5.1/?/init.lua
/usr/local/share/lua/5.1/?.lua
/usr/local/share/lua/5.1/?/init.lua
On luajit of nixpkgs 22.05 with helping of shell.nix
/nix/store/db6sp8wgr97zn4qyyb7g42yhr00pqjiy-luajit-2.1.0-2022-04-05/share/lua/5.1/?.lua
/nix/store/db6sp8wgr97zn4qyyb7g42yhr00pqjiy-luajit-2.1.0-2022-04-05/share/lua/5.1/?/init.lua
On lua5_1 of nixpkgs 22.05 with helping of shell.nix
./share/lua/5.1/?.lua
./?.lua
./?/init.lua
Notify maintainers
Metadata
[user@system:~]$ nix-shell -p nix-info --run "nix-info -m"
blabla...
blabla...
...
- system: `"x86_64-darwin"`
- host os: `Darwin 21.6.0, macOS 10.16`
- multi-user?: `no`
- sandbox: `no`
- version: `nix-env (Nix) 2.3.15`
- channels(jack): `"nixpkgs-21.11pre306870.67c80531be6"`
- nixpkgs: `/Users/jack/.nix-defexpr/channels/nixpkgs`Reactions are currently unavailable
Metadata
Metadata
Assignees
Labels
0.kind: bugSomething is brokenSomething is broken6.topic: luaLua is a powerful, efficient, lightweight, embeddable scripting language.Lua is a powerful, efficient, lightweight, embeddable scripting language.