-
Notifications
You must be signed in to change notification settings - Fork 248
Don't duplicate the configureFlags
when not on Windows
#1420
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
Conversation
When not on Windows, the `configureFlags` attr of `libmpc` is set to `(drv.configureFlags or [])`. Since `drv.configureFlags` seems to be equal to `["--enable-static" "--disable-shared"]` (at least on my machine), `configureFlags` appears to be merged with itself and in the end, it is equal to: `["--enable-static" "--disable-shared" "--enable-static" "--disable-shared"]`. You can verify this by comparing the derivations of `libmpc` with and without this patch. This changes the derivation of `libmpc` as well the derivation of all dependent packages, like `gcc`, causing cache misses from https://cache.nixos.org/. Because these packages are built and stored in the IOHK cache, users don't notice this, until they use a different version of `nixpkgs` than the one pinned by `haskell.nix`, e.g., one with a different version of `glibc` so that the IOHK cache cannot be used. This results in `gcc` and other packages being built from scratch instead of being downloaded from https://cache.nixos.org/. Fix this by hoisting the conditional one level higher so that `overrideAttrs` isn't even called on non-Windows OSes. Do the same for `mpfr` for consistency. I haven't tested this on Windows. I'm not sure whether I have hoisted the conditional too high, see the first comment in the file.
I don't really understand this. We are overriding |
When I wrote the explanation above, I thought it was because Actually, after opening the PR, I discovered that While experimenting with it, I noticed that the However, this PR does fix the problem of the duplicate flags on my machine (which is a bug IMHO), but probably not in the proper way (I also don't know whether it does the right thing on Windows). |
I wonder why this used Is there a way to reproduce the issue you are seeing? It seems like something somewhere else must have make a distinction between In particular I would love to be able to run a |
Yeah, we thought the same 🙂.
Something to reproduce:
|
It seems that even just The issue seems to be caused by NixOS/nixpkgs@f110a18 Found using the following script with
|
…-output-hk#1420)" This reverts commit 0c9142a.
When not on Windows, the
configureFlags
attr oflibmpc
is set to(drv.configureFlags or [])
. Sincedrv.configureFlags
seems to be equal to["--enable-static" "--disable-shared"]
(at least on my machine),configureFlags
appears to be merged with itself and in the end, it is equalto:
["--enable-static" "--disable-shared" "--enable-static" "--disable-shared"]
.You can verify this by comparing the derivations of
libmpc
with and withoutthis patch.
This changes the derivation of
libmpc
as well the derivation of all dependentpackages, like
gcc
, causing cache misses from https://cache.nixos.org/.Because these packages are built and stored in the IOHK cache, users don't
notice this, until they use a different version of
nixpkgs
than the one pinnedby
haskell.nix
, e.g., one with a different version ofglibc
so that the IOHKcache cannot be used. This results in
gcc
and other packages being built fromscratch instead of being downloaded from https://cache.nixos.org/.
Fix this by hoisting the conditional one level higher so that
overrideAttrs
isn't even called on non-Windows OSes. Do the same for
mpfr
for consistency.I haven't tested this on Windows. I'm not sure whether I have hoisted the
conditional too high, see the first comment in the file.