-
-
Notifications
You must be signed in to change notification settings - Fork 14.9k
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
coqPackages: refactor #105877
coqPackages: refactor #105877
Conversation
dafb736
to
f945d78
Compare
2602d63
to
8f4db8c
Compare
5bf33fa
to
82015e8
Compare
ca77b6e
to
d19ecc9
Compare
@GrahamcOfBorg build coqPackages coqPackages_8_10 coqPackages_8_12 |
d19ecc9
to
cef1d2d
Compare
@GrahamcOfBorg build coqPackages coqPackages_8_10 coqPackages_8_12 |
b7fbfc0
to
ac573b1
Compare
@GrahamcOfBorg build coqPackages coqPackages_8_10 coqPackages_8_12 |
This comment has been minimized.
This comment has been minimized.
@GrahamcOfBorg build coqPackages.Cheerios coqPackages.CoLoR coqPackages.InfSeqExt coqPackages.QuickChick coqPackages.StructTact coqPackages.Verdi coqPackages.bignums coqPackages.contribs coqPackages.coq coqPackages.coq-bits coqPackages.coq-elpi coqPackages.coq-ext-lib coqPackages.coqeal coqPackages.coqhammer coqPackages.coqprime coqPackages.coquelicot coqPackages.dpdgraph coqPackages.equations coqPackages.flocq coqPackages.gappalib coqPackages.hierarchy-builder coqPackages.interval coqPackages.iris coqPackages.math-classes coqPackages.mathcomp coqPackages.mathcomp-algebra coqPackages.mathcomp-analysis coqPackages.mathcomp-bigenough coqPackages.mathcomp-character coqPackages.mathcomp-field coqPackages.mathcomp-fingroup coqPackages.mathcomp-finmap coqPackages.mathcomp-real-closed coqPackages.mathcomp-solvable coqPackages.mathcomp-ssreflect coqPackages.metalib coqPackages.multinomials coqPackages.paco coqPackages.paramcoq coqPackages.simple-io coqPackages.ssreflect coqPackages.stdpp coqPackages.tlc |
@vbgl Done, can you double check if I did what you meant? |
"-lablgtkdir ${ocamlPackages.lablgtk}/lib/ocaml/*/site-lib/lablgtk2 -coqide opt"; | ||
csdpPatch = if csdp != null then '' | ||
substituteInPlace plugins/micromega/sos.ml --replace "; csdp" "; ${csdp}/bin/csdp" | ||
substituteInPlace plugins/micromega/coq_micromega.ml --replace "System.is_in_system_path \"csdp\"" "true" | ||
'' else ""; | ||
ocamlPackages = if isNull (args.ocamlPackages or null) then args.ocamlPackages else |
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.
I don’t understand this line.
The mkCoq
function below always set the ocamlPackages
argument, so it is not null, therefore it is ignored and the default ocamlPackages
set is computed depending on coq-version
.
Suggestion: move the logic for computing the right version of OCaml out of the coq derivation (it thus becomes straightforward to overwrite).
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.
The mkCoq
function makes a call to callPackage ../applications/science/logic/coq
which leaves out coqPackages
indeed, but callPackage
provides the ability to override the arguments and hence one can write coq.override {ocamlPackages = whatever;}
to change the version of ocaml used by Coq.
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.
oh, I did two mistakes that cancel each other, sorry! And well spot!
I'll push a fix asap.
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.
I fixed my mistake and documented the new instructions... which are using an attribute customOcamlPackages
.
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.
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.
I feel like you are inventing yet an other overriding mechanism. I’m glad you did not duplicate all parameters (make
& customMake
, etc.). But I won’t argue against it.
Thanks for the fix nonetheless.
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.
There are two reasons combined that made me duplicate this predicate that would not possibly make me duplicate any other. 1. it's a scoped argument, which is passed implicitly by callPackage, so I cannot prevent it from being always set whereas I wanted it to be optional. 2. it's the only argument that is both a derivation and needs to change depending on the Coq version.
I don't see how this is yet another overriding mechanism, I'm merly reusing .override
provided by callPackage
.
Do you see another solution that would make it possible to have the following two derivation build correctly:
coq.override {version = "8.10"};
coq.override {version = "d370a9d1328a4e1cdb9d02ee032f605a9d94ec7a"; customOcamlPackages = ocaml-ng.ocamlPackages_4_09;}
;
Now I tried those two commands, I realize that the second one does not work anymore since I started using fetchzip
everywhere. See my next comment.
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.
What I meant about this overriding scheme being ad-hoc, is that there is an argument whose only purpose is overriding. Notice that now there are two ways to override the ocamlPackages set: either by setting customOCamlPackages
or by overriding, say, ocamlPackages_4_10
.
8c83d77
to
14ee56c
Compare
@GrahamcOfBorg build coqPackages.Cheerios coqPackages.CoLoR coqPackages.InfSeqExt coqPackages.QuickChick coqPackages.StructTact coqPackages.Verdi coqPackages.bignums coqPackages.contribs coqPackages.coq coqPackages.coq-bits coqPackages.coq-elpi coqPackages.coq-ext-lib coqPackages.coqeal coqPackages.coqhammer coqPackages.coqprime coqPackages.coquelicot coqPackages.dpdgraph coqPackages.equations coqPackages.flocq coqPackages.gappalib coqPackages.hierarchy-builder coqPackages.interval coqPackages.iris coqPackages.math-classes coqPackages.mathcomp coqPackages.mathcomp-algebra coqPackages.mathcomp-analysis coqPackages.mathcomp-bigenough coqPackages.mathcomp-character coqPackages.mathcomp-field coqPackages.mathcomp-fingroup coqPackages.mathcomp-finmap coqPackages.mathcomp-real-closed coqPackages.mathcomp-solvable coqPackages.mathcomp-ssreflect coqPackages.metalib coqPackages.multinomials coqPackages.paco coqPackages.paramcoq coqPackages.simple-io coqPackages.ssreflect coqPackages.stdpp coqPackages.tlc |
@GrahamcOfBorg build coqPackages_8_10 coqPackages_8_12 coqPackages_8_13 |
14ee56c
to
c958992
Compare
@GrahamcOfBorg build coqPackages.Cheerios coqPackages.CoLoR coqPackages.InfSeqExt coqPackages.QuickChick coqPackages.StructTact coqPackages.Verdi coqPackages.bignums coqPackages.contribs coqPackages.coq coqPackages.coq-bits coqPackages.coq-elpi coqPackages.coq-ext-lib coqPackages.coqeal coqPackages.coqhammer coqPackages.coqprime coqPackages.coquelicot coqPackages.dpdgraph coqPackages.equations coqPackages.flocq coqPackages.gappalib coqPackages.hierarchy-builder coqPackages.interval coqPackages.iris coqPackages.math-classes coqPackages.mathcomp coqPackages.mathcomp-algebra coqPackages.mathcomp-analysis coqPackages.mathcomp-bigenough coqPackages.mathcomp-character coqPackages.mathcomp-field coqPackages.mathcomp-fingroup coqPackages.mathcomp-finmap coqPackages.mathcomp-real-closed coqPackages.mathcomp-solvable coqPackages.mathcomp-ssreflect coqPackages.metalib coqPackages.multinomials coqPackages.paco coqPackages.paramcoq coqPackages.simple-io coqPackages.ssreflect coqPackages.stdpp coqPackages.tlc |
@GrahamcOfBorg build coqPackages_8_10 coqPackages_8_12 coqPackages_8_13 |
Since I started using
mathcomp.override {version = "#682"; sha256 = "<the sha256>";} but this comes with extra burden for the casual users since there will be no more easy setups mentioning only a branch... @vbgl and @Zimmi48 what do you think? Do you see other solutions? EDIT: I opted for 1. in a quite compact way, we'll see what comes out of this... |
c958992
to
90b7ca2
Compare
@GrahamcOfBorg build coqPackages.Cheerios coqPackages.CoLoR coqPackages.InfSeqExt coqPackages.QuickChick coqPackages.StructTact coqPackages.Verdi coqPackages.bignums coqPackages.contribs coqPackages.coq coqPackages.coq-bits coqPackages.coq-elpi coqPackages.coq-ext-lib coqPackages.coqeal coqPackages.coqhammer coqPackages.coqprime coqPackages.coquelicot coqPackages.dpdgraph coqPackages.equations coqPackages.flocq coqPackages.gappalib coqPackages.hierarchy-builder coqPackages.interval coqPackages.iris coqPackages.math-classes coqPackages.mathcomp coqPackages.mathcomp-algebra coqPackages.mathcomp-analysis coqPackages.mathcomp-bigenough coqPackages.mathcomp-character coqPackages.mathcomp-field coqPackages.mathcomp-fingroup coqPackages.mathcomp-finmap coqPackages.mathcomp-real-closed coqPackages.mathcomp-solvable coqPackages.mathcomp-ssreflect coqPackages.metalib coqPackages.multinomials coqPackages.paco coqPackages.paramcoq coqPackages.simple-io coqPackages.ssreflect coqPackages.stdpp coqPackages.tlc |
@GrahamcOfBorg build coqPackages_8_10 coqPackages_8_12 coqPackages_8_13 |
I'm definitely in favor of option 1, i.e. not making the hash compulsory. However, I missed the reason why you didn't use |
@Zimmi48 cf #105877 (comment) and subsequent discussion |
@vbgl I guess everything should be solved now... |
It appears that it is not rendering correctly in the generated documentation (huge wall of text rather than being a list), https://nixos.org/manual/nixpkgs/unstable/#sec-language-coq |
Motivation for this change
Use a
mkCoqDerivation
function to refactor Coq packages derivations.This smart builder also allows for easier overriding of the source of the derivation.
See the documentation for more details.
Things done
sandbox
innix.conf
on non-NixOS linux)nix-shell -p nixpkgs-review --run "nixpkgs-review wip"
./result/bin/
)nix path-info -S
before and after)