Skip to content

Commit

Permalink
Work around Xcode 12.x Python interpreter.
Browse files Browse the repository at this point in the history
The interpreter has a bad `-arch arm64` flag on intel that leads to
compile errors for psutil.

See: giampaolo/psutil#1832

[ci skip-rust]
[ci skip-build-wheels]
  • Loading branch information
jsirois committed Mar 19, 2021
1 parent 76362c8 commit 6e7cfa8
Show file tree
Hide file tree
Showing 4 changed files with 15 additions and 1 deletion.
1 change: 1 addition & 0 deletions .github/workflows/test-cron.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -363,6 +363,7 @@ jobs:
- 3.8.3
test_python_macos:
env:
ARCHFLAGS: -arch x86_64
PANTS_CONFIG_FILES: +['pants.ci.toml', 'pants.remote-cache.toml']
name: Test Python (MacOS)
needs: bootstrap_pants_macos
Expand Down
1 change: 1 addition & 0 deletions .github/workflows/test.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -363,6 +363,7 @@ jobs:
- 3.7.10
test_python_macos:
env:
ARCHFLAGS: -arch x86_64
PANTS_CONFIG_FILES: +['pants.ci.toml', 'pants.remote-cache.toml']
name: Test Python (MacOS)
needs: bootstrap_pants_macos
Expand Down
7 changes: 6 additions & 1 deletion build-support/bin/generate_github_workflows.py
Original file line number Diff line number Diff line change
Expand Up @@ -239,7 +239,12 @@ def test_workflow_jobs(python_versions: Sequence[str]) -> Jobs:
"runs-on": "macos-10.15",
"needs": "bootstrap_pants_macos",
"strategy": {"matrix": {"python-version": python_versions}},
"env": {**pants_config_files()},
"env": {
# Works around bad `-arch arm64` flag embedded in Xcode 12.x Python interpreters on
# intel machines. See: https://github.com/giampaolo/psutil/issues/1832
"ARCHFLAGS": "-arch x86_64",
**pants_config_files(),
},
"steps": [
{"name": "Check out code", "uses": "actions/checkout@v2"},
*setup_primary_python(),
Expand Down
7 changes: 7 additions & 0 deletions pants.ci.toml
Original file line number Diff line number Diff line change
Expand Up @@ -26,3 +26,10 @@ ci_env_variables = [

[buildsense]
enable = true

[subprocess-environment]
env_vars.add = [
# Works around bad `-arch arm64` flag embedded in Xcode 12.x Python interpreters on intel
# machines. See: https://github.com/giampaolo/psutil/issues/1832
"ARCHFLAGS",
]

0 comments on commit 6e7cfa8

Please sign in to comment.