HomePhabricator

[DEPENDS] Use parallel compilation when building packages

Description

[DEPENDS] Use parallel compilation when building packages

Summary:
This diffs try to guess the number of cores availble on the user machine
and forward it (+1) to the -jX option to make when building the
packages.
This JOBS variable can be overriden by the user and fallback to 1 if
it can't guess the number of cores.

For now only ccache makes use of this feature. This is built on all the platforms and is simple enough for demonstrating the feature.

Test Plan:

cd depends

Edit packages/native_ccache.mk, add the line:

echo "BUILDING WITH -j$(JOBS)" && \

before the line:

$(MAKE) -j$(JOBS)

make V=1

Check in the output that make is invoked with the appropriated -jX
option(for the ccache package).

make V=1 JOBS=2

Check in the output that make is invoked with the appropriated -j2
option (for the ccache package).

make V=1 build-all

Check in the output that the JOBS is propagated to the ccache package of all the targets.

Run the Gitian builds and check the output is still deterministic (clear
the cached packages before building).

Reviewers: #bitcoin_abc, deadalnix

Reviewed By: #bitcoin_abc, deadalnix

Differential Revision: https://reviews.bitcoinabc.org/D4852

Details

Provenance
FabienAuthored on Jan 6 2020, 11:35
FabienPushed on Jan 8 2020, 15:21
Reviewer
Restricted Project
Differential Revision
D4852: [DEPENDS] Use parallel compilation when building packages
Parents
rABC6de391d11463: Add a facility to extract libsecp256k1 from the repository
Branches
Unknown
Tags
Unknown