Skip to content

Commit eadd74f

Browse files
authored
[build] allow user to override the default number of build jobs (#1255)
User could issue SONIC_BUILD_JOBS=<num> to set number of concurrent build job(s) to run. With this commit, the default setting is still left at 1.
1 parent ee58ee2 commit eadd74f

File tree

2 files changed

+9
-3
lines changed

2 files changed

+9
-3
lines changed

Makefile

+3-1
Original file line numberDiff line numberDiff line change
@@ -13,6 +13,7 @@
1313
# * PASSWORD: Desired password -- default at rules/config
1414
# * KEEP_SLAVE_ON: Keeps slave container up after building-process concludes.
1515
# * SOURCE_FOLDER: host path to be mount as /var/src, only effective when KEEP_SLAVE_ON=yes
16+
# * SONIC_BUILD_JOB: Specifying number of concurrent build job(s) to run
1617
#
1718
###############################################################################
1819

@@ -59,7 +60,8 @@ SONIC_BUILD_INSTRUCTION := make \
5960
SHUTDOWN_BGP_ON_START=$(SHUTDOWN_BGP_ON_START) \
6061
ENABLE_SYNCD_RPC=$(ENABLE_SYNCD_RPC) \
6162
PASSWORD=$(PASSWORD) \
62-
USERNAME=$(USERNAME)
63+
USERNAME=$(USERNAME) \
64+
SONIC_BUILD_JOBS=$(SONIC_BUILD_JOBS)
6365

6466
.PHONY: sonic-slave-build sonic-slave-bash init
6567

slave.mk

+6-2
Original file line numberDiff line numberDiff line change
@@ -74,7 +74,11 @@ ifeq ($(PASSWORD),)
7474
override PASSWORD := $(DEFAULT_PASSWORD)
7575
endif
7676

77-
MAKEFLAGS += -j $(SONIC_CONFIG_BUILD_JOBS)
77+
ifeq ($(SONIC_BUILD_JOBS),)
78+
override SONIC_BUILD_JOBS := $(SONIC_CONFIG_BUILD_JOBS)
79+
endif
80+
81+
MAKEFLAGS += -j $(SONIC_BUILD_JOBS)
7882
export SONIC_CONFIG_MAKE_JOBS
7983

8084
###############################################################################
@@ -86,7 +90,7 @@ $(info )
8690
$(info Build Configuration)
8791
$(info "CONFIGURED_PLATFORM" : "$(if $(PLATFORM),$(PLATFORM),$(CONFIGURED_PLATFORM))")
8892
$(info "SONIC_CONFIG_PRINT_DEPENDENCIES" : "$(SONIC_CONFIG_PRINT_DEPENDENCIES)")
89-
$(info "SONIC_CONFIG_BUILD_JOBS" : "$(SONIC_CONFIG_BUILD_JOBS)")
93+
$(info "SONIC_BUILD_JOBS" : "$(SONIC_BUILD_JOBS)")
9094
$(info "SONIC_CONFIG_MAKE_JOBS" : "$(SONIC_CONFIG_MAKE_JOBS)")
9195
$(info "DEFAULT_USERNAME" : "$(DEFAULT_USERNAME)")
9296
$(info "DEFAULT_PASSWORD" : "$(DEFAULT_PASSWORD)")

0 commit comments

Comments
 (0)