Skip to content

Commit bc6baf3

Browse files
committed
Fix the platform version
1 parent b47eb88 commit bc6baf3

File tree

2 files changed

+6
-5
lines changed

2 files changed

+6
-5
lines changed

.ci/scripts/utils.sh

Lines changed: 5 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -63,13 +63,14 @@ install_pytorch_and_domains() {
6363
git submodule update --init --recursive
6464

6565
SYSTEM_NAME=$(uname)
66-
# The platform version needs to match MACOSX_DEPLOYMENT_TARGET used to build the wheel
67-
PLATFORM=$(python -c 'import sysconfig; platform=sysconfig.get_platform().split("-"); platform[1]="14_0"; print("_".join(platform))')
66+
if [[ "${SYSTEM_NAME}" == "Darwin" ]]; then
67+
PLATFORM=$(python -c 'import sysconfig; import platform; v=platform.mac_ver()[0].split(".")[0]; platform=sysconfig.get_platform().split("-"); platform[1]=f"{v}_0"; print("_".join(platform))')
68+
fi
6869
PYTHON_VERSION=$(python -c 'import platform; v=platform.python_version_tuple(); print(f"{v[0]}{v[1]}")')
6970
TORCH_RELEASE=$(cat version.txt)
7071
TORCH_SHORT_HASH=${TORCH_VERSION:0:7}
7172
TORCH_WHEEL_PATH="cached_artifacts/pytorch/executorch/pytorch_wheels/${SYSTEM_NAME}/${PYTHON_VERSION}"
72-
TORCH_WHEEL_NAME="torch-${TORCH_RELEASE}%2Bgit${TORCH_SHORT_HASH}-cp${PYTHON_VERSION}-cp${PYTHON_VERSION}-${PLATFORM}.whl"
73+
TORCH_WHEEL_NAME="torch-${TORCH_RELEASE}%2Bgit${TORCH_SHORT_HASH}-cp${PYTHON_VERSION}-cp${PYTHON_VERSION}-${PLATFORM:-}.whl"
7374

7475
CACHE_TORCH_WHEEL="https://gha-artifacts.s3.us-east-1.amazonaws.com/${TORCH_WHEEL_PATH}/${TORCH_WHEEL_NAME}"
7576
# Cache PyTorch wheel is only needed on MacOS, Linux CI already has this as part
@@ -80,7 +81,7 @@ install_pytorch_and_domains() {
8081

8182
# Found no such wheel, we will build it from source then
8283
if [[ "${TORCH_WHEEL_NOT_FOUND:-0}" == "1" ]]; then
83-
USE_DISTRIBUTED=1 MACOSX_DEPLOYMENT_TARGET=14.0 python setup.py bdist_wheel
84+
USE_DISTRIBUTED=1 python setup.py bdist_wheel
8485
pip install "$(echo dist/*.whl)"
8586

8687
# Only AWS runners have access to S3

.github/workflows/trunk.yml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -228,7 +228,7 @@ jobs:
228228
name: test-coreml-delegate
229229
uses: pytorch/test-infra/.github/workflows/macos_job.yml@main
230230
with:
231-
runner: macos-13-xlarge
231+
runner: macos-latest-xlarge
232232
python-version: '3.11'
233233
submodules: 'true'
234234
ref: ${{ github.event_name == 'pull_request' && github.event.pull_request.head.sha || github.sha }}

0 commit comments

Comments
 (0)