By: Tom Sydney Kerckhove <syd@cs-syd.eu>
Warn about one capability where -N would change something The warning to compile a test suite with -threaded -rtsopts -with-rtsopts=-N fired whenever the thread count was left to the capabilities and there was one of them. That condition both missed cases the advice applies to and invented ones it does not, so it is now decided from the three questions the advice actually depends on, in oneCapabilityWarning. Does the RTS have a single capability? That is what -N raises, so with more than one the tests already run at the same time. Does the machine have more than one processor? That is what -N raises the capability count to, so on a single-processor machine there is nothing to raise it to and nothing worth saying. Would the suite run more than one test at a time if it had the capabilities? That is all the advice buys: the speed, and the thread safety problems that only tests running at the same time find. A suite run with --jobs 4 on one capability runs them one at a time just the same and said nothing about it, so it is now warned. --synchronous, and an Asynchronous bound of a single test, still say nothing, and neither does a build that nix narrowed down to one core, since that resolves to a synchronous run either way. The counts are newtyped because they are two Ints that mean different things and the warning reads both. The message now names capabilities rather than CPU cores. That is what it has always counted, and the two only looked alike while it fired for the capability count alone: a suite told to use four threads on a 64-core machine, without -N, has one capability and 64 cores.