I had to add ocaml's package stdlib-shims to the derivation of metacoq some time ago (modification inspired from mathcomp I think) and it looks like it build fine upstream (eg. in nixpkgs the CI is green with the modified derivation) however just upating metacoq's CI to use a recent enough master does not work, stdlib-shims is not added as a dependency (see here). I found a way around that works locally on my machine and also on themetacoq CI (see here) but I don't understand how reasonable that script is.
Any recomendations on how to add this stdlib-shims ? I guess multiple coq packages defining plugins will have to use it for 8.16...
I don't quite understand what would explain why the dependency is used in one case and not in the other.
And the line you point to where you test on defaultVersion
looks fishy anyway.
yes, I tried testing on version
and got an error on the comparison function (I guess that version
variable is either undefined or not what I expect)
To be able to test on version
you need to do something like what you did in nixpkgs, i.e., do it after the derivation has computed the version value.
Any idea why the thing I did on nixpkgs does not work on metacoq's CI and locally on my machine though ?
No idea, but clearly that's the thing to debug. I'll try to look into it.
I think I know what the problem is.
Yes.
diff --git a/.nix/coq-overlays/metacoq/default.nix b/.nix/coq-overlays/metacoq/default.nix
index 268ce247..a7985f23 100644
--- a/.nix/coq-overlays/metacoq/default.nix
+++ b/.nix/coq-overlays/metacoq/default.nix
@@ -77,7 +77,7 @@ let
{ passthru = genAttrs packages metacoq_; })
).overrideAttrs (o: {
propagatedBuildInputs = o.propagatedBuildInputs ++
- optional (versionAtLeast o.version "1.0-8.16") coq.ocamlPackages.stdlib-shims;
+ optional (versionAtLeast o.version "1.0-8.16" || o.version == "dev") coq.ocamlPackages.stdlib-shims;
});
in derivation;
in
Unfortunately the "dev" value is not ordered as we would like so when we check that we are beyond a certain version, we have to also consider the dev case.
hm, this create a small discrepancy on our older branches that did not seem to need stdlib-shims (the coq-8.14 and coq-8.15 branches). I guess it is still better than my previous hack...
It looks fine
Just tried a variation on your proposition @Théo Zimmermann (here, if it works fine for the CI I'll submit a PR to the nixpkgs
LGTM
Last updated: Oct 13 2024 at 01:02 UTC