Skip to content

Commit

Permalink
Revert "Replace macOS 10.15 x86-64 self-hosted runner with 12 GH-host…
Browse files Browse the repository at this point in the history
…ed (#21417)" (#21623)

This reverts commit ae20980 / #21417 to
restore current-`main`/version 2.24.x to using our self-hosted macOS
10.15 runner, rather than the Github-hosted macOS 12 runner that is
being deprecated on 2024-12-03.

This ensures we'll be able to do the 2.24.0 release and patch releases
after that. This doesn't change the deprecation of macOS versions 10.15,
11 (in 2.23, #21326) and 12 (in 2.24, #21569). We'll be "unnecessarily"
building on 10.15 for 2.24 even though it's not actually supported. The
warnings/errors about the lack of support will still occur, though.

Once we branch for 2.24 and `main` switches over to 2.25, we can switch
this over to using the GitHub hosted macOS 13 runner (not 12).

See
#21333 (comment)
for more discussion.
  • Loading branch information
huonw authored Nov 8, 2024
1 parent 92ea576 commit 69043a7
Show file tree
Hide file tree
Showing 4 changed files with 58 additions and 66 deletions.
19 changes: 19 additions & 0 deletions .github/workflows/clear_self_hosted_persistent_caches.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -26,6 +26,25 @@ jobs:
run: du -sh ~/.pex || true; rm -rf ~/.pex || true
- name: df after
run: df -h
clean_macos10_15_x86_64:
runs-on:
- self-hosted
- macOS-10.15-X64
steps:
- name: df before
run: df -h
- name: Deleting ~/Library/Caches
run: du -sh ~/Library/Caches || true; rm -rf ~/Library/Caches || true
- name: Deleting ~/.cache
run: du -sh ~/.cache || true; rm -rf ~/.cache || true
- name: Deleting ~/.nce
run: du -sh ~/.nce || true; rm -rf ~/.nce || true
- name: Deleting ~/.rustup
run: du -sh ~/.rustup || true; rm -rf ~/.rustup || true
- name: Deleting ~/.pex
run: du -sh ~/.pex || true; rm -rf ~/.pex || true
- name: df after
run: df -h
clean_macos11_arm64:
runs-on:
- self-hosted
Expand Down
47 changes: 16 additions & 31 deletions .github/workflows/release.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -167,18 +167,18 @@ jobs:
\ needs.release_info.outputs.release-asset-upload-url }}?name=$(basename $WHL)\"\
\ \\\n --data-binary \"@$WHL\";\n"
timeout-minutes: 90
build_wheels_macos11_arm64:
build_wheels_macos10_15_x86_64:
env:
ACTIONS_ALLOW_USE_UNSECURE_NODE_VERSION: false
PANTS_REMOTE_CACHE_READ: 'false'
PANTS_REMOTE_CACHE_WRITE: 'false'
if: github.repository_owner == 'pantsbuild'
name: Build wheels (macOS11-ARM64)
name: Build wheels (macOS10-15-x86_64)
needs:
- release_info
runs-on:
- self-hosted
- macOS-11-ARM64
- macOS-10.15-X64
steps:
- name: Check out code
uses: actions/checkout@v4
Expand All @@ -195,7 +195,7 @@ jobs:
- name: Cache Rust toolchain
uses: actions/cache@v4
with:
key: macOS11-ARM64-rustup-${{ hashFiles('src/rust/engine/rust-toolchain')
key: macOS10-15-x86_64-rustup-${{ hashFiles('src/rust/engine/rust-toolchain')
}}-v2
path: '~/.rustup/toolchains/1.82.0-*
Expand All @@ -220,19 +220,19 @@ jobs:
with:
go-version: 1.19.5
- env:
ARCHFLAGS: -arch arm64
ARCHFLAGS: -arch x86_64
name: Build wheels
run: ./pants run src/python/pants_release/release.py -- build-wheels
- env:
ARCHFLAGS: -arch arm64
ARCHFLAGS: -arch x86_64
name: Build Pants PEX
run: ./pants package src/python/pants:pants-pex
- continue-on-error: true
if: always()
name: Upload pants.log
uses: actions/upload-artifact@v4
with:
name: logs-wheels-and-pex-macOS11-ARM64
name: logs-wheels-and-pex-macOS10-15-x86_64
overwrite: 'true'
path: .pants.d/workdir/*.log
- if: needs.release_info.outputs.is-release == 'true'
Expand All @@ -253,39 +253,24 @@ jobs:
\ needs.release_info.outputs.release-asset-upload-url }}?name=$(basename $WHL)\"\
\ \\\n --data-binary \"@$WHL\";\n"
timeout-minutes: 90
build_wheels_macos12_x86_64:
build_wheels_macos11_arm64:
env:
ACTIONS_ALLOW_USE_UNSECURE_NODE_VERSION: false
PANTS_REMOTE_CACHE_READ: 'false'
PANTS_REMOTE_CACHE_WRITE: 'false'
if: github.repository_owner == 'pantsbuild'
name: Build wheels (macOS12-x86_64)
name: Build wheels (macOS11-ARM64)
needs:
- release_info
runs-on:
- macos-12
- self-hosted
- macOS-11-ARM64
steps:
- name: Check out code
uses: actions/checkout@v4
with:
fetch-depth: 10
ref: ${{ needs.release_info.outputs.build-ref }}
- name: Set up Python 3.7, 3.8, 3.9, 3.10, 3.12, 3.13, 3.11
uses: actions/setup-python@v5
with:
python-version: '3.7
3.8
3.9
3.10
3.12
3.13
3.11'
- name: Install Protoc
uses: arduino/setup-protoc@9b1ee5b22b0a3f1feb8c2ff99b32c89b3c3191e9
with:
Expand All @@ -296,7 +281,7 @@ jobs:
- name: Cache Rust toolchain
uses: actions/cache@v4
with:
key: macOS12-x86_64-rustup-${{ hashFiles('src/rust/engine/rust-toolchain')
key: macOS11-ARM64-rustup-${{ hashFiles('src/rust/engine/rust-toolchain')
}}-v2
path: '~/.rustup/toolchains/1.82.0-*
Expand All @@ -321,19 +306,19 @@ jobs:
with:
go-version: 1.19.5
- env:
ARCHFLAGS: -arch x86_64
ARCHFLAGS: -arch arm64
name: Build wheels
run: ./pants run src/python/pants_release/release.py -- build-wheels
- env:
ARCHFLAGS: -arch x86_64
ARCHFLAGS: -arch arm64
name: Build Pants PEX
run: ./pants package src/python/pants:pants-pex
- continue-on-error: true
if: always()
name: Upload pants.log
uses: actions/upload-artifact@v4
with:
name: logs-wheels-and-pex-macOS12-x86_64
name: logs-wheels-and-pex-macOS11-ARM64
overwrite: 'true'
path: .pants.d/workdir/*.log
- if: needs.release_info.outputs.is-release == 'true'
Expand Down Expand Up @@ -362,7 +347,7 @@ jobs:
needs:
- build_wheels_linux_x86_64
- build_wheels_linux_arm64
- build_wheels_macos12_x86_64
- build_wheels_macos10_15_x86_64
- build_wheels_macos11_arm64
- release_info
runs-on: ubuntu-latest
Expand Down
47 changes: 16 additions & 31 deletions .github/workflows/test.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -445,20 +445,20 @@ jobs:
overwrite: 'true'
path: .pants.d/workdir/*.log
timeout-minutes: 90
build_wheels_macos11_arm64:
build_wheels_macos10_15_x86_64:
env:
ACTIONS_ALLOW_USE_UNSECURE_NODE_VERSION: false
MODE: debug
PANTS_REMOTE_CACHE_READ: 'false'
PANTS_REMOTE_CACHE_WRITE: 'false'
if: ((github.repository_owner == 'pantsbuild') && (needs.classify_changes.outputs.release == 'true')) && (needs.classify_changes.outputs.docs_only
!= 'true')
name: Build wheels (macOS11-ARM64)
name: Build wheels (macOS10-15-x86_64)
needs:
- classify_changes
runs-on:
- self-hosted
- macOS-11-ARM64
- macOS-10.15-X64
steps:
- name: Check out code
uses: actions/checkout@v4
Expand All @@ -474,7 +474,7 @@ jobs:
- name: Cache Rust toolchain
uses: actions/cache@v4
with:
key: macOS11-ARM64-rustup-${{ hashFiles('src/rust/engine/rust-toolchain') }}-v2
key: macOS10-15-x86_64-rustup-${{ hashFiles('src/rust/engine/rust-toolchain') }}-v2
path: '~/.rustup/toolchains/1.82.0-*
~/.rustup/update-hashes
Expand All @@ -498,56 +498,41 @@ jobs:
with:
go-version: 1.19.5
- env:
ARCHFLAGS: -arch arm64
ARCHFLAGS: -arch x86_64
name: Build wheels
run: ./pants run src/python/pants_release/release.py -- build-wheels
- env:
ARCHFLAGS: -arch arm64
ARCHFLAGS: -arch x86_64
name: Build Pants PEX
run: ./pants package src/python/pants:pants-pex
- continue-on-error: true
if: always()
name: Upload pants.log
uses: actions/upload-artifact@v4
with:
name: logs-wheels-and-pex-macOS11-ARM64
name: logs-wheels-and-pex-macOS10-15-x86_64
overwrite: 'true'
path: .pants.d/workdir/*.log
timeout-minutes: 90
build_wheels_macos12_x86_64:
build_wheels_macos11_arm64:
env:
ACTIONS_ALLOW_USE_UNSECURE_NODE_VERSION: false
MODE: debug
PANTS_REMOTE_CACHE_READ: 'false'
PANTS_REMOTE_CACHE_WRITE: 'false'
if: ((github.repository_owner == 'pantsbuild') && (needs.classify_changes.outputs.release == 'true')) && (needs.classify_changes.outputs.docs_only
!= 'true')
name: Build wheels (macOS12-x86_64)
name: Build wheels (macOS11-ARM64)
needs:
- classify_changes
runs-on:
- macos-12
- self-hosted
- macOS-11-ARM64
steps:
- name: Check out code
uses: actions/checkout@v4
with:
fetch-depth: 10
- name: Set up Python 3.7, 3.8, 3.9, 3.10, 3.12, 3.13, 3.11
uses: actions/setup-python@v5
with:
python-version: '3.7
3.8
3.9
3.10
3.12
3.13
3.11'
- name: Install Protoc
uses: arduino/setup-protoc@9b1ee5b22b0a3f1feb8c2ff99b32c89b3c3191e9
with:
Expand All @@ -558,7 +543,7 @@ jobs:
- name: Cache Rust toolchain
uses: actions/cache@v4
with:
key: macOS12-x86_64-rustup-${{ hashFiles('src/rust/engine/rust-toolchain') }}-v2
key: macOS11-ARM64-rustup-${{ hashFiles('src/rust/engine/rust-toolchain') }}-v2
path: '~/.rustup/toolchains/1.82.0-*
~/.rustup/update-hashes
Expand All @@ -582,19 +567,19 @@ jobs:
with:
go-version: 1.19.5
- env:
ARCHFLAGS: -arch x86_64
ARCHFLAGS: -arch arm64
name: Build wheels
run: ./pants run src/python/pants_release/release.py -- build-wheels
- env:
ARCHFLAGS: -arch x86_64
ARCHFLAGS: -arch arm64
name: Build Pants PEX
run: ./pants package src/python/pants:pants-pex
- continue-on-error: true
if: always()
name: Upload pants.log
uses: actions/upload-artifact@v4
with:
name: logs-wheels-and-pex-macOS12-x86_64
name: logs-wheels-and-pex-macOS11-ARM64
overwrite: 'true'
path: .pants.d/workdir/*.log
timeout-minutes: 90
Expand Down Expand Up @@ -734,8 +719,8 @@ jobs:
- bootstrap_pants_macos12_x86_64
- build_wheels_linux_arm64
- build_wheels_linux_x86_64
- build_wheels_macos10_15_x86_64
- build_wheels_macos11_arm64
- build_wheels_macos12_x86_64
- check_release_notes
- classify_changes
- lint_python
Expand Down
11 changes: 7 additions & 4 deletions src/python/pants_release/generate_github_workflows.py
Original file line number Diff line number Diff line change
Expand Up @@ -73,15 +73,16 @@ def action(name: str, node16_compat: bool = False) -> str:
class Platform(Enum):
LINUX_X86_64 = "Linux-x86_64"
LINUX_ARM64 = "Linux-ARM64"
MACOS10_15_X86_64 = "macOS10-15-x86_64"
# the oldest version of macOS supported by GitHub self-hosted runners
MACOS12_X86_64 = "macOS12-x86_64"
MACOS11_ARM64 = "macOS11-ARM64"


GITHUB_HOSTED = {Platform.LINUX_X86_64, Platform.MACOS12_X86_64}
SELF_HOSTED = {Platform.LINUX_ARM64, Platform.MACOS11_ARM64}
SELF_HOSTED = {Platform.LINUX_ARM64, Platform.MACOS10_15_X86_64, Platform.MACOS11_ARM64}
# We control these runners, so we preinstall and expose python on them.
HAS_PYTHON = {Platform.LINUX_ARM64, Platform.MACOS11_ARM64}
HAS_PYTHON = {Platform.LINUX_ARM64, Platform.MACOS10_15_X86_64, Platform.MACOS11_ARM64}
CARGO_AUDIT_IGNORED_ADVISORY_IDS = (
"RUSTSEC-2020-0128", # returns a false positive on the cache crate, which is a local crate not a 3rd party crate
)
Expand Down Expand Up @@ -424,6 +425,8 @@ def runs_on(self) -> list[str]:
ret += ["macos-12"]
elif self.platform == Platform.MACOS11_ARM64:
ret += ["macOS-11-ARM64"]
elif self.platform == Platform.MACOS10_15_X86_64:
ret += ["macOS-10.15-X64"]
elif self.platform == Platform.LINUX_X86_64:
ret += ["ubuntu-22.04"]
elif self.platform == Platform.LINUX_ARM64:
Expand All @@ -439,7 +442,7 @@ def runs_on(self) -> list[str]:

def platform_env(self):
ret = {}
if self.platform in {Platform.MACOS12_X86_64}:
if self.platform in {Platform.MACOS10_15_X86_64, Platform.MACOS12_X86_64}:
# Works around bad `-arch arm64` flag embedded in Xcode 12.x Python interpreters on
# intel machines. See: https://github.com/giampaolo/psutil/issues/1832
ret["ARCHFLAGS"] = "-arch x86_64"
Expand Down Expand Up @@ -972,7 +975,7 @@ def build_wheels_jobs(*, for_deploy_ref: str | None = None, needs: list[str] | N
return {
**build_wheels_job(Platform.LINUX_X86_64, for_deploy_ref, needs),
**build_wheels_job(Platform.LINUX_ARM64, for_deploy_ref, needs),
**build_wheels_job(Platform.MACOS12_X86_64, for_deploy_ref, needs),
**build_wheels_job(Platform.MACOS10_15_X86_64, for_deploy_ref, needs),
**build_wheels_job(Platform.MACOS11_ARM64, for_deploy_ref, needs),
}

Expand Down

0 comments on commit 69043a7

Please sign in to comment.