-
-
Notifications
You must be signed in to change notification settings - Fork 13.9k
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 generate nix packages from luarocks #54978
Conversation
done | ||
|
||
# read returns a non-zero return code when it reaches EOF | ||
# so disable the checks just for the 2 read |
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.
- Given you don't even use
"
you could as well do a normal variable assignment - I would consider using
|| true
with a comment instead ofset +e
— less chances of it getting its own life separate from the initial statements.
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.
coudl you show some code please
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.
HEADER="
/* ${GENERATED_NIXFILE} is an auto-generated file -- DO NOT EDIT!
Regenerate it with:
nixpkgs$ ${0} ${GENERATED_NIXFILE}
These packages are manually refined in lua-overrides.nix
*/
…
"
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.
I see. Done as you suggested. I removed the -e/+e that were helpful to diagnose weird read errors (zsh vs sh) that are not needed anymore.
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.
And maybe kill the comment?
Are |
No, I will remove these commits on next push. |
I pushed an update that I mark as RFC. I reintroduced the wrapLua mechanism etc. After looking at it, I couldn't see much to do to reduce code duplication. It's like python's wrapping infrastructure. Building is a bit verbose because of 2 kinds o messages: and:
I believe these 2 can be worked around but I already spent much time on the lua branch and the current branch works so I would rather fix those later (also it's easier to work on it once it's merged). What I was thinking that could help reduce friction while merging is to remove from the generated packages list those that are already present in nixpkgs. It should prevent failures while letting us some time to finalize the infrastructure (aka update some packages to use lua environments, alias buildLuaRocks to buildLuaPackage and write the doc). @7c6f434c what do you think ? (EDIT: I removed duplicated packages) |
arf I need to add some |
In general, maybe generate a small whitelisted package set of things we lack, then expand to handle more corner cases (nontrivial native dependencies etc.), then replace the current packages when everything is fine? |
I agree with you, that's what I did in the commit "removed packages already available in nixpkgs". I left the overrides inplace since they mostly add buildInputs and should be harmless. |
update script can now accept another csv file as input with -c
I added a -h flag while removing the "-p" one that allowed to specify a specifc package. It made the script more complex for no gain now that we can specify an alternative list. |
thanks for the reviews ! Sorry I forgot about that old comment. I don't expect much (any?) breakage from this merge. I will prepare the next PR that will merge the different systems and should be the sensible one. |
@teto you can remove the first warning by doing something like this before calling luarocks: export HOME=$(pwd)
export USER=$(id -un) On the second issue, I believe you'd need to create a Luarocks configuration file in the builder, with |
Related: #55553 |
@Shados patches welcome. I don't think both problems are that hard to fix but it always takes time. I've tried your recommandation but it doesn't prevent the warning for me. As for the rocktrees, there is an example on how to do it on torch-distro.nix . |
Should this be documented in nixpkgs manual? |
@Pablo1107 there is #55302 that is ready to merge unless someone has suggestions. |
Motivation for this change
Extracted from #33903.
This adds an infrastructure to generate packages (from the whitelist maintainers/scripts/luarocks-packages.csv) from luarocks.org. It supports both the src.rock and rockspec format through the utility luarocks-nix (a fork of luarocks that adds a
nix
command). The infra is inspired by nixpkgs's haskell infra.Running
maintainers/scripts/update-luarocks-packages
will update the content ofpkgs/development/lua-modules/generated-packages.nix
The generated packages can't be added to lua environments yet because for ease of reviewing etc. I used a separate buildLuarocksPackage function but once this is merged, I will make all lua packages use the same buildLuaPackages function. For now, one can test for instance via
NIX_PATH="nixpkgs=/home/teto/nixpkgs2:$NIX_PATH" nix-shell -p lua5_3.pkgs.busted
I marked this Work In Progress because I still need to cleanup the wrap.sh script. I am looking for feedback on the rest though.
Things done
sandbox
innix.conf
on non-NixOS)nix-shell -p nox --run "nox-review wip"
./result/bin/
)nix path-info -S
before and after)