-
-
Notifications
You must be signed in to change notification settings - Fork 13.6k
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
ocaml: enable parallel building #142723
ocaml: enable parallel building #142723
Conversation
Enable parallel building for ocaml-4.06 and above. tested as: $ nix build -f. ocaml-ng.ocamlPackages_{4_{00_1,01_0,02,03,04,05,06,07,08,09,10,11,12,13},latest}.ocaml --keep-going --rebuild ocaml build system supports parallel building, but but for multiple top-level targets at the same time as it usually spawns subprocess $(MAKE) that occasionally conflict with one another. To work it around we use tiny Makefile with a single rule that calls top-level targets sequentially as makefile calls: nixpkgs_world_bootstrap_world_opt: $(MAKE) world $(MAKE) bootstrap $(MAKE) world.opt On a 16-core machine ocaml-4.12 build speeds up from 6m55s to 1m35s. Releases 4_00_1, 4_01_0, 4_04 and 4_05 still have some race in them. Thus this change enables parallel builds only for ocaml-4.06 and above.
ocaml 4.12.0 builds successfully for me on nixos x86_64 and macos 10.15. Can't easily say whether it actually has any effect on macos though. |
cc @vbgl |
Are you sure you want to change the derivation for OCaml 4.00.1? |
When/if So far it does it by having a verbatim copy of |
This pull request has been mentioned on NixOS Discourse. There might be relevant details there: |
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.
Looks good to me, and the added complexity seems warranted.
I will merge in a few days if nobody objects until then.
IMHO, the change made to the derivation for OCaml 4.00 makes no sense. |
reopened without the ocaml 4.00 change as #150128 |
Enable parallel building for ocaml-4.08 and above. tested as: $ nix build -f. ocaml-ng.ocamlPackages_{4_{00_1,01_0,02,03,04,05,06,07,08,09,10,11,12,13},latest}.ocaml --keep-going ocaml build system supports parallel building, but but for multiple top-level targets at the same time as it usually spawns subprocess $(MAKE) that occasionally conflict with one another. To work it around we use tiny Makefile with a single rule that calls top-level targets sequentially as makefile calls: nixpkgs_world_bootstrap_world_opt: $(MAKE) world $(MAKE) bootstrap $(MAKE) world.opt On a 16-core machine ocaml-4.12 build speeds up from 6m55s to 1m35s. Releases 4_00_1, 4_01_0, 4_04 and 4_05 still have some race in them. Thus this change enables parallel builds only for ocaml-4.06 and above. Adapted from NixOS#142723 upstreams's CI tests the parallel makefile: ocaml/ocaml#10235 (comment) The limit was chosen to be 4.08 because it was released in 2019, not too long before the above link.
Enable parallel building for ocaml-4.06 and above. tested as:
ocaml build system supports parallel building, but but for multiple
top-level targets at the same time as it usually spawns subprocess
$(MAKE) that occasionally conflict with one another. To work it around
we use tiny Makefile with a single rule that calls top-level targets
sequentially as makefile calls:
On a 16-core machine ocaml-4.12 build speeds up from 6m55s to 1m35s.
Releases 4_00_1, 4_01_0, 4_04 and 4_05 still have some race in them.
Thus this change enables parallel builds only for ocaml-4.06 and above.