Join GitHub today
GitHub is home to over 50 million developers working together to host and review code, manage projects, and build software together.Sign up
GitHub is where the world builds software
Millions of developers and companies build, ship, and maintain their software on GitHub — the largest and most advanced development platform in the world.
cmd/dist: support configurable number of build jobs #6799
Problem statement: Currently cmd/dist uses hard coded defaults for the number of concurrent jobs to execute during the early stages of ./make.bash; up to the point of go_bootstrap taking over. This number is 1 on arm machines and 4 everywhere else. For arm specifically this value used to be correct 3 years ago but now dual and quad core arm host are available this unnecessarily delays an already slow c compilation phase. This value can be easily changed after checkout, but as the builders always build from a clean tree this is not an option. It may also be for large x86 machines the value of 4 parallel jobs is too conservative, or to high if operating in a virtualised environment, however this is not the main focus of this proposal. Implementation: I propose to add a new flag cmd/dist which would override the default value. If not set the current defaults of 4 (or 1 for arm) would apply. The proposed name of this flag is -j. This flag would also need to be passed through from the builder command via the existing GO_DISTFLAGS env var. Builder owners can set GO_DISTFLAGS to control the number of parallel jobs during the build allowing them to improve build times. Once the build arrives at go_bootstrap the current behaviour of running runtime.NumCPU() jobs would take over. This does not change as part of this proposal. See also: https://groups.google.com/d/msg/golang-dev/GjhQspYudHk/vNVFsd_49AEJ