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

Add macos workaround to build wheel step on macos. #11864

Merged
merged 2 commits into from
Apr 8, 2021
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
4 changes: 3 additions & 1 deletion .github/workflows/test.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -340,7 +340,9 @@ jobs:
restore-keys: '${{ runner.os }}-cargo-${{ hashFiles(''rust-toolchain'') }}-

'
- if: github.event_name == 'push' || !contains(env.COMMIT_MESSAGE, '[ci skip-build-wheels]')
- env:
ARCHFLAGS: -arch x86_64
if: github.event_name == 'push' || !contains(env.COMMIT_MESSAGE, '[ci skip-build-wheels]')
name: Build wheels and fs_util
run: '[[ "${GITHUB_EVENT_NAME}" == "pull_request" ]] && export MODE=debug

Expand Down
40 changes: 24 additions & 16 deletions build-support/bin/generate_github_workflows.py
Original file line number Diff line number Diff line change
Expand Up @@ -235,6 +235,28 @@ def expose_all_pythons() -> Sequence[Step]:
]


def get_build_wheels_step(is_macos: bool) -> Step:
step = {
"name": "Build wheels and fs_util",
"run": dedent(
# We use MODE=debug on PR builds to speed things up, given that those are only
# smoke tests of our release process.
"""\
[[ "${GITHUB_EVENT_NAME}" == "pull_request" ]] && export MODE=debug
./build-support/bin/release.sh -n
USE_PY38=true ./build-support/bin/release.sh -n
./build-support/bin/release.sh -f
"""
),
"if": DONT_SKIP_WHEELS,
}
if is_macos:
# Works around bad `-arch arm64` flag embedded in Xcode 12.x Python interpreters on
# intel machines. See: https://github.com/giampaolo/psutil/issues/1832
step["env"] = {"ARCHFLAGS": "-arch x86_64"} # type: ignore[assignment]
return step


def test_workflow_jobs(primary_python_version: str, *, cron: bool) -> Jobs:
jobs = {
"bootstrap_pants_linux": {
Expand Down Expand Up @@ -354,20 +376,6 @@ def test_workflow_jobs(primary_python_version: str, *, cron: bool) -> Jobs:
},
}
if not cron:
build_wheels_step = {
"name": "Build wheels and fs_util",
"run": dedent(
# We use MODE=debug on PR builds to speed things up, given that those are only
# smoke tests of our release process.
"""\
[[ "${GITHUB_EVENT_NAME}" == "pull_request" ]] && export MODE=debug
./build-support/bin/release.sh -n
USE_PY38=true ./build-support/bin/release.sh -n
./build-support/bin/release.sh -f
"""
),
"if": DONT_SKIP_WHEELS,
}
deploy_to_s3_step = {
"name": "Deploy to S3",
"run": "./build-support/bin/deploy_to_s3.py",
Expand All @@ -393,7 +401,7 @@ def test_workflow_jobs(primary_python_version: str, *, cron: bool) -> Jobs:
'/opt/python/cp38-cp38/bin" >> $GITHUB_ENV'
),
},
build_wheels_step,
get_build_wheels_step(is_macos=False),
deploy_to_s3_step,
],
},
Expand All @@ -408,7 +416,7 @@ def test_workflow_jobs(primary_python_version: str, *, cron: bool) -> Jobs:
# multiple Python versions, whereas that caching assumes only one primary
# Python version (marked via matrix.strategy).
*rust_caches(),
build_wheels_step,
get_build_wheels_step(is_macos=True),
deploy_to_s3_step,
],
},
Expand Down