-
-
Notifications
You must be signed in to change notification settings - Fork 15.3k
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
luaPackages.bit32: Tiny patch to fix a LuaJIT-incompatible declaration #63569
Conversation
The patch is certainly fine, though that just avoids a warning without any real effect. Have you tested in some way that the resulting package works well? |
is that sthg that is supported upstream ? else it could bring trouble putting it into nixpkgs. I remember sthg about bit32 being embedded for 5.1 but a separate package for 5.2 etc. |
@vcunat it should do, although I haven't checked. I'll do that shortly. @teto you have it the wrong way around -- bit32 was added as a builtin module in Lua 5.2, and backported as a stand-alone module for 5.1. I was mostly just being conservative in adding the |
@vcunat I just did some very non-exhaustive testing ( |
# Small patch in order to no longer redefine a Lua 5.2 function that Luajit | ||
# 2.1 also provides, see https://github.com/LuaJIT/LuaJIT/issues/325 for | ||
# more | ||
patches = [ |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
can't we patch just for isLua51 then, like patches = optionals isLua51 ./bit32.patch;
.
It would limit potential issues to lua51 (some damage control).
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
(Re)defining these macros is quite safe, as their exact implementation is even documented (and doesn't change AFAIK).
ok then. I don't think it should be patched unconditionnally though see my comment. |
Hmm, |
The generated package contains |
We don't even have any lua older than 5.1 anymore. |
@vcunat @teto Luarocks has some provision for tracking "builtin" modules, and it has We could maybe come up with some similar mechanism in nixpkgs, perhaps by universally removing |
@vcunat also please note, the semantics of LuaJIT's |
Yes, I didn't mean to imply they're interchangeable. |
# Small patch in order to no longer redefine a Lua 5.2 function that Luajit | ||
# 2.1 also provides, see https://github.com/LuaJIT/LuaJIT/issues/325 for | ||
# more | ||
patches = [ |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
(Re)defining these macros is quite safe, as their exact implementation is even documented (and doesn't change AFAIK).
Motivation for this change
Makes it build cleanly against LuaJIT.
Things done
sandbox
innix.conf
on non-NixOS)nix-shell -p nix-review --run "nix-review wip"
./result/bin/
)nix path-info -S
before and after)