haskell / happy

The Happy parser generator for Haskell
Other
273 stars 85 forks source link

Can't figure out how to run tests in parallel #264

Closed sgraf812 closed 5 months ago

sgraf812 commented 5 months ago

The test.hs script calls make with -j set to the number of capabilities of the script process. I can't seem to figure out how to increase that number; at the least it does not pick up the number of cpu cores on my machine automatically. It's a bit annoying, but not too bad: I can just change the script to use -j7 (I have 6 cores). Nevertheless, the script seems a bit misleading.

andreasabel commented 5 months ago

https://github.com/haskell/happy/blob/abcd8c02204bb7d1865128a6f0debcd5ab880d79/test.hs#L6-L9

Have you tried to set it via the +RTS -N flag, as described in the docs ? https://hackage.haskell.org/package/base-4.19.0.0/docs/GHC-Conc.html#v:numCapabilities

sgraf812 commented 5 months ago

I have tried, but it is unclear to me where I should pass it. Is it cabal test +RTS -N7? No (I tried). More likely I'll have to do cabal test --test-options="+RTS -N7 -RTS" but that errors out with ... aha, a useful message:

tests: the flag -N7 requires the program to be built with -threaded

Fix incoming.