Skip to content

macOS arm64 CI runner is running an i386 shell by default & ARCHFLAGS isn't working #20790

Open
@huonw

Description

@huonw

Describe the bug

In #20765, we discovered that the old psutil==5.9.0 dependency was being built to a wheel incorrectly on Apple Silicon: the native code was ending up as x86-64, rather than arm64. There's two layers to this bug:

  1. the CI steps attempt to set ARCHFLAGS='-arch arm64' but these seemed to stop working in release_2.17.0.dev5...release_2.17.0a0 (see ImportError: ... incompatible architecture on arm64 macOS for Pants 2.19.2, 2.20.0rc3, 2.21.0.dev5  #20765 (comment) for analysis)
  2. the runner is defaulting to i386/x86-64 shell (etc.) by default, rather than arm64 (a freshly installed self-hosted runner on my M1 laptop runs in arm64 shells by default: see ImportError: ... incompatible architecture on arm64 macOS for Pants 2.19.2, 2.20.0rc3, 2.21.0.dev5  #20765 (comment) for analysis)

Fixing 2 is arguably the better fix, as then the runner will be doing the right thing by default. If we fix this via 1, we need to make sure all uses of this runner apply the flags when they build things (this includes in scie-pants).

This can be confirmed by running commands like:

  • arch => outputs i386, should output arm64
  • echo 'int main() { return 0; }' > test.c && clang test.c -o test && file test (compile some C code) => outputs test: Mach-O 64-bit executable x86_64, should output ... arm64

Pants version
2.17.0a0

OS

arm64 macOS in Ci

Additional info

N/A

Activity

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

No one assigned

    Labels

    bugcategory:internalCI, fixes for not-yet-released features, etc.

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions