We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
There was an error while loading. Please reload this page.
-os cross
1 parent aeaf607 commit b67b8bfCopy full SHA for b67b8bf
vlib/runtime/runtime.v
@@ -11,6 +11,12 @@ import os
11
// then `nr_jobs` will return that number instead.
12
// This is useful for runtime tweaking of e.g. threaded or concurrent code.
13
pub fn nr_jobs() int {
14
+ $if cross ? {
15
+ // A single thread is *more likely* to work consistently everywhere during bootstrapping.
16
+ // NB: the compiler itself uses runtime.nr_jobs() and sync.pool to process things in parallel
17
+ // in its cgen stage. Returning 1 here, increases the chances of it working on non linux systems.
18
+ return 1
19
+ }
20
mut cpus := nr_cpus() - 1
21
// allow for overrides, for example using `VJOBS=32 ./v test .`
22
vjobs := os.getenv('VJOBS').int()
0 commit comments