-
-
Notifications
You must be signed in to change notification settings - Fork 19.8k
{coq,rocq}Packages.mk{Coq,Rocq}Derivation: move env variables into env for structuredAttrs #492142
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
Changes from all commits
File filter
Filter by extension
Conversations
Jump to
Diff view
Diff view
There are no files selected for viewing
| Original file line number | Diff line number | Diff line change |
|---|---|---|
|
|
@@ -98,6 +98,7 @@ let | |
| "dropAttrs" | ||
| "dropDerivationAttrs" | ||
| "keepAttrs" | ||
| "env" | ||
| ] | ||
| ++ dropAttrs | ||
| ) keepAttrs; | ||
|
|
@@ -162,8 +163,8 @@ let | |
| "COQPLUGININSTALL=$(OCAMLFIND_DESTDIR)" | ||
| ]; | ||
| docdir-flags = [ "COQDOCINSTALL=$(out)/share/coq/${coq.coq-version}/user-contrib" ]; | ||
| COQUSERCONTRIB = "$out/lib/coq/${coq.coq-version}/user-contrib"; | ||
| in | ||
|
|
||
| stdenv.mkDerivation ( | ||
| removeAttrs ( | ||
| { | ||
|
|
@@ -187,6 +188,15 @@ stdenv.mkDerivation ( | |
| args.overrideBuildInputs or ([ coq ] ++ (args.buildInputs or [ ]) ++ extraBuildInputs); | ||
| inherit enableParallelBuilding; | ||
|
|
||
| env = | ||
| optionalAttrs setCOQBIN { | ||
| COQBIN = "${coq}/bin/"; | ||
| } | ||
| // optionalAttrs (args ? useMelquiondRemake) { | ||
| inherit COQUSERCONTRIB; | ||
| } | ||
| // (args.env or { }); | ||
|
Member
Author
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. Should the
Contributor
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. I think that's open to interpretation. It depends on who should have the final say for 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. |
||
|
|
||
| meta = | ||
| ( | ||
| { | ||
|
|
@@ -208,7 +218,6 @@ stdenv.mkDerivation ( | |
| // (args.meta or { }); | ||
|
|
||
| } | ||
| // (optionalAttrs setCOQBIN { COQBIN = "${coq}/bin/"; }) | ||
| // (optionalAttrs (!args ? installPhase && !args ? useMelquiondRemake) { | ||
| installFlags = coqlib-flags ++ docdir-flags ++ extraInstallFlags; | ||
| }) | ||
|
|
@@ -226,8 +235,7 @@ stdenv.mkDerivation ( | |
| runHook postInstall | ||
| ''; | ||
| }) | ||
| // (optionalAttrs (args ? useMelquiondRemake) rec { | ||
| COQUSERCONTRIB = "$out/lib/coq/${coq.coq-version}/user-contrib"; | ||
| // (optionalAttrs (args ? useMelquiondRemake) { | ||
| preConfigurePhases = [ "autoconf" ]; | ||
| configureFlags = [ "--libdir=${COQUSERCONTRIB}/${useMelquiondRemake.logpath or ""}" ]; | ||
| buildPhase = "./remake -j$NIX_BUILD_CORES"; | ||
|
|
||
Uh oh!
There was an error while loading. Please reload this page.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
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 wantargsto shadow the "default values" below?These coq & rcoq builders would benefit from being refactored to use
extendMkDerivation.