Fix cache related mellanox bullseye build failures (#9234)

#### Why I did it

Mellanox builds were failing intermittently due to the `issue_version` file and MFT package not building correctly in the Azure pipeline environment (both of these packages were patched to build correctly with bullseye running on the host and buster running on the dockers)

#### How I did it

Fixed two problems:

1. BLDENV is not passed to the Makefiles so the references to this were replaced with correct logic
2. `issue_version` was not defined as a target for bullseye and as such was not cached. Altered the build such that it is defined as a target for bullseye (in the case of buster it builds the file, in the case of bullseye it copies from buster) 

The previous PR fixing this was reverted as it is no longer necessary for a passing build and was not a long-term fix. https://github.com/Azure/sonic-buildimage/pull/9235

#### How to verify it

Build on AZP and verify success.
This commit is contained in:
Alexander Allen 2021-11-16 17:49:47 -05:00 committed by GitHub
parent 3025a1f8cb
commit 53891c5602
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
4 changed files with 13 additions and 5 deletions

View File

@ -5,7 +5,6 @@ DEP_FILES := $(SONIC_COMMON_FILES_LIST) $(PLATFORM_PATH)/issu-version.mk $(PLATF
DEP_FILES += $(SONIC_COMMON_BASE_FILES_LIST) DEP_FILES += $(SONIC_COMMON_BASE_FILES_LIST)
DEP_FILES += $(shell git ls-files -- $(SPATH)) DEP_FILES += $(shell git ls-files -- $(SPATH))
#$(ISSU_VERSION_FILE)_CACHE_MODE := GIT_CONTENT_SHA $(ISSU_VERSION_FILE)_CACHE_MODE := GIT_CONTENT_SHA
$(ISSU_VERSION_FILE)_CACHE_MODE := none
$(ISSU_VERSION_FILE)_DEP_FLAGS := $(SONIC_COMMON_FLAGS_LIST) $(ISSU_VERSION_FILE)_DEP_FLAGS := $(SONIC_COMMON_FLAGS_LIST)
$(ISSU_VERSION_FILE)_DEP_FILES := $(DEP_FILES) $(ISSU_VERSION_FILE)_DEP_FILES := $(DEP_FILES)

View File

@ -18,7 +18,13 @@
ISSU_VERSION_FILE = issu-version ISSU_VERSION_FILE = issu-version
$(ISSU_VERSION_FILE)_SRC_PATH = $(PLATFORM_PATH)/issu-version $(ISSU_VERSION_FILE)_SRC_PATH = $(PLATFORM_PATH)/issu-version
ifeq ($(BLDENV), buster)
$(ISSU_VERSION_FILE)_DEPENDS += $(APPLIBS) $(ISSU_VERSION_FILE)_DEPENDS += $(APPLIBS)
endif
SONIC_MAKE_FILES += $(ISSU_VERSION_FILE) SONIC_MAKE_FILES += $(ISSU_VERSION_FILE)
MLNX_FILES += $(ISSU_VERSION_FILE)
export ISSU_VERSION_FILE export ISSU_VERSION_FILE

View File

@ -19,12 +19,15 @@ SHELL = /bin/bash
.SHELLFLAGS += -e .SHELLFLAGS += -e
MAIN_TARGET = issu-version MAIN_TARGET = issu-version
BULLSEYE_FILES_PATH = /sonic/target/files/bullseye BUSTER_FILES_PATH = /sonic/target/files/buster
$(addprefix $(DEST)/, $(MAIN_TARGET)): $(DEST)/% : $(addprefix $(DEST)/, $(MAIN_TARGET)): $(DEST)/% :
ifneq (,$(findstring buster,$(DEST)))
sx_sdk --version | egrep -o 'ISSU [0-9]+' > $(DEST)/$(MAIN_TARGET) || { sx_sdk --version | egrep -o 'ISSU [0-9]+' > $(DEST)/$(MAIN_TARGET) || {
echo "ISSU version is undefined: $(sx_sdk --version)" echo "ISSU version is undefined: $(sx_sdk --version)"
rm $(DEST)/$(MAIN_TARGET) rm $(DEST)/$(MAIN_TARGET)
exit 1 exit 1
} }
cp $(DEST)/$(MAIN_TARGET) $(BULLSEYE_FILES_PATH)/$(MAIN_TARGET) else
cp $(BUSTER_FILES_PATH)/$(MAIN_TARGET) $(DEST)/$(MAIN_TARGET)
endif

View File

@ -35,7 +35,7 @@ $(addprefix $(DEST)/, $(MAIN_TARGET)): $(DEST)/% :
wget -O $(MFT_TGZ) http://www.mellanox.com/downloads/MFT/$(MFT_TGZ) wget -O $(MFT_TGZ) http://www.mellanox.com/downloads/MFT/$(MFT_TGZ)
tar xzf $(MFT_TGZ) tar xzf $(MFT_TGZ)
ifeq ($(BLDENV), bullseye) ifneq (,$(findstring bullseye,$(DEST)))
pushd $(MFT_NAME)/SDEBS pushd $(MFT_NAME)/SDEBS
# put a lock here because dpkg does not allow installing packages in parallel # put a lock here because dpkg does not allow installing packages in parallel