-
-
Notifications
You must be signed in to change notification settings - Fork 14.4k
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
ocamlPackages tree-wide: Move buildInputs that should be nativeBuildInputs #161344
ocamlPackages tree-wide: Move buildInputs that should be nativeBuildInputs #161344
Conversation
f2fc6db
to
70dbc54
Compare
70dbc54
to
2e9d67a
Compare
2e9d67a
to
a43a8a0
Compare
29fd001
to
14d80f6
Compare
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.
Thanks for the PR. How did you test it?
It would be nice to add strictDeps = true
on every derivation which you fix. This allows to test if the partition between buildInputs and nativeBuildInputs is correct without cross compiling. This is the one true way to know if ppx libs belong to buildInputs or to nativeBuildInputs. In case strictDeps do not work at all in problematic cases (everything involving gtk3 is problematic for example), you can leave it to false, of course. But such a PR would bitrot very fast if we cannot set strictDeps to true on a large proportion of them.
@@ -18,7 +18,8 @@ stdenv.mkDerivation rec { | |||
sha256 = "1c807wrpxra9sbb34lajhimwra28ldxv04m570567lh2b04n38zy"; | |||
}; | |||
|
|||
buildInputs = [ ocaml findlib ocamlbuild which camlp4 ]; | |||
nativeBuildInputs = [ ocaml findlib ocamlbuild which ]; | |||
buildInputs = [ camlp4 ]; |
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 suspect this belongs to nativeBuildInput, as it's a preprocessor.
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.
Me and @anmonteiro discussed this and we believe camlp4
will be built and ran while building like ppxes. I would love to be proved wrong and be able to move more things to nativeBuildInputs
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.
Now that strictDeps is set, it only builds with camlp4 in nativeBuildInputs. That answers the question :)
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.
you didn't fix this
I've been running |
adding strictDeps = true to buildDunePackage is a good idea if there are not too many exceptions. |
44ed833
to
f3db7c9
Compare
@symphorien I have now added |
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.
nix-review is happy
I'll merge over the weekend unless someone complains.
@symphorien can I ask you to open a issue about the If you do I could spend some time trying to solve it never week. 🙏 |
This broke |
fixed in #162370 |
Thanks for the quick fix. |
This also broke |
I don't know what makes ppx_let fail, can you have a look @ulrikstrid ? |
Trying to reproduce the error on with Also, I asked in the followup PR if any of you know a good command to build all/most packages across ocaml versions so that I can catch these earlier. |
This broke apron: it builds fine but is not installed properly:
|
I can't reproduce this on master nix-shell -p ocaml-ng.ocamlPackages_4_12.findlib ocaml-ng.ocamlPackages_4_12.apron --run 'ocamlfind query -r apron'
/nix/store/mps7hcb0qp7cf4l5k582asxwxhdl08kx-ocaml-4.12.0/lib/ocaml
/nix/store/mps7hcb0qp7cf4l5k582asxwxhdl08kx-ocaml-4.12.0/lib/ocaml
/nix/store/hiisfrrljwbj99h4q0spqizzj2xgr7c5-ocaml4.12.0-mlgmpidl-1.2.12/lib/ocaml/4.12.0/site-lib/gmp
/nix/store/lf0cyn31apa7yi2f25w6dih528cjbn3d-ocaml4.12.0-apron-0.9.13-dev/lib/ocaml/4.12.0/site-lib/apron
/nix/store/lf0cyn31apa7yi2f25w6dih528cjbn3d-ocaml4.12.0-apron-0.9.13-dev/lib/ocaml/4.12.0/site-lib/apron |
You may need to set the |
This would be the same thing right?
|
Did you try: |
Or |
|
It almost looks like dune2 was somehow available for ppxlib even in a case where it shouldn't have been. I have a PR coming up fixing this, I just need to test it with a couple of other OCaml versions before submitting. |
|
@@ -5,6 +5,7 @@ let param = | |||
version = "6.4"; | |||
sha256 = "15v7yfv6gyp8lzlgwi9garz10wpg34dk4072jdv19n6v20zfg7n1"; | |||
useDune2 = true; | |||
nativeBuildInputs = [cppo]; | |||
buildInputs = [cppo]; |
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.
Is it a left over ?
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.
Can't remember but might be that there's a library component of cppo
that was also needed?
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.
Ok I will do another round. I see other packages with the same issue.
Motivation for this change
To make cross compilation better we need to move a bunch of stuff to
nativeBuildInputs
.Another good reason is that we should get much smaller closures when building ocaml projects.
This PR supersedes #145448 I think.
Things done
sandbox = true
set innix.conf
? (See Nix manual)nix-shell -p nixpkgs-review --run "nixpkgs-review rev HEAD"
. Note: all changes have to be committed, also see nixpkgs-review usage./result/bin/
)nixos/doc/manual/md-to-db.sh
to update generated release notes