pkgsStatic: fix in combination with __structuredAttrs#428430
pkgsStatic: fix in combination with __structuredAttrs#428430symphorien merged 1 commit intoNixOS:masterfrom
Conversation
e1c7969 to
7ce532c
Compare
|
Can we just do this unconditionally regardless of |
|
the current formulation avoids a mass rebuild |
|
Did this regress recently? Otherwise I think it’s okay to wait for |
this regressed Lix static builds :'( — why not send this and clean it up on staging (by reverting this) as well? |
|
also I don't want to know what happens if a derivation with |
emilazy
left a comment
There was a problem hiding this comment.
Sure, I’m okay landing this if it’s a recent regression. I just didn’t know if it was or not.
|
Could someone link the commit / PR that's being referenced as the source of this issue? |
|
There will be an evaluation error. However quite a few packages already override |
|
However what could work is basically inverting the current test and putting it in |
|
that would have the effect that |
pkgsStatic injects { NIX_CFLAGS_COMPILE = " -static"; }. When
__structuredAttrs is true, it must inject { env.NIX_CFLAGS_COMPILE = "
-static"; } instead, as attributes outside env are ignored.
|
That would actually still work because |
|
wouldn't the adapter move the first NIX_CFLAGS_LINK to env and the the override add it to top-level ? anyway your example also illustrates it well. |
|
My proposal was not that the adapter would move it. It would append to |
alois31
left a comment
There was a problem hiding this comment.
Beside Jade's concern, this also breaks the configureFlags and cmakeFlags just below because the conditional has lower precedence than the attrset merge. (The bug was already there before, but only exposed with env.NIX_CFLAGS_LINK set while now __structuredAttrs is enough.)
7ce532c to
6b621d1
Compare
well spotted, thanks |
6b621d1 to
d0b787a
Compare
alois31
left a comment
There was a problem hiding this comment.
LGTM, does not break my system, and fixes the static lix build. Thanks!
|
On behalf of Lix, thank you so much @symphorien! |
|
Note that the issue does not appear to be related to |
I remember
Try |
|
I confirmed that But yeah.. this just means that |
|
I'm not even sure it is the same issue; the linked bug mentions the difference in flags for |
|
It seems that |
Ah, I hadn't looked that close. I guess there are multiple issues then, and once |
|
sorry I won't be able to fix this, I will not be near computers for a few days. |
Actually the |
Normally `pkgsStatic` adds ` -static` to `NIX_CFLAGS_COMPILE`. Due to a bug this did not apply with `__structuredAttrs`. As the fix [1] has not been backported yet, put it in the package manually. [1] NixOS/nixpkgs#428430 Fixes: https://git.lix.systems/lix-project/lix/issues/962 Change-Id: I6a6a6964c6a33f486ba3df3be16f715ad1b060c3
pkgsStatic injects { NIX_CFLAGS_COMPILE = " -static"; }. When __structuredAttrs is true, it must inject { env.NIX_CFLAGS_COMPILE = " -static"; } instead, as attributes outside env are ignored.
Things done
passthru.tests.nixpkgs-reviewon this PR. See nixpkgs-review usage../result/bin/.Add a 👍 reaction to pull requests you find important.