{coq,rocq}Packages.mk{Coq,Rocq}Derivation: move env variables into env for structuredAttrs - #492142
Conversation
|
| // optionalAttrs (args ? useMelquiondRemake) { | ||
| inherit COQUSERCONTRIB; | ||
| } | ||
| // (args.env or { }); |
There was a problem hiding this comment.
Should the args.env be at the end (making the variables above overridable), or at the top?
There was a problem hiding this comment.
I think that's open to interpretation.
It depends on who should have the final say for COQBIN and COQUSERCONTRIB's values; args.COQBIN or setCOQBIN; args.COQUSERCONTRIB or useMelquiondRemake?
Or should we we warning/throwing when there is a conflict? We don't usually do that in nixpkgs, but it would be more explicit if you think this is prone to user error.
7d33727 to
0a7e0a1
Compare
|
Added the same change for |
|
@philiptaron Gentle poke for review? |
|
Could you help debugging the following error: |
|
What exactly are you doing to cause that error? And does this new commit fix the issue? It may not be the right way to go, but at least it would help me understand what is happening. The rocq variant will need a similar fix, whatever it might end up being. |
|
I’m trying to use the coq-nix-toolbox to review this PR. Running |
|
Almost certainly related to https://github.com/rocq-community/coq-nix-toolbox/blob/77b185941e037f5afd21dee4713b8d1be1d67aa9/default.nix#L106 My "fix" doesn't work because that repo seems to override whatever comes out of nixpkgs, not the other way around? I'm not sure that line makes sense anyway? Using For forward compatibility it should blank either |
philiptaron
left a comment
There was a problem hiding this comment.
Change LGTM from the Nixpkgs POV, I don't know the coq part of the ecosystem super-well though.
|
@vbgl Do you have any plans for making the toolbox more compatible with |
|
No plans on my side. |
With structuredAttrs enabled, environment variables should live inside the `env` attrset. In the case of this project, this affects COQBIN, as per NixOS/nixpkgs#492142 , which moves it into env. Setting `COQBIN = "";` in `default.nix` while `env.COQBIN` exists causes an evaluation error: Error: The `env` attribute set cannot contain any attributes passed to derivation. To fix this, remove the attr instead if it exists, in either place.
|
Rebased on top of the pinned nixpkgs commit in coq-nix-toolbox for easier testing. @vbgl Could you take a look at rocq-community/coq-nix-toolbox#460 ? |
|
This is pretty much the only package set in nixpkgs that still has env variables outside of env so I would like to move ahead on this at some point - I have provided a likely solution for downstream and I don't like this issue lingering any more than necessary. @proux01 Any thoughts on this and/or the PR I opened on the toolbox? |
MattSturgeon
left a comment
There was a problem hiding this comment.
Change LGTM from the Nixpkgs POV, I don't know the coq part of the ecosystem super-well though.
Same here
| "dropDerivationAttrs" | ||
| "keepAttrs" | ||
| "enableParallelBuilding" | ||
| "env" |
There was a problem hiding this comment.
Off-topic:
It's unfortunate that // (removeAttrs args args-to-remove) is on the RHS of the update, so we need to explicitly "remove" args that'd shadow explicit overrides below. I assume there are other things that we'd want args to shadow the "default values" below?
These coq & rcoq builders would benefit from being refactored to use extendMkDerivation.
| // optionalAttrs (args ? useMelquiondRemake) { | ||
| inherit COQUSERCONTRIB; | ||
| } | ||
| // (args.env or { }); |
There was a problem hiding this comment.
I think that's open to interpretation.
It depends on who should have the final say for COQBIN and COQUSERCONTRIB's values; args.COQBIN or setCOQBIN; args.COQUSERCONTRIB or useMelquiondRemake?
Or should we we warning/throwing when there is a conflict? We don't usually do that in nixpkgs, but it would be more explicit if you think this is prone to user error.
|
I'd like to move forward on this so it's off my PR list (and because we're getting really close to eliminating these free-ranging env variables overall), but I don't have much bandwidth at the moment to deal with any potential fallout if there are any unexpected issues, so I'd prefer if someone who actually uses Coq/Rocq could weigh in before I push a merge button. |
|
Rebased to resolved merge conflicts. |
With structuredAttrs enabled, environment variables should live inside the `env` attrset. In the case of this project, this affects COQBIN, as per NixOS/nixpkgs#492142 , which moves it into env. Setting `COQBIN = "";` in `default.nix` while `env.COQBIN` exists causes an evaluation error: Error: The `env` attribute set cannot contain any attributes passed to derivation. To fix this, remove the attr instead if it exists, in either place. Update after NixOS/nixpkgs#492142
This probably needs some careful review because of the conditional variables.
Things done
passthru.tests.nixpkgs-reviewon this PR. See nixpkgs-review usage../result/bin/.