From 39241decdd255bbee85d9085b1ce861e398754f2 Mon Sep 17 00:00:00 2001 From: xumia <59720581+xumia@users.noreply.github.com> Date: Mon, 10 Apr 2023 14:56:30 +0800 Subject: [PATCH] [Build] Fix the reproducible build variable display error in the slave container (#14543) Why I did it Enable the reproducible build for PR build for master branch Fix the reproducible build variable display error in the slave container. The below config is none, although the config is set and takes effect. "SONIC_VERSION_CONTROL_COMPONENTS": "none" How I did it Passing the variable through the slave container command line. The variable has been passed to the slave container and the other docker container by a config file, it is only used to display the value during the build. How to verify it See https://dev.azure.com/mssonic/build/_build/results?buildId=247960&view=logs&j=88ce9a53-729c-5fa9-7b6e-3d98f2488e3f&t=88f376cf-c35d-5783-0a48-9ad83a873284 "SONIC_VERSION_CONTROL_COMPONENTS": "deb,py2,py3,web,git,docker" --- .azure-pipelines/azure-pipelines-repd-build-variables.yml | 7 +------ Makefile.work | 1 + 2 files changed, 2 insertions(+), 6 deletions(-) diff --git a/.azure-pipelines/azure-pipelines-repd-build-variables.yml b/.azure-pipelines/azure-pipelines-repd-build-variables.yml index af77e97e2f..b5b83afcd9 100644 --- a/.azure-pipelines/azure-pipelines-repd-build-variables.yml +++ b/.azure-pipelines/azure-pipelines-repd-build-variables.yml @@ -1,7 +1,2 @@ variables: - ${{ if eq(variables['Build.Reason'],'PullRequest') }}: - VERSION_CONTROL_OPTIONS: 'SONIC_VERSION_CONTROL_COMPONENTS=$([[ "$(System.PullRequest.TargetBranch)" =~ ^20[2-9][0-9]{3}$ ]] && echo deb,py2,py3,web,git,docker)' - ${{ elseif ne(variables['Build.SourceBranchName'],'master') }}: - VERSION_CONTROL_OPTIONS: 'SONIC_VERSION_CONTROL_COMPONENTS=deb,py2,py3,web,git,docker' - ${{ else }}: - VERSION_CONTROL_OPTIONS: '' + VERSION_CONTROL_OPTIONS: 'SONIC_VERSION_CONTROL_COMPONENTS=deb,py2,py3,web,git,docker' diff --git a/Makefile.work b/Makefile.work index 89f55202ed..233a6a6e21 100644 --- a/Makefile.work +++ b/Makefile.work @@ -311,6 +311,7 @@ SONIC_BUILD_INSTRUCTION := make \ MIRROR_URLS=$(MIRROR_URLS) \ MIRROR_SECURITY_URLS=$(MIRROR_SECURITY_URLS) \ MIRROR_SNAPSHOT=$(MIRROR_SNAPSHOT) \ + SONIC_VERSION_CONTROL_COMPONENTS=$(SONIC_VERSION_CONTROL_COMPONENTS) \ $(SONIC_OVERRIDE_BUILD_VARS) .PHONY: sonic-slave-build sonic-slave-bash init reset