[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:
Samuel Angebault 2020-09-10 01:21:47 -07:00 committed by GitHub
parent 1bf6fdc6d2
commit 8bac4904b8
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
3 changed files with 12 additions and 1 deletions

View File

@ -89,11 +89,13 @@ endif
-include $(PLATFORM_PATH)/rules.dep
endif
ifndef SONIC_BUILD_QUIETER
$(info "SONIC_DPKG_CACHE_METHOD" : "$(SONIC_DPKG_CACHE_METHOD)")
ifneq ($(SONIC_DPKG_CACHE_METHOD),none)
$(info "DPKG_CACHE_PATH" : "$(SONIC_DPKG_CACHE_SOURCE)")
endif
$(info )
endif
###############################################################################

View File

@ -116,7 +116,8 @@ DOCKER_RUN := docker run --rm=true --privileged --init \
-w $(DOCKER_BUILDER_WORKDIR) \
-e "http_proxy=$(http_proxy)" \
-e "https_proxy=$(https_proxy)" \
-i$(if $(TERM),t,)
-i$(if $(TERM),t,) \
$(SONIC_BUILDER_EXTRA_CMDLINE)
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)))
endif
ifdef SONIC_BUILD_QUIETER
DOCKER_RUN += -e "SONIC_BUILD_QUIETER=$(SONIC_BUILD_QUIETER)"
endif
ifneq ($(SONIC_DPKG_CACHE_SOURCE),)
DOCKER_RUN += -v "$(SONIC_DPKG_CACHE_SOURCE):/dpkg_cache:rw"
endif

View File

@ -189,6 +189,7 @@ export FRR_USER_GID
## Dumping key config attributes associated to current building exercise
###############################################################################
ifndef SONIC_BUILD_QUIETER
$(info SONiC Build System)
$(info )
$(info Build Configuration)
@ -232,6 +233,9 @@ $(info "INCLUDE_KUBERNETES" : "$(INCLUDE_KUBERNETES)")
$(info "TELEMETRY_WRITABLE" : "$(TELEMETRY_WRITABLE)")
$(info "ENABLE_SYNCHRONOUS_MODE" : "$(ENABLE_SYNCHRONOUS_MODE)")
$(info )
else
$(info SONiC Build System for $(CONFIGURED_PLATFORM):$(CONFIGURED_ARCH))
endif
include Makefile.cache