Skip to content
Snippets Groups Projects
  • Mike Hommey's avatar
    4e8e23f4
    Bug 1729383 - Simplify the parallel build setup. r=firefox-build-system-reviewers,mhentges · 4e8e23f4
    Mike Hommey authored
    Historically, client.mk was not invoked with -jn because it would create
    race conditions, but that was actually mostly solved by the addition of
    `.NOTPARALLEL` in bug 422986, although the mechanism of adding -jn via
    `MOZ_MAKE_FLAGS` or `MOZ_PARALLEL_BUILD` has continued well past that.
    
    Nowadays, client.mk is only invoked by mach (it will even bail out if
    that's not the case) and only has one target (`build`) and no
    dependencies.
    
    This means we don't need to rely on `MOZ_PARALLEL_BUILD` to pass `-jn` in
    some cases, and can just always invoke `make -f client.mk` with `-jn`, even
    when we just want no parallelism, in which case we can use `-j1`.
    
    This, in turn, allows to remove the extra allow_parallel argument to
    `_run_make`, and only rely on `num_jobs`, and to remove some of the
    multiple ways the `n` in `-jn` could be set.
    
    Differential Revision: https://phabricator.services.mozilla.com/D124729
    4e8e23f4
    History
    Bug 1729383 - Simplify the parallel build setup. r=firefox-build-system-reviewers,mhentges
    Mike Hommey authored
    Historically, client.mk was not invoked with -jn because it would create
    race conditions, but that was actually mostly solved by the addition of
    `.NOTPARALLEL` in bug 422986, although the mechanism of adding -jn via
    `MOZ_MAKE_FLAGS` or `MOZ_PARALLEL_BUILD` has continued well past that.
    
    Nowadays, client.mk is only invoked by mach (it will even bail out if
    that's not the case) and only has one target (`build`) and no
    dependencies.
    
    This means we don't need to rely on `MOZ_PARALLEL_BUILD` to pass `-jn` in
    some cases, and can just always invoke `make -f client.mk` with `-jn`, even
    when we just want no parallelism, in which case we can use `-j1`.
    
    This, in turn, allows to remove the extra allow_parallel argument to
    `_run_make`, and only rely on `num_jobs`, and to remove some of the
    multiple ways the `n` in `-jn` could be set.
    
    Differential Revision: https://phabricator.services.mozilla.com/D124729