Skip to content

CI#41

Open
pi8027 wants to merge 2 commits intomasterfrom
ci
Open

CI#41
pi8027 wants to merge 2 commits intomasterfrom
ci

Conversation

@pi8027
Copy link
Owner

@pi8027 pi8027 commented Dec 5, 2025

No description provided.

Note that Docker CI no longer works for Rocq 9.1 because there is no compatible
rerease of Paramcoq.
.nix/config.nix Outdated
Comment on lines 42 to 66
bundles =
let rocq-constraints = {
"9.0" = {
coqPackages.paramcoq.override.version = "v1.1.3+coq9.0";
};
"9.1" = {
coqPackages.paramcoq.override.version =
"937537d416bc5f7b81937d4223d7783d0e687239";
};
};
mc-constraints = {
"master" = {
coqPackages.mathcomp-zify.override.version = "master";
};
};
matrix = {
## The combinations of Rocq and MathComp we test
"8.19" = ["2.3.0"];
"8.20" = ["2.3.0" "2.4.0" "2.5.0"];
"9.0" = ["2.4.0" "2.5.0" "master"];
"9.1" = ["2.4.0" "2.5.0" "master"];
}; in
attrsets.concatMapAttrs (rocq: mcs: listToAttrs (map (mc: {
name = "${rocq}-${mc}";
value = {
coqPackages.coq.override.version = rocq;
coqPackages.mathcomp.override.version = mc;
} // (attrByPath [rocq] {} rocq-constraints)
// (attrByPath [mc] {} mc-constraints);
}) mcs)) matrix;
Copy link
Owner Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

@proux01 Here is my attempt to refactor "bundles", but it looks like I don't understand the semantics of //...

Copy link
Owner Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I managed to fix it.

Copy link
Owner Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I'm still unsure if what I wrote is very idiomatic and easy to understand. Any suggestions?

@pi8027 pi8027 force-pushed the ci branch 3 times, most recently from 1d066b1 to 9637497 Compare December 8, 2025 14:17
@pi8027
Copy link
Owner Author

pi8027 commented Dec 8, 2025

The Nix CI does not seem to correctly handle the dependency from stablesort to MathComp, and MathComp gets compiled twice for each bundle. Also, I probably need only boot and order. How can I fix it?

@pi8027
Copy link
Owner Author

pi8027 commented Dec 8, 2025

The issues I observed:

  • It's not entirely clear how I'm supposed to declare dependencies. bundleInputs in .nix/config.nix is empty. .nix/coq-overlays/stablesort/default.nix is probably the file I'm looking for, but I don't understand the syntax.
  • In some bundles, the dependency from stablesort to mathcomp-ssreflect seems missing. Is this because of the new mathcomp-boot package?

By the way, the dependency from mathcomp-zify to mathcomp-order seems missing here: https://github.com/NixOS/nixpkgs/blob/96ca3529c27caa2ba3e8c17327ec551193cb12dd/pkgs/development/coq-modules/mathcomp-zify/default.nix#L5

@pi8027
Copy link
Owner Author

pi8027 commented Dec 8, 2025

The bundles "9.1-*" are not working. If I understand correctly, they attempt to build the "coq-9.1.0" package in the environment where "rocq-9.0.1" is already installed and then fail.

@CohenCyril
Copy link
Collaborator

@pi8027 please ignore the dependencies from config.nix it is a palliative system which is mostly unused and that we definitely should deprecate, thanks for raising the issue.
The coq-overlays/stablesort/default.nix file follows the documentation of nixpkgs

@CohenCyril
Copy link
Collaborator

CohenCyril commented Dec 8, 2025

By the way, the dependency from mathcomp-zify to mathcomp-order seems missing here: https://github.com/NixOS/nixpkgs/blob/96ca3529c27caa2ba3e8c17327ec551193cb12dd/pkgs/development/coq-modules/mathcomp-zify/default.nix#L5

looks like you are right

stablesort:
needs:
- coq
- paramcoq
Copy link
Owner Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Is it normal that mathcomp-ssreflect and paramcoq do not appear here? I thought needs should list all the dependencies.

inherit version;
propagatedBuildInputs = [ mathcomp.ssreflect paramcoq mathcomp-zify equations ];
propagatedBuildInputs = [ mathcomp-ssreflect paramcoq mathcomp-zify equations ];
}
Copy link
Owner Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I think I recovered the dependency from stablesort to mathcomp-ssreflect by replacing . with - here. What is the difference?

@pi8027 pi8027 force-pushed the ci branch 2 times, most recently from d2b195a to 92350e3 Compare December 9, 2025 16:35
.nix/config.nix Outdated
Comment on lines 68 to 72
rocqPackages =
(if compareVersions "9.0.0" rocq <= 0 || rocq == "master" then
{ rocq-core.override.version = rocq; } else {})
// rocq-bundles.${rocq}.rocqPackages or {}
// mc-bundles.${mc}.rocqPackages or {};
Copy link
Owner Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Apparently, coqPackages.coq.override.version was not enough to avoid installing different versions of Coq and Rocq, and I had to add this. This is perhaps a bug of the coq compatibility package in Nix.

.nix/config.nix Outdated
paramcoq.job = true;
equations.job = true; }
// rocq-bundles.${rocq}.coqPackages or {}
// mc-bundles.${mc}.coqPackages or {}; };
Copy link
Owner Author

@pi8027 pi8027 Dec 10, 2025

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

One pitfall I had was that // did not merge attribute sets recursively. For example,

{ a.b = 1; } // { a.c = 2; }

evaluates to { a.c = 2; }, not { a.b = 1; a.c = 2; }.

While I think this behavior is reasonable, I need to merge rocqPackages and coqPackages separately here. Is there a more concise way of doing this?

@pi8027
Copy link
Owner Author

pi8027 commented Dec 10, 2025

before 2.5, boot didn't exist, make it behave as ssreflect

(quote from https://github.com/NixOS/nixpkgs/blob/65fb0bd61387f5e96b211825f031060e3b614e2d/pkgs/development/coq-modules/mathcomp/default.nix#L147)

So should I replace mathcomp-ssreflect with mathcomp-boot (and mathcomp-order) everywhere unless I need all_ssreflect.v?

@pi8027
Copy link
Owner Author

pi8027 commented Dec 10, 2025

I replaced mathcomp-ssreflect with mathcomp-boot and mathcomp-order. Now they appear as separate jobs even for MathComp 2.4 (where they are the same package), and they lack the dependency from the latter to the former. It probably compiles mathcomp-ssreflect twice, which is not ideal. https://github.com/pi8027/stablesort/actions/runs/20102291251?pr=41

@pi8027
Copy link
Owner Author

pi8027 commented Dec 10, 2025

I'm reverting the change since it looks pretty broken.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

3 participants