Skip to content

Full git fetch on tag pushes so macOS release wheel builds detect the tag - #187172

Merged
atalman merged 1 commit into
release/2.13from
cherry-pick-187139-by-pytorch_bot_bot_
Jun 12, 2026
Merged

atalman merged 1 commit into
release/2.13from
cherry-pick-187139-by-pytorch_bot_bot_

Conversation

@pytorchbot

Copy link
Copy Markdown
Collaborator

Problem

Same issue as #187058, but for the macOS arm64 binary wheel build. The wheel-build job checks out a pinned commit SHA with the default shallow actions/checkout (depth 1, no tags). On a release tag push (e.g. v2.13.0-rc1) the tag ref is never written into that checkout, so tagged_version() in .ci/pytorch/binary_populate_env.sh (git describe --tags --exact, invoked per-iteration by .ci/wheel/build_all_macos_wheels.sh) fails. The build then falls through to the <version>.dev<DATE> default, producing wheels versioned 2.13.0.devYYYYMMDD instead of the release version.

Fix

Do a full fetch (fetch-depth: 0) on tag pushes and keep the shallow checkout for nightlies:

fetch-depth: ${{ github.ref_type != 'tag' && 1 || 0 }}
fetch-tags: ${{ github.ref_type == 'tag' }}

The condition is negated (matching #187058) because GitHub Actions has no ternary and the A && B || C idiom only works when B is truthy; the naive github.ref_type == 'tag' && 0 || 2 always yields the shallow value because 0 is falsy.

Only the wheel-build checkout is changed; the libtorch *-extract job uses a sparse checkout of the already-built wheel artifact and does not need the tag.

Needs to be cherry-picked onto release/2.13 for the RC builds to pick it up.

Test Plan

Regenerated the workflows from the template and confirmed only the macOS wheel workflow changed, with the conditional fetch on the build job's checkout:

python3 .github/scripts/generate_ci_workflows.py
git diff --stat .github/workflows

Validated the regenerated YAML parses and passes actionlint (the only reported shellcheck warning, SC2086 on uv python install $DESIRED_PYTHONS, is pre-existing and unrelated):

python3 -c "import yaml; yaml.safe_load(open('.github/workflows/generated-macos-arm64-binary-wheel-nightly.yml'))"
lintrunner --take ACTIONLINT .github/workflows/generated-macos-arm64-binary-wheel-nightly.yml

This PR was authored with the assistance of an AI coding agent.

… tag (#187139)

## Problem

Same issue as #187058, but for the **macOS arm64 binary wheel** build. The `wheel-build` job checks out a pinned commit SHA with the default shallow `actions/checkout` (depth 1, no tags). On a release tag push (e.g. `v2.13.0-rc1`) the tag ref is never written into that checkout, so `tagged_version()` in `.ci/pytorch/binary_populate_env.sh` (`git describe --tags --exact`, invoked per-iteration by `.ci/wheel/build_all_macos_wheels.sh`) fails. The build then falls through to the `<version>.dev<DATE>` default, producing wheels versioned `2.13.0.devYYYYMMDD` instead of the release version.

## Fix

Do a full fetch (`fetch-depth: 0`) on tag pushes and keep the shallow checkout for nightlies:

```yaml
fetch-depth: ${{ github.ref_type != 'tag' && 1 || 0 }}
fetch-tags: ${{ github.ref_type == 'tag' }}
```

The condition is negated (matching #187058) because GitHub Actions has no ternary and the `A && B || C` idiom only works when `B` is truthy; the naive `github.ref_type == 'tag' && 0 || 2` always yields the shallow value because `0` is falsy.

Only the `wheel-build` checkout is changed; the libtorch `*-extract` job uses a sparse checkout of the already-built wheel artifact and does not need the tag.

> Needs to be cherry-picked onto `release/2.13` for the RC builds to pick it up.

## Test Plan

Regenerated the workflows from the template and confirmed only the macOS wheel workflow changed, with the conditional fetch on the build job's checkout:

```
python3 .github/scripts/generate_ci_workflows.py
git diff --stat .github/workflows
```

Validated the regenerated YAML parses and passes actionlint (the only reported shellcheck warning, `SC2086` on `uv python install $DESIRED_PYTHONS`, is pre-existing and unrelated):

```
python3 -c "import yaml; yaml.safe_load(open('.github/workflows/generated-macos-arm64-binary-wheel-nightly.yml'))"
lintrunner --take ACTIONLINT .github/workflows/generated-macos-arm64-binary-wheel-nightly.yml
```

*This PR was authored with the assistance of an AI coding agent.*
Pull Request resolved: #187139
Approved by: https://github.com/malfet

(cherry picked from commit fb17c34)
@pytorch-bot

pytorch-bot Bot commented Jun 12, 2026

Copy link
Copy Markdown

🔗 Helpful Links

🧪 See artifacts and rendered test results at hud.pytorch.org/pr/187172

Note: Links to docs will display an error until the docs builds have been completed.

This comment was automatically generated by Dr. CI and updates every 15 minutes.

@atalman
atalman merged commit a3aa2c6 into release/2.13 Jun 12, 2026
93 of 128 checks passed
@github-actions
github-actions Bot deleted the cherry-pick-187139-by-pytorch_bot_bot_ branch July 13, 2026 02:26
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants