[build]: Allow user to silence variable dump during make (#5327)
Most of the devs know how they configured their build. Instead of generating a huge header for every make operation, allow the user to silence it via an environment variable. SONIC_BUILD_QUIETER=y make ... Also add SONIC_BUILDER_EXTRA_ENV variable which allows the user to inject arbitrary options to the docker run cmdline for the builder. SONIC_BUILDER_EXTRA_CMDLINE="-e test=var -e var='with spaces'" make ...
This commit is contained in:
parent
1bf6fdc6d2
commit
8bac4904b8
@ -89,11 +89,13 @@ endif
|
|||||||
-include $(PLATFORM_PATH)/rules.dep
|
-include $(PLATFORM_PATH)/rules.dep
|
||||||
endif
|
endif
|
||||||
|
|
||||||
|
ifndef SONIC_BUILD_QUIETER
|
||||||
$(info "SONIC_DPKG_CACHE_METHOD" : "$(SONIC_DPKG_CACHE_METHOD)")
|
$(info "SONIC_DPKG_CACHE_METHOD" : "$(SONIC_DPKG_CACHE_METHOD)")
|
||||||
ifneq ($(SONIC_DPKG_CACHE_METHOD),none)
|
ifneq ($(SONIC_DPKG_CACHE_METHOD),none)
|
||||||
$(info "DPKG_CACHE_PATH" : "$(SONIC_DPKG_CACHE_SOURCE)")
|
$(info "DPKG_CACHE_PATH" : "$(SONIC_DPKG_CACHE_SOURCE)")
|
||||||
endif
|
endif
|
||||||
$(info )
|
$(info )
|
||||||
|
endif
|
||||||
|
|
||||||
|
|
||||||
###############################################################################
|
###############################################################################
|
||||||
|
@ -116,7 +116,8 @@ DOCKER_RUN := docker run --rm=true --privileged --init \
|
|||||||
-w $(DOCKER_BUILDER_WORKDIR) \
|
-w $(DOCKER_BUILDER_WORKDIR) \
|
||||||
-e "http_proxy=$(http_proxy)" \
|
-e "http_proxy=$(http_proxy)" \
|
||||||
-e "https_proxy=$(https_proxy)" \
|
-e "https_proxy=$(https_proxy)" \
|
||||||
-i$(if $(TERM),t,)
|
-i$(if $(TERM),t,) \
|
||||||
|
$(SONIC_BUILDER_EXTRA_CMDLINE)
|
||||||
|
|
||||||
include rules/config
|
include rules/config
|
||||||
|
|
||||||
@ -124,6 +125,10 @@ ifneq ($(DOCKER_BUILDER_USER_MOUNT),)
|
|||||||
DOCKER_RUN += $(foreach mount,$(subst $(comma), ,$(DOCKER_BUILDER_USER_MOUNT)), $(addprefix -v , $(mount)))
|
DOCKER_RUN += $(foreach mount,$(subst $(comma), ,$(DOCKER_BUILDER_USER_MOUNT)), $(addprefix -v , $(mount)))
|
||||||
endif
|
endif
|
||||||
|
|
||||||
|
ifdef SONIC_BUILD_QUIETER
|
||||||
|
DOCKER_RUN += -e "SONIC_BUILD_QUIETER=$(SONIC_BUILD_QUIETER)"
|
||||||
|
endif
|
||||||
|
|
||||||
ifneq ($(SONIC_DPKG_CACHE_SOURCE),)
|
ifneq ($(SONIC_DPKG_CACHE_SOURCE),)
|
||||||
DOCKER_RUN += -v "$(SONIC_DPKG_CACHE_SOURCE):/dpkg_cache:rw"
|
DOCKER_RUN += -v "$(SONIC_DPKG_CACHE_SOURCE):/dpkg_cache:rw"
|
||||||
endif
|
endif
|
||||||
|
4
slave.mk
4
slave.mk
@ -189,6 +189,7 @@ export FRR_USER_GID
|
|||||||
## Dumping key config attributes associated to current building exercise
|
## Dumping key config attributes associated to current building exercise
|
||||||
###############################################################################
|
###############################################################################
|
||||||
|
|
||||||
|
ifndef SONIC_BUILD_QUIETER
|
||||||
$(info SONiC Build System)
|
$(info SONiC Build System)
|
||||||
$(info )
|
$(info )
|
||||||
$(info Build Configuration)
|
$(info Build Configuration)
|
||||||
@ -232,6 +233,9 @@ $(info "INCLUDE_KUBERNETES" : "$(INCLUDE_KUBERNETES)")
|
|||||||
$(info "TELEMETRY_WRITABLE" : "$(TELEMETRY_WRITABLE)")
|
$(info "TELEMETRY_WRITABLE" : "$(TELEMETRY_WRITABLE)")
|
||||||
$(info "ENABLE_SYNCHRONOUS_MODE" : "$(ENABLE_SYNCHRONOUS_MODE)")
|
$(info "ENABLE_SYNCHRONOUS_MODE" : "$(ENABLE_SYNCHRONOUS_MODE)")
|
||||||
$(info )
|
$(info )
|
||||||
|
else
|
||||||
|
$(info SONiC Build System for $(CONFIGURED_PLATFORM):$(CONFIGURED_ARCH))
|
||||||
|
endif
|
||||||
|
|
||||||
include Makefile.cache
|
include Makefile.cache
|
||||||
|
|
||||||
|
Loading…
Reference in New Issue
Block a user