From 8c454a76e0040f479218b7c2213838d40118a6f1 Mon Sep 17 00:00:00 2001 From: Yi Zhang Date: Fri, 3 Mar 2023 18:27:54 +0800 Subject: [PATCH] Check Mac silicon package name (#14898) ### Description 1. add comments 2. check Mac silicon package name ### Motivation and Context There isn't Mac silicon Agent in ADO. We couldn't add smoking test to test the wheel can be installed. But We can check whether the package name is correct to avoid the mistake in 1.14 release. Test run https://dev.azure.com/aiinfra/Lotus/_build/results?buildId=283100&view=logs&j=fe710151-df7c-5aa4-0cea-cf5331faa499&t=3182cefe-2612-53c6-4445-e5b3e0c4ac57 --- .../azure-pipelines/templates/py-packaging-stage.yml | 11 ++++++++++- 1 file changed, 10 insertions(+), 1 deletion(-) diff --git a/tools/ci_build/github/azure-pipelines/templates/py-packaging-stage.yml b/tools/ci_build/github/azure-pipelines/templates/py-packaging-stage.yml index bd5afa9065..935235e663 100644 --- a/tools/ci_build/github/azure-pipelines/templates/py-packaging-stage.yml +++ b/tools/ci_build/github/azure-pipelines/templates/py-packaging-stage.yml @@ -397,6 +397,9 @@ stages: system_profiler SPSoftwareDataType SPHardwareDataType displayName: 'Mac machine info' + # Don't remove _PYTHON_HOST_PLATFORM, it's used to generate correct package name + # Setting _PYTHON_HOST_PLATFORM overwrites the value return by get_platform() + # Ref: https://wiki.debian.org/Python/MultiArch - script: | set -e -x pushd . @@ -415,8 +418,14 @@ stages: displayName: 'Command Line Script' - script: | + set -ex python -m pip install --upgrade delocate cd '$(Build.BinariesDirectory)/Release/dist' + ls + for file in *.whl + do + [[ "$file" == *arm64* ]] || ( echo "Mac Silicon package name is NOT correct" && exit 1) + done for file in *.whl do delocate-listdeps "$file" @@ -487,4 +496,4 @@ stages: arch: 'x86_64' machine_pool: 'Linux-CPU' ${{ if contains(parameters.build_py_parameters, '--use_azure') }}: - device: '-d AZURE' \ No newline at end of file + device: '-d AZURE'