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
buildLuaPackage: set makeFlags directly instead of through preBuild #29954
Conversation
This is definitely better than the status quo, although |
ffe9711
to
c5d444c
Compare
Updated. I'm curious, could you explain the difference between |
Also cc @richardipsum. |
|
@orivej Thanks for the comprehensive explanation, that explains why Also I forgot I should mention that my main concern is breaking any currently successful builds of lua packages (even though that seems unlikely). I would have tested building all lua packages if it weren't for my currently low disk space and low powered machine. I can probably get around to testing building of all the lua packages at some point if no one else does, when or if I get access to another slightly better machine. |
I'll test this later, both without other changes and after simplifying existing lua-packages. |
c5d444c
to
e07a64b
Compare
@orivej So I made a start on testing these. First I tested which packages on master actually do build without this change. To do this I came up with the following simple shell script (I'm not sure if there's a better way?): build-lua-packages#! /usr/bin/env bash
set -e
cd $(nix-instantiate --find-file nixpkgs)
nix-build -A luaPackages.luabitop
nix-build -A luaPackages.luacheck
# nix-build -A luaPackages.luaevent # disabled
nix-build -A luaPackages.luaexpat
nix-build -A luaPackages.luafilesystem
nix-build -A luaPackages.luaposix
nix-build -A luaPackages.lpty
nix-build -A luaPackages.lua-iconv
nix-build -A luaPackages.luasec
nix-build -A luaPackages.luasocket
nix-build -A luaPackages.luxio
# nix-build -A luaPackages.luazip # disabled
nix-build -A luaPackages.luazlib
nix-build -A luaPackages.luastdlib
nix-build -A luaPackages.lrexlib
nix-build -A luaPackages.luasqlite3
nix-build -A luaPackages.lpeg
nix-build -A luaPackages.cjson
nix-build -A luaPackages.mpack
nix-build -A luajitPackages.luabitop
nix-build -A luajitPackages.luacheck
nix-build -A luajitPackages.luaevent
# nix-build -A luajitPackages.luaexpat # master fails
nix-build -A luajitPackages.luafilesystem
nix-build -A luajitPackages.luaposix
nix-build -A luajitPackages.lpty
nix-build -A luajitPackages.lua-iconv
nix-build -A luajitPackages.luasec
nix-build -A luajitPackages.luasocket
nix-build -A luajitPackages.luxio
# nix-build -A luajitPackages.luazip # master fails
nix-build -A luajitPackages.luazlib
nix-build -A luajitPackages.luastdlib
nix-build -A luajitPackages.lrexlib
nix-build -A luajitPackages.luasqlite3
nix-build -A luajitPackages.lpeg
# nix-build -A luajitPackages.cjson # master fails
# nix-build -A luajitPackages.mpack # marked as broken
nix-build -A lua51Packages.luabitop
nix-build -A lua51Packages.luacheck
nix-build -A lua51Packages.luaevent
nix-build -A lua51Packages.luaexpat
nix-build -A lua51Packages.luafilesystem
nix-build -A lua51Packages.luaposix
nix-build -A lua51Packages.lpty
nix-build -A lua51Packages.lua-iconv
nix-build -A lua51Packages.luasec
nix-build -A lua51Packages.luasocket
nix-build -A lua51Packages.luxio
nix-build -A lua51Packages.luazip
nix-build -A lua51Packages.luazlib
nix-build -A lua51Packages.luastdlib
nix-build -A lua51Packages.lrexlib
nix-build -A lua51Packages.luasqlite3
nix-build -A lua51Packages.lpeg
nix-build -A lua51Packages.cjson
nix-build -A lua51Packages.mpack The commented out lines represent those which do not build, either due to being disabled or marked as broken, or if they just fail to build. 3 luajit packages fail to build (which are not disabled or marked as broken), so they've been commented out. So with this change, so far already
I have a feeling it could be the |
Ah I think I finally understand what's happening, it seems as though setting
(I renamed the name to So what should be done now..? 😕 |
Okay it seems like simply setting |
I'm not sure why the build for cjson fails for macOS, I don't use it. |
So that lua packages can override it without having to resort to setting makeFlagsArray in preBuild.
marking it as broken
2aa384d
to
1faa29f
Compare
I think this is ready for merge now, I tested building all the rest and they work. Perhaps the macOS build failure for cjson happens without this change as well. |
src = fetchFromGitHub { | ||
owner = "ittner"; | ||
repo = "lua-iconv"; | ||
rev = "e8d34024a6b185a759733915f116cc5588550261"; | ||
rev = name; |
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.
@vyp Curious why this is changing?
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.
@vyp (Since the tag could be moved, which would then break the sha256)
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.
Since the commit hash was tagged with that, it's simpler to just use the tag name instead. This is the usual case with most other nix package expressions, since the upstream authors usually follow the same pattern for naming new releases and tags, updating a package is usually a simple change to version
and the src.sha256
. Usually tags never move so it's fine. Does that explain?
If you want I could revert this but it would be irregular. In fact I'm surprised I didn't pick this up when reviewing #29949.
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.
To be honest, my last commit here should have really been part of a separate PR I think, but oh well. :/
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.
No need to revert, I'm the newcomer here 😄
I was just curious, thanks for explaining.
pkgs/top-level/lua-packages.nix
Outdated
preConfigure = "substituteInPlace config --replace 'CC= gcc' '';" | ||
|
||
preConfigure = '' | ||
substituteInPlace config --replace 'CC= gcc' '''; |
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.
That's a bit confusing, they just meant --replace "CC= gcc" ""
.
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.
Oh yeah that's simpler, good point. I was just mindlessly changing some formatting and wasn't thinking much. 🙈
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.
@vyp Thank you very much! Sorry for the delay, I'm on a two week vacation and don't have much time for computer activities.
Perhaps the macOS build failure for cjson happens without this change as well.
hydra does not build cjson for darwin, so I'm going to assume that we are not breaking it.
I renamed the name to
luachecc
temporarily to force it to build because otherwise it just shows the path to the previously built luacheck.
This can also be accomplished with the --check
option.
To do this I came up with the following simple shell script (I'm not sure if there's a better way?)
AFAIK classification of builds into those that were broker before the patch, broken after, or broken always, is not automated yet, and I hope to automate it.
These involve: - Formatting and spacing. - Switching to using fetchFromGitHub where possible. - Adding missing meta attributes. - Correcting license values or adding missing license values. - Adding vyp as maintainer for unmaintained packages. None of these changes should affect the build result. A different revision is used for luasqlite3, however, the source code between these revisions is actually the same. (And the advantage is that the new revision is a tagged release.)
1faa29f
to
acc076d
Compare
No problem at all, there's no rush, enjoy! 😄 🙌
Just to be clear, I didn't test on darwin myself, I was just referring to the travis build, but cool! 👍
Oh sweet, thank you. This isn't on the man page for Thanks for taking the time to review during your vacation. 😊 |
@orivej Hi! I have more incoming changes to this file (additional packages). Should I base them on this PR? Or can I just adopt the conventions adopted in this file and submit based on master? EDIT: I just read that you're on vacation currently, apologies for pinging you while on vacation. |
@richardipsum Submitting a PR against master should be fine, go ahead. 👍 If it gets merged before this, and there's conflicts here, I can just rebase. |
Motivation for this change
So that lua packages can override it without having to resort to setting makeFlagsArray in preBuild.
See discussion at #29949 (comment).
@orivej So this is untested (I only tested building a few select lua packages), but it seems like the
// attrs
(line 16) means that anything use buildLuaPackage will be able to override/setmakeFlags
just by setting it? Is this something like what you wanted? If not of course feel free to discard and close, or otherwise modify/fix.cc @Wyvie from
git blame
.Things done
build-use-sandbox
innix.conf
on non-NixOS)nix-shell -p nox --run "nox-review wip"
./result/bin/
)