WebAssembly / spec

WebAssembly specification, reference interpreter, and test suite.
https://webassembly.github.io/spec/
Other
3.09k stars 438 forks source link

build system/interpreter: `make test` isn't parallel anymore #1679

Closed tharvik closed 9 months ago

tharvik commented 10 months ago

when trying to run tests for the interpreter with multiple jobs, it fails as two dune build are launch at the same time.

small repro (with a cleaned tree)

cd interpreter
make -j2 test

gives (YMMV)

rm -f wasm
dune build smallint.exe
dune build wasm.exe
Error: A running dune (pid: 10553) instance has locked the build directory. If
this is not the case, please delete _build/.lock
make: *** [Makefile:58: unittest/smallint] Error 1
make: *** Waiting for unfinished jobs....

btw, I found out that there is also the partest target, which strangly doesn't fail. further investigations show that quiettest doesn't actually run unittest, is it wanted?

zapashcanon commented 9 months ago

In dune, there's no need to pass the -j parameter, it's going to use many jobs by default.

In Make, -j is set to 1 by default because most makefiles don't support parallel builds - which is not true with dune.

So you can simply run make test and let dune set the correct number of jobs.

rossberg commented 9 months ago

Sorry, I missed this issue before. As @zapashcanon said, the dune build is parallelised automatically. As for the test suite, you'll have to use partest to run that in parallel (and always did). So make partest is what you want. I now tweaked the makefile to have that run unittests as well.