dbuenzli / topkg

The transitory OCaml software packager
http://erratique.ch/software/topkg
ISC License
69 stars 25 forks source link

Default to parallel builds and ignore .git #117

Closed edwintorok closed 6 years ago

edwintorok commented 7 years ago

This should allow for fairer build time comparisons when topkg build is used with ocamlbuild or jbuilder, since jbuilder defaults to 4 parallel jobs, and ocamlbuild to 1.

Having this in topkg would allow to control the number of builds the same way regardless whether ocamlbuild or topkg is used, see https://github.com/diml/topkg-jbuilder/pull/4#issuecomment-320652115.

The .git excludes are something I used to repeat in my _tags files, but might be useful to just ignore them by default. It doesn't matter for small repositories, but for a large .git it can speed up the build a little. The _opam exclude would be useful for opam2 local switches, otherwise ocamlbuild complains of hygiene.

dbuenzli commented 7 years ago

About the .git and _opam excludes, I'm surprised ocamlbuild looks into . directories, besides shouldn't that rather be upstreamed to ocamlbuild ? topkg should not be the place to work around ocamlbuild issues /cc @gasche.

gasche commented 7 years ago

I believe that ocamlbuild already excludes .git by default, but it does not handle _opam in any special way. (Are build artifact stored there in a build of opam packages?). I wouldn't mind adding _opam in the excluded list by default (an explanation of why that is useful would be nice), but that would only be in future ocamlbuild releases.

I checked that using the -X option adds to the list of excluded directories instead of replacing it; if everything goes well, -X .git -X _opam should be equivalent to -X _opam. @edwintorok, why did you need to add -X .git?

edwintorok commented 7 years ago

Looks like ocamlbuild is ignoring .git and other VCS directories since 2014 or so: I've been copying around that traverse exclude from an older _tags file and didn't realize ocamlbuild does the right thing on its own now.

gasche commented 7 years ago

Ignoring _opam by default is now merged in ocamlbuild and should take effect in the next ocamlbuild release. (0.12)

dbuenzli commented 7 years ago

Thanks @gasche.

dbuenzli commented 6 years ago

Thanks your patch is in as 4eb20d16e9c31c2edd6d02e646f5d52224c