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

Make sure we're passing the right number of jobs to dune everywhere #162

Open
gaborigloi opened this issue Nov 3, 2017 · 7 comments
Open

Comments

@gaborigloi
Copy link
Contributor

gaborigloi commented Nov 3, 2017

As the dune manuals says here: https://dune.readthedocs.io/en/latest/usage.html#invocation-from-opam , we should pass the number of jobs from OPAM to dune, both for the build and test instructions:

build: [["dune" "build" "-p" name "-j" jobs]]
build-test: [["dune" "runtest" "-p" name "-j" jobs]]

We don't do this for all of our packages, so we should update our opam files where necessary. This will ensure that dune will use the concurrency option provided by opam, and that we can centrally control the number of jobs when building xs-opam by passing the -j parameter to OPAM - dune uses all the cores by default.

@gaborigloi gaborigloi changed the title Make sure we're passing the right number of jobs to jbuilder everywhere Make sure we're passing the right number of jobs to dune everywhere Oct 10, 2018
@psafont
Copy link
Member

psafont commented Aug 12, 2019

in packages/xs:

$ rg "\[.*(\"dune\"(?!.*\"-j\"| \{.*\})).*\]" --pcre2
fd-send-recv.2.0.1/opam
20:  ["dune" "build" "@doc" "-p" name] {with-doc}

crc.2.1.0/opam
9:build: [[ "dune" "build" "-p" name ]]

xapi-rrd.1.6.0/opam
12:  ["dune" "runtest" "-p" name] {with-test}

in xs-extra:

xen-api-sdk.master/opam
14:build: [[ "dune" "build" "-p" name ]]

xapi-types.master/opam
7:build: [[ "dune" "build" "-p" name ]]

xapi-forkexecd.master/opam
11:  ["dune" "runtest" "-p" name] {with-test}

xe.master/opam
7:build: [[ "dune" "build" "-p" name ]]

xapi-database.master/opam
7:build: [[ "dune" "build" "-p" name ]]

xen-api-client-lwt.master/opam
14:build: [[ "dune" "build" "-p" name ]]

xapi-nbd.master/opam
9:  ["dune" "runtest"] {with-test}

xapi-client.master/opam
7:build: [[ "dune" "build" "-p" name ]]

xen-api-client-async.master/opam
14:build: [[ "dune" "build" "-p" name ]]

xapi-consts.master/opam
7:build: [[ "dune" "build" "-p" name ]]

xen-api-client.master/opam
16:  ["dune" "build" "-p" name]

xapi-cli-protocol.master/opam
7:build: [[ "dune" "build" "-p" name ]]

xapi.master/opam
8:  ["dune" "build" "-p" name]

rrd-transport.master/opam
9:  ["dune" "runtest" "-p" name] {with-test}

xapi-datamodel.master/opam
7:build: [[ "dune" "build" "-p" name ]]

@lindig
Copy link
Collaborator

lindig commented Aug 29, 2019

The dune documentation still recommends providing -j but I strongly believe that dune uses an optimal number of processes by itself without -j. Hence, I believe this is not critical at all.

build: [
  ["dune" "subst"] {pinned}
  ["dune" "build" "-p" name "-j" jobs]
]

@psafont
Copy link
Member

psafont commented Aug 29, 2019

I strongly believe that dune uses an optimal number of processes by itself

That's correct, not sure why the docs recommend it: ocaml/dune#726

@lindig
Copy link
Collaborator

lindig commented Aug 29, 2019

I now think that if you restrict the number of processes for Opam, this information needs to be passed on to Dune. It does not matter if you want to maximise concurrency.

@gaborigloi
Copy link
Contributor Author

Yes I think the point of this is that you can control the number of processes from opam when installing multiple things in parallel.

@lindig
Copy link
Collaborator

lindig commented Aug 29, 2019

Discussion here: https://discuss.ocaml.org/t/opam-and-dune-j-parameter/4299 The interaction of -j at the Opam and Dune level does not look well defined.

@psafont
Copy link
Member

psafont commented May 5, 2023

There are no packages remaining in xs-extra, for xs the same packages are present

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

No branches or pull requests

3 participants