From 75cd9fe7fd9a4f35b3baccdc564719e7291cdb64 Mon Sep 17 00:00:00 2001 From: Guohan Lu Date: Mon, 23 Mar 2020 08:56:49 +0000 Subject: [PATCH] [build]: allow to specify timestamp format in the build log only simple/none are supported currently Signed-off-by: Guohan Lu --- Makefile.work | 2 ++ rules/config | 5 +++-- rules/functions | 2 +- slave.mk | 5 +++++ 4 files changed, 11 insertions(+), 3 deletions(-) diff --git a/Makefile.work b/Makefile.work index 1141226ddb35..579d35a1ed60 100644 --- a/Makefile.work +++ b/Makefile.work @@ -33,6 +33,7 @@ # * KERNEL_PROCURE_METHOD: Specifying method of obtaining kernel Debian package: download or build # * SONIC_DPKG_CACHE_METHOD: Specifying method of obtaining the Debian packages from cache: none or cache # * SONIC_DPKG_CACHE_SOURCE: Debian package cache location when cache enabled for debian packages +# * BUILD_LOG_TIMESTAMP: Set timestamp in the build log (simple/none) # ############################################################################### @@ -192,6 +193,7 @@ SONIC_BUILD_INSTRUCTION := make \ SONIC_ENABLE_SYSTEM_TELEMETRY=$(ENABLE_SYSTEM_TELEMETRY) \ SONIC_ENABLE_RESTAPI=$(ENABLE_RESTAPI) \ EXTRA_JESSIE_TARGETS=$(EXTRA_JESSIE_TARGETS) \ + BUILD_LOG_TIMESTAMP=$(BUILD_LOG_TIMESTAMP) \ $(SONIC_OVERRIDE_BUILD_VARS) .PHONY: sonic-slave-build sonic-slave-bash init reset diff --git a/rules/config b/rules/config index 6c9346340ff9..70ac38e29669 100644 --- a/rules/config +++ b/rules/config @@ -16,8 +16,9 @@ SONIC_CONFIG_BUILD_JOBS = 1 # Corresponding -j argument will be passed to make/dpkg commands that build separate packages SONIC_CONFIG_MAKE_JOBS = $(shell nproc) -# SONIC_CONFIG_BUILD_LOG_TIMESTAMP - add timestamp in build log -# SONIC_CONFIG_BUILD_LOG_TIMESTAMP = y +# DEFAULT_BUILD_LOG_TIMESTAMP - add timestamp in build log +# Supported format: simple, none +DEFAULT_BUILD_LOG_TIMESTAMP = none # SONIC_USE_DOCKER_BUILDKIT - use docker buildkit for build. # If set to y SONiC build system will set environment variable DOCKER_BUILDKIT=1 diff --git a/rules/functions b/rules/functions index 9a656130e9c6..7c620f3e3f54 100644 --- a/rules/functions +++ b/rules/functions @@ -17,7 +17,7 @@ GRAY=\033[0m endif endif -ifeq ($(SONIC_CONFIG_BUILD_LOG_TIMESTAMP),y) +ifeq ($(BUILD_LOG_TIMESTAMP),simple) PROCESS_LOG_OPTION = -t endif diff --git a/slave.mk b/slave.mk index 43de48cc5f02..053382450f02 100644 --- a/slave.mk +++ b/slave.mk @@ -159,6 +159,10 @@ ifeq ($(KERNEL_PROCURE_METHOD),) override KERNEL_PROCURE_METHOD := $(DEFAULT_KERNEL_PROCURE_METHOD) endif +ifeq ($(BUILD_LOG_TIMESTAMP),) +override BUILD_LOG_TIMESTAMP := $(DEFAULT_BUILD_LOG_TIMESTAMP) +endif + MAKEFLAGS += -j $(SONIC_BUILD_JOBS) export SONIC_CONFIG_MAKE_JOBS @@ -205,6 +209,7 @@ $(info "SONIC_DEBUGGING_ON" : "$(SONIC_DEBUGGING_ON)") $(info "SONIC_PROFILING_ON" : "$(SONIC_PROFILING_ON)") $(info "KERNEL_PROCURE_METHOD" : "$(KERNEL_PROCURE_METHOD)") $(info "BUILD_TIMESTAMP" : "$(BUILD_TIMESTAMP)") +$(info "BUILD_LOG_TIMESTAMP" : "$(BUILD_LOG_TIMESTAMP)") $(info "BLDENV" : "$(BLDENV)") $(info "VS_PREPARE_MEM" : "$(VS_PREPARE_MEM)") $(info "ENABLE_SFLOW" : "$(ENABLE_SFLOW)")