-
-
Notifications
You must be signed in to change notification settings - Fork 15.1k
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
curl overrides are discarded when pulled in via fetchpatch, but overrideAttrs are not #66499
Comments
Repro with: NIX_PATH=. nix-build --no-link survey/default.nix --arg disableOptimization true -A pkgs.libdrm
To repro this: git clone --recursive https://github.com/nh2/static-haskell-nix.git -b nixpkgs-66499-problem-repro-curl-override-discarded
cd static-haskell-nix
NIX_PATH=. nix-build --no-link survey/default.nix --arg disableOptimization true -A pkgs.libdrm (this is the branch in nh2/static-haskell-nix#45) It prints
And
shows that my |
Is there some magic somewhere that makes that |
Some info from @infinisil:
I confirmed:
So indeed that place just overrides my How can I make my |
Maybe something like self: super: {
fetchurl = super.fetchurl.override (old: {
curl = old.curl.override {
gssSupport = false;
# ...
};
});
} |
I should also mention why I actually want to do that: In my overlay, I want to have So I do {
krb5 = previous.krb5.override {
# Note krb5 does not support building both static and shared at the same time.
# That means *anything* on top of this overlay trying to link krb5
# dynamically from this overlay will fail with linker errors.
staticOnly = true;
};
# Disable gss support, because that requires `krb5`,
# which (as mentioned above) is a library that cannot build both
# .a and .so files in its build system.
# That means that if we enable it, we can no longer build the
# dynamically-linked `curl` binary from this overlay.
# But `fetchurl`, `fetchpatch` and so on by default depend on dynamically
# linked `curl` binaries.
curl = (previous.curl.override { gssSupport = false; }).overrideAttrs (old: {
dontDisableStatic = true;
});
} See the dilemma? Having |
That doesn't work, because It seems |
@infinisil said:
Indeed me:
@infinisil siad:
|
This provides a workaround for NixOS#66499, because this way NixOS#66499 (comment) self: super: { fetchurl = super.fetchurl.override (old: { curl = old.curl.override { gssSupport = false; # ... }; }); } works as expected.
I found the fix in #66506. |
This provides a workaround for NixOS#66499, because this way NixOS#66499 (comment) self: super: { fetchurl = super.fetchurl.override (old: { curl = old.curl.override { gssSupport = false; # ... }; }); } works as expected.
…6499. The original intent in commit a1fec86 treewide: assemble all `fetchurlBoot` uses in overrides to `fetchurl` itself was to turn `gssSupport` *off* on Darwin, but the code actually also forced it *on* on Linux. This resulted in previous (e.g. overlays) `.override { gssSupport = false; }` being ignored (NixOS#66499). This commit fixes it by just respecting the old value when it doesn't need to be forced to off.
This provides a workaround for NixOS#66499, because this way NixOS#66499 (comment) self: super: { fetchurl = super.fetchurl.override (old: { curl = old.curl.override { gssSupport = false; # ... }; }); } works as expected.
…6499. The original intent in commit a1fec86 treewide: assemble all `fetchurlBoot` uses in overrides to `fetchurl` itself was to turn `gssSupport` *off* on Darwin, but the code actually also forced it *on* on Linux. This resulted in previous (e.g. overlays) `.override { gssSupport = false; }` being ignored (NixOS#66499). This commit fixes it by just respecting the old value when it doesn't need to be forced to off.
I have this blocker problem currently for
musl
builds in static-haskell-nix:When I override
curl
in an overlay, while also adding afetchpatch
to the properlibdrm/default.nix
, then the the fetchpatch causescurl
to build and fail with linker error.That is because while it does build the curl from my overlay, it seems to ignore what I've given in
.override
(e.g. I givegssSupport = false
, but inside e.g.configurePhase
it's stilltrue
again).I basically do in my overlay
and observe that the
V=1
is in effect, but thegssSupport = false
is not.(I see that in
nix show-derivation
on the.drv
.)What's going on here?
cc from IRC: @matthewbauer @Ericson2314 @dtzWill @cleverca22
Environment
commit bc94dcf
The text was updated successfully, but these errors were encountered: