ocamlPackages: recurse into all ocamlPackages sets#115246
ocamlPackages: recurse into all ocamlPackages sets#115246sternenseemann wants to merge 3 commits intoNixOS:masterfrom
Conversation
9e2967d to
47415d0
Compare
|
@ofborg eval |
47415d0 to
a3017e7
Compare
|
notes for a follow up PR: build failures:
Downloads fail for:
|
|
I have no idea how much time it takes to build ocaml packages. With Python we also do not build packages for all interpreters because of the resources it takes. The Python set is significantly larger though, and many packages are used within Nixpkgs as well. How long does it take to build the whole ocaml set on say a quad core machine? Be reasonable.
There is a difference between building only the compilers, and building the entire package sets. Building the compilers seems more reasonable. This PR causes 5000+ (re)builds. If these are 5000+ new builds, then I am against this change. |
6618 new packages per platform.
With a max of 40 concurrent jobs half of the packages (~3500 of ~6618) took 35 minutes. |
|
Build output was to big for github comments https://termbin.com/5gzp This is a semi-automatic executed nixpkgs-review with nixpkgs-review-checks extension. It is checked by a human on a best effort basis and does not build all packages (e.g. lumo, tensorflow or pytorch). Result of 12 packages marked as broken and skipped:487 packages failed to build and already failed to build on hydra master:5079 packages built:The following issues got detected with the above build packages. Detailsocaml-ng.ocamlPackages.accessor:warning: maintainers-missing Near pkgs/build-support/ocaml/dune.nix:38:3: |
Building the entire
I know, but additionally maintaining these package sets becomes easier if we have some kind of CI, i. e. Hydra and ofborg. Therefore I've opened this PR in this form describing the ideal situation since I just don't know how much resources we can / want to allocate additionally for building OCaml. Building the compilers and some additional sets to the default one sounds good to me as well, as the older sets probably don't see much use anyways. |
|
Recursing into these attribute sets is a very good thing. Building them all on hydra seems like a waste. What you can do is to set the |
Seems fair enough. What do you say to building the newer compilers' sets? For 4.08 we already build quite a few packages, I think, having the latest set built also seems nice. I can look into overriding the |
a3017e7 to
5a6fb6c
Compare
caqti doesn't evaluate for OCaml < 4.04, so we need to make sure caqti figures out on its own that it isn't available before it tries to inherit attributes from caqti, as ofborg apparently doesn't like that. Thanks to laziness we _can_ inherit minimumOCamlVersion which makes this quite simple.
When testing changes to ocamlPackages it can often be hard to notice avoidable regressions in older ocamlPackages sets like the increased minimumOCamlVersion bound of a checkInput causing a dependent package to fail to evaluate in an older set altogether. By adding lib.recurseIntoAttrs to all ocamlPackages sets, test tools and ofborg will also evaluate older sets, making such problems noticeable more easily. Additionally Hydra will build these sets and offer prebuilt packages via the binary caches. An open question is if the stress this will cause is _really_ worth it for older ocaml versions where also a lot of hard to fix build failures exist at the moment (as a side note, we could use the comprehensive build report hydra would give us to go around and try to fix these packages or mark them as broken). I think we should at least set recurseIntoAttrs for the 4.08 package set and above. The current situation where you have to compile the 4.12 and 4.11 compiler yourself is just not acceptable in my opinion.
5a6fb6c to
06eab6a
Compare
recurseIntoAttrs creates _a lot_ of new build jobs for hydra for often little gain, i. e. the older package sets have a lot of broken packages that aren't really used by anyone, effectively wasting CPU time. Nevertheless it is nice to have them evaluated to find serious evaluation errors and to have the compilers and essential build tools as well as common dependencies built by hydra. This is achieved in this commit by conditionally adding an override setting hydraPlatforms = [] for all except a few whitelisted packages for the non-standard ocamlPackages sets. Currently the list is very short, but it can be expanded easily (suggestions are welcome). A glaring issue of this approach is that we need to constantly keep whitelist updated if we use non-standard ocamlPackages elsewhere or even expose it at the top level since the hydraPlatforms = [] would be propagated.
06eab6a to
b1db382
Compare
|
I've implemented @vbgl's suggestion in b1db382, setting The rebuild count of ofborg for this is inaccurate now as it doesn't take |
vbgl
left a comment
There was a problem hiding this comment.
Cool! The white-list stuff is indeed not ideal. It would be nice to be able to tell hydra: “don’t build this unless it is a dependency of a package you have to build”.
|
@sternenseemann and I talked about this on IRC a bit. I think this is the answer: build all of the packages and all of the compilers, but stop carrying around so many compilers: nixpkgs shouldn't carry around old software without a highly compelling reason. Users of old compilers can get old copies of nixpkgs, or re-package the expression themselves, or another project could create a Nix expression to get old versions of ocaml. |
|
I did some brief looking, these should be marked insecure or removed for CVE-2015-8869:
|
|
|
|
I'm not too happy with the current state of this PR. It looks like what we have now should actually work, but it has the following annoyances:
Another option I could imagine would be only adding |
When testing changes to ocamlPackages it can often be hard to notice
avoidable regressions in older ocamlPackages sets like the
increased minimumOCamlVersion bound of a checkInput causing a dependent
package to fail to evaluate in an older set altogether. By adding
lib.recurseIntoAttrs to all ocamlPackages sets, test tools and ofborg
will also evaluate older sets, making such problems noticeable more
easily.
Additionally Hydra will build these sets and offer prebuilt packages via
the binary caches. An open question is if the stress this will cause is
really worth it for older ocaml versions where also a lot of hard to
fix build failures exist at the moment (as a side note, we could use the
comprehensive build report hydra would give us to go around and try to
fix these packages or mark them as broken). I think we should at least
set recurseIntoAttrs for the 4.08 package set and above. The current
situation where you have to compile the 4.12 and 4.11 compiler yourself
is just not acceptable in my opinion.
Motivation for this change
Things done
sandboxinnix.confon non-NixOS linux)nix-shell -p nixpkgs-review --run "nixpkgs-review wip"./result/bin/)nix path-info -Sbefore and after)