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
Haskell generic builder is strict in all the optionalAttrs #94246
Comments
Just noticed that the example I distilled to present was to build the Corrected To Reproduce
Corrected Expected behaviorThe |
Comparing to a default value to detect if an argument was provided forces it to at least WHNF, which can cause failure (e.g., if the argument is a string with a quoted path from a broken package).
haskell-generic-builder: Use args ? attr for passthru (closes #94246)
I guess this is fixed via the merge of #94251. |
Describe the bug
I believe the way the various stage overrides were implemented using set extensions calls with
optionalAttrs
at the end of the generic builder has the unintended consequence of making these all strict at the level of the derivation itself.That is, the final expressions like
extend the derivation set, so they need to be evaluated to the point of their attribute names if any part of the derivation is accessed. The means that the arguments like
postInstall
are full forced in order to compare to""
.This causes top-level haskell breakage when there is any quoting that references a broken package.
To Reproduce
Here is a simple example using the current haskell-updates
When you run with
--show-trace
and dig through it,z3
is getting evaluated as thecryptol
package (which is actually marked as broken) has a configuration-common override that quotes thez3
packageExpected behavior
The
z3
package should not have any effect on a request forghc
as it is not a dependency.Additional context
I believe the safe way to test if arguments were passed or defaulted is to check if they are in
args
as it is strictly the ones that were passedI'll put together a pull request.
Notify maintainers
@peti @infinisil @jmininger as writer of original lines and people who have made recent larger modifications to the generic builder
Metadata
"x86_64-linux"
Linux 5.4.42, NixOS, 20.03.1950.48723f48ab9 (Markhor)
yes
yes
nix-env (Nix) 2.3.4
"nixos-20.03.1950.48723f48ab9"
""
/nix/var/nix/profiles/per-user/root/channels/nixos
The text was updated successfully, but these errors were encountered: