Skip to content

[macOS/ARM64] Add pip req arm64 - #5500

Merged
ViniciustCosta merged 1 commit into
masterfrom
add_pip_req_arm64
Sep 29, 2026
Merged

ViniciustCosta merged 1 commit into
masterfrom
add_pip_req_arm64

Conversation

@JuanMBriones

Copy link
Copy Markdown
Contributor

Same changes as #5468. Faced a bug while using gh stack github/gh-stack#385. The past PR is claimed to be "merged" but it isn't.


When packaging bot deployment bundles on a Linux host via butler package,
_install_pip() installs all packages from Pipfile.lock (including
transitive dependencies with Linux x86_64 ELF shared objects) into
src/third_party. _install_platform_pip() then downloads pre-compiled
binary wheels for each package listed in src/platform_requirements.txt
to replace the Linux binaries with target platform native binaries.

Previously, markupsafe and pynacl were transitive dependencies containing
compiled C/CFFI extensions that were missing from
src/platform_requirements.txt:

markupsafe==3.0.3 (transitive dependency of Jinja2==3.1.4 / Flask):
contains the compiled C extension markupsafe/_speedups.cpython-*.so.
Without it in platform_requirements.txt, the Linux ELF .so remained in
the macOS ARM64 bundle.
pynacl==1.6.0 (transitive dependency of pygithub==1.55): contains the
compiled libsodium CFFI native binary nacl/_sodium.abi3.so. Without it in
platform_requirements.txt, importing github / nacl on macOS ARM64 fails
with ImportError: dlopen(.../nacl/_sodium.abi3.so): not a mach-o file.
Adding both packages ensures butler package -p macos_arm64 downloads the
native macOS ARM64/universal2 wheels (markupsafe-3.0.3-cp311-cp311-macosx_11_0_arm64.whl
and pynacl-1.6.0-cp38-abi3-macosx_10_10_universal2.whl) into src/third_party.

Bug: 555853673

@JuanMBriones
JuanMBriones requested a review from a team as a code owner September 25, 2026 23:01
When packaging bot deployment bundles on a Linux host via `butler package`,
`_install_pip()` installs all packages from `Pipfile.lock` (including
transitive dependencies with Linux x86_64 ELF shared objects) into
`src/third_party`. `_install_platform_pip()` then downloads pre-compiled
binary wheels for each package listed in `src/platform_requirements.txt`
to replace the Linux binaries with target platform native binaries.

Previously, `markupsafe` and `pynacl` were transitive dependencies containing
compiled C/CFFI extensions that were missing from
`src/platform_requirements.txt`:

* `markupsafe==3.0.3` (transitive dependency of `Jinja2==3.1.4` / `Flask`):
  contains the compiled C extension `markupsafe/_speedups.cpython-*.so`.
  Without it in `platform_requirements.txt`, the Linux ELF `.so` remained in
  the macOS ARM64 bundle.
* `pynacl==1.6.0` (transitive dependency of `pygithub==1.55`): contains the
  compiled libsodium CFFI native binary `nacl/_sodium.abi3.so`. Without it in
  `platform_requirements.txt`, importing `github` / `nacl` on macOS ARM64 fails
  with `ImportError: dlopen(.../nacl/_sodium.abi3.so): not a mach-o file`.

Adding both packages ensures `butler package -p macos_arm64` downloads the
native macOS ARM64/universal2 wheels (`markupsafe-3.0.3-cp311-cp311-macosx_11_0_arm64.whl`
and `pynacl-1.6.0-cp38-abi3-macosx_10_10_universal2.whl`) into `src/third_party`.

Bug: 555853673
Signed-off-by: Manuel Briones <manuelbriones@google.com>
@JuanMBriones JuanMBriones changed the title Add pip req arm64 [macOS/ARM64] Add pip req arm64 Sep 27, 2026
@g-ortuno

Copy link
Copy Markdown
Collaborator

Adding this to the GOSST Review queue.

@g-ortuno g-ortuno added the ready for GOSST review Pull requests ready for GOSST team review label Sep 28, 2026
@g-ortuno
g-ortuno requested review from a team and removed request for a team September 28, 2026 15:03
@ViniciustCosta

Copy link
Copy Markdown
Collaborator

Build-Base-Images-PR seems to be broken again, so I'll merge to unblock you.

@ViniciustCosta
ViniciustCosta merged commit 5db4648 into master Sep 29, 2026
14 of 15 checks passed
@ViniciustCosta
ViniciustCosta deleted the add_pip_req_arm64 branch September 29, 2026 12:49
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

ready for GOSST review Pull requests ready for GOSST team review

Projects

None yet

Development

Successfully merging this pull request may close these issues.

3 participants