Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Test on newer macOS 13, not deprecated macOS 12 (partial cherry-pick of #21655) #21663

Merged
merged 2 commits into from
Nov 21, 2024
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
32 changes: 16 additions & 16 deletions .github/workflows/test.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -216,16 +216,16 @@ jobs:

./cargo doc'
timeout-minutes: 60
bootstrap_pants_macos12_x86_64:
bootstrap_pants_macos13_x86_64:
env:
PANTS_REMOTE_CACHE_READ: 'false'
PANTS_REMOTE_CACHE_WRITE: 'false'
if: (github.repository_owner == 'pantsbuild') && (needs.classify_changes.outputs.docs_only != 'true')
name: Bootstrap Pants, test Rust (macOS12-x86_64)
name: Bootstrap Pants, test Rust (macOS13-x86_64)
needs:
- classify_changes
runs-on:
- macos-12
- macos-13
steps:
- name: Check out code
uses: actions/checkout@v4
Expand Down Expand Up @@ -255,7 +255,7 @@ jobs:
- name: Cache Rust toolchain
uses: actions/cache@v4
with:
key: macOS12-x86_64-rustup-${{ hashFiles('src/rust/engine/rust-toolchain') }}-v2
key: macOS13-x86_64-rustup-${{ hashFiles('src/rust/engine/rust-toolchain') }}-v2
path: '~/.rustup/toolchains/1.81.0-*

~/.rustup/update-hashes
Expand All @@ -276,7 +276,7 @@ jobs:
- name: Cache native engine
uses: actions/cache@v4
with:
key: macOS12-x86_64-engine-${{ steps.get-engine-hash.outputs.hash }}-v1
key: macOS13-x86_64-engine-${{ steps.get-engine-hash.outputs.hash }}-v1
path: 'src/python/pants/bin/native_client

src/python/pants/engine/internals/native_engine.so
Expand All @@ -301,13 +301,13 @@ jobs:
name: Upload pants.log
uses: actions/upload-artifact@v4
with:
name: logs-bootstrap-macOS12-x86_64
name: logs-bootstrap-macOS13-x86_64
overwrite: 'true'
path: .pants.d/workdir/*.log
- name: Upload native binaries
uses: actions/upload-artifact@v4
with:
name: native_binaries.${{ matrix.python-version }}.macOS12-x86_64
name: native_binaries.${{ matrix.python-version }}.macOS13-x86_64
path: 'src/python/pants/bin/native_client

src/python/pants/engine/internals/native_engine.so
Expand Down Expand Up @@ -743,7 +743,7 @@ jobs:
- check_release_notes
- bootstrap_pants_linux_arm64
- bootstrap_pants_linux_x86_64
- bootstrap_pants_macos12_x86_64
- bootstrap_pants_macos13_x86_64
- build_wheels_linux_arm64
- build_wheels_linux_x86_64
- build_wheels_macos10_15_x86_64
Expand All @@ -763,7 +763,7 @@ jobs:
- test_python_linux_x86_64_7
- test_python_linux_x86_64_8
- test_python_linux_x86_64_9
- test_python_macos12_x86_64
- test_python_macos13_x86_64
outputs:
merge_ok: ${{ steps.set_merge_ok.outputs.merge_ok }}
runs-on:
Expand Down Expand Up @@ -1827,16 +1827,16 @@ jobs:
overwrite: 'true'
path: .pants.d/workdir/*.log
timeout-minutes: 90
test_python_macos12_x86_64:
test_python_macos13_x86_64:
env:
ARCHFLAGS: -arch x86_64
if: (github.repository_owner == 'pantsbuild') && (needs.classify_changes.outputs.docs_only != 'true')
name: Test Python (macOS12-x86_64)
name: Test Python (macOS13-x86_64)
needs:
- bootstrap_pants_macos12_x86_64
- bootstrap_pants_macos13_x86_64
- classify_changes
runs-on:
- macos-12
- macos-13
steps:
- name: Check out code
uses: actions/checkout@v4
Expand Down Expand Up @@ -1864,7 +1864,7 @@ jobs:
- name: Download native binaries
uses: actions/download-artifact@v4
with:
name: native_binaries.${{ matrix.python-version }}.macOS12-x86_64
name: native_binaries.${{ matrix.python-version }}.macOS13-x86_64
path: src/python/pants
- name: Make native-client runnable
run: chmod +x src/python/pants/bin/native_client
Expand All @@ -1878,7 +1878,7 @@ jobs:
AWS_SECRET_ACCESS_KEY: ${{ secrets.AWS_SECRET_ACCESS_KEY }}
if: always()
name: Upload test reports
run: 'export S3_DST=s3://logs.pantsbuild.org/test/reports/macOS12-x86_64/$(git show --no-patch --format=%cd --date=format:%Y-%m-%d)/${GITHUB_REF_NAME//\//_}/${GITHUB_RUN_ID}/${GITHUB_RUN_ATTEMPT}/${GITHUB_JOB}
run: 'export S3_DST=s3://logs.pantsbuild.org/test/reports/macOS13-x86_64/$(git show --no-patch --format=%cd --date=format:%Y-%m-%d)/${GITHUB_REF_NAME//\//_}/${GITHUB_RUN_ID}/${GITHUB_RUN_ATTEMPT}/${GITHUB_JOB}

echo "Uploading test reports to ${S3_DST}"

Expand All @@ -1890,7 +1890,7 @@ jobs:
name: Upload pants.log
uses: actions/upload-artifact@v4
with:
name: logs-python-test-macOS12-x86_64
name: logs-python-test-macOS13-x86_64
overwrite: 'true'
path: .pants.d/workdir/*.log
timeout-minutes: 90
Expand Down
1 change: 1 addition & 0 deletions src/python/pants/base/exception_sink_test.py
Original file line number Diff line number Diff line change
Expand Up @@ -55,6 +55,7 @@ def test_set_invalid_log_location():
Platform.macos_x86_64: (
"The provided log location path at '/' is not writable or could not be created: "
"[Errno 21] Is a directory: '/'.",
"Error opening fatal error log streams for log location '/': [Errno 30] Read-only file system",
),
Platform.linux_arm64: (
"Error opening fatal error log streams for log location '/': [Errno 13] Permission "
Expand Down
24 changes: 13 additions & 11 deletions src/python/pants_release/generate_github_workflows.py
Original file line number Diff line number Diff line change
Expand Up @@ -63,12 +63,12 @@ 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"
MACOS13_X86_64 = "macOS13-x86_64"
MACOS14_ARM64 = "macOS14-ARM64"


GITHUB_HOSTED = {Platform.LINUX_X86_64, Platform.MACOS12_X86_64}
GITHUB_HOSTED = {Platform.LINUX_X86_64, Platform.MACOS13_X86_64, Platform.MACOS14_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.MACOS10_15_X86_64, Platform.MACOS11_ARM64}
Expand Down Expand Up @@ -433,12 +433,14 @@ def runs_on(self) -> list[str]:
# any platform-specific labels, so we don't run on future GH-hosted
# platforms without realizing it.
ret = ["self-hosted"] if self.platform in SELF_HOSTED else []
if self.platform == Platform.MACOS12_X86_64:
ret += ["macos-12"]
elif self.platform == Platform.MACOS11_ARM64:
if 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.MACOS13_X86_64:
ret += ["macos-13"]
elif self.platform == Platform.MACOS14_ARM64:
ret += ["macos-14"]
elif self.platform == Platform.LINUX_X86_64:
ret += ["ubuntu-20.04"]
elif self.platform == Platform.LINUX_ARM64:
Expand All @@ -454,11 +456,11 @@ def runs_on(self) -> list[str]:

def platform_env(self):
ret = {}
if self.platform in {Platform.MACOS10_15_X86_64, Platform.MACOS12_X86_64}:
if self.platform in {Platform.MACOS10_15_X86_64, Platform.MACOS13_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"
if self.platform == Platform.MACOS11_ARM64:
if self.platform in {Platform.MACOS11_ARM64, Platform.MACOS14_ARM64}:
ret["ARCHFLAGS"] = "-arch arm64"
if self.platform == Platform.LINUX_X86_64:
# Currently we run Linux x86_64 CI on GitHub Actions-hosted hardware, and
Expand Down Expand Up @@ -816,8 +818,8 @@ def linux_arm64_test_jobs() -> Jobs:
return jobs


def macos12_x86_64_test_jobs() -> Jobs:
helper = Helper(Platform.MACOS12_X86_64)
def macos13_x86_64_test_jobs() -> Jobs:
helper = Helper(Platform.MACOS13_X86_64)
jobs = {
helper.job_name("bootstrap_pants"): bootstrap_jobs(
helper,
Expand Down Expand Up @@ -1011,7 +1013,7 @@ def test_workflow_jobs() -> Jobs:
}
jobs.update(**linux_x86_64_test_jobs())
jobs.update(**linux_arm64_test_jobs())
jobs.update(**macos12_x86_64_test_jobs())
jobs.update(**macos13_x86_64_test_jobs())
jobs.update(**build_wheels_jobs())
jobs.update(
{
Expand Down
Loading