Skip to content
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.hierarchy-builder: init at 0.9.0 #82325

Merged
merged 1 commit into from Mar 11, 2020

Conversation

CohenCyril
Copy link
Contributor

Motivation for this change

Adding the first release of a new coq package.

Things done
  • Tested using sandboxing (nix.useSandbox on NixOS, or option sandbox in nix.conf on non-NixOS linux)
  • Built on platform(s)
    • NixOS
    • macOS
    • other Linux distributions
  • Tested via one or more NixOS test(s) if existing and applicable for the change (look inside nixos/tests)
  • Tested compilation of all pkgs that depend on this change using nix-shell -p nixpkgs-review --run "nixpkgs-review wip"
  • Tested execution of all binary files (usually in ./result/bin/)
  • Determined the impact on package closure size (by running nix path-info -S before and after)
  • Ensured that relevant documentation is up to date
  • Fits CONTRIBUTING.md.

@CohenCyril
Copy link
Contributor Author

@GrahamcOfBorg build coqPackages_8_10.hierarchy-builder coqPackages_8_11.hierarchy-builder

@CohenCyril
Copy link
Contributor Author

I am adding a new coq package @vbgl @Zimmi48

};

nativeBuildInputs = [ which ];
buildInputs = [ coq coq.ocaml coq.ocamlPackages.elpi coq-elpi ];
Copy link
Contributor

Choose a reason for hiding this comment

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

coq-elpi should be propagated.

In the current state, running “From HB Require structures.” fails.

Copy link
Contributor Author

Choose a reason for hiding this comment

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

How do you test this quickly?

Copy link
Contributor Author

Choose a reason for hiding this comment

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

I never understand what should be propagated, e.g. shouldn't coq be propagated?

Copy link
Contributor

Choose a reason for hiding this comment

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

To test: nix-shell -p coqPackages_8_10.hierarchy-builder coqPackages_8_10.coq and then run coqc on a test case (e.g., https://raw.githubusercontent.com/math-comp/hierarchy-builder/master/demo1/hierarchy_0.v).

Should coq be propagated? No. It is likely to use a different version of Coq to build the package and to use it. In the first case, for instance, we don’t need CoqIDE, the manual etc.

Copy link
Contributor Author

Choose a reason for hiding this comment

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

To test: nix-shell -p coqPackages_8_10.hierarchy-builder coqPackages_8_10.coq

That's what I tried and it does not work for me:

$ nix-shell -p coqPackages_8_10.hierarchy-builder                                                                                                   (hierarchy-builder|✔)
error: attribute 'hierarchy-builder' missing, at (string):1:94
(use '--show-trace' to show detailed location information)

Copy link
Contributor

Choose a reason for hiding this comment

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

Let’s start from two identical configurations (same OCaml, same snapshot of the Coq source code). In the first one you run ./configure -coqide no and in the second, you run ./configure -coqide opt.

Are you saying that the fact that using the .vo from the first configuration in the second one does work is a miracle?

I’m still puzzled to get different .cmx files.

Copy link
Contributor

Choose a reason for hiding this comment

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

Are you saying that the fact that using the .vo from the first configuration in the second one does work is a miracle?

No, in that case I believe they should be the same looking at today's sources. But even a single #IFDEF COQIDE could break this.

If it does not work today, then I believe there is something very fishy going on.

I'm not familiar with nix. Do you have 1 source - 1 binary as in opam?

Copy link
Contributor

Choose a reason for hiding this comment

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

Yeah, it would be nice to have part of the standard library dedicated to CoqIDE users! (just kidding).

Do you have 1 source - 1 binary

What do you mean?

Copy link
Contributor

@gares gares Jul 2, 2020

Choose a reason for hiding this comment

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

What I don't know why you would compile coq twice. I debian the output of the compilation of 1 source package can generate many binary packages, so coq & coqide are compiled once and later split. Here you seem to say that you compile the same coq sources twice.

In opam 1 source -> 1 package. So the sources of Coq are used twice, one for compiling coqtop/coqc and one for coqide. Even there, coqc/coqtop (and all its dependencies) are compiled only once (but for a very limited set of files that are linked in both coqtop and coqide)

Copy link
Contributor Author

@CohenCyril CohenCyril Jul 2, 2020

Choose a reason for hiding this comment

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

@gares in nix, it's 1 derivation -> 1 package, a derivation (roughly) is the data of "the source + the dependencies + the commands that are run to fix the sources, build, fixup stuff and install."
Hence if you tune some compiling options, you might create a different coq binary but you definitely create a new nix coq package.

@vbgl
Copy link
Contributor

vbgl commented Mar 11, 2020

@GrahamcOfBorg build coqPackages_8_10.hierarchy-builder coqPackages_8_11.hierarchy-builder

@vbgl vbgl merged commit cf210c0 into NixOS:master Mar 11, 2020
@vbgl
Copy link
Contributor

vbgl commented Mar 11, 2020

Merged into 20.03 as c07561f

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

Successfully merging this pull request may close these issues.

None yet

4 participants