From d6c1938fc6e50a5a61946defb8b33c3edee2f019 Mon Sep 17 00:00:00 2001 From: Manuel Briones Date: Fri, 11 Sep 2026 19:46:42 +0000 Subject: [PATCH] [Mac] Add markupsafe and pynacl to platform_requirements.txt 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 --- Pipfile | 5 +++-- src/Pipfile | 3 +++ src/platform_requirements.txt | 11 +++++++---- 3 files changed, 13 insertions(+), 6 deletions(-) diff --git a/Pipfile b/Pipfile index 2fc1c4d9c27..17d3f82ab2a 100644 --- a/Pipfile +++ b/Pipfile @@ -4,8 +4,9 @@ verify_ssl = true name = "pypi" [packages] -# If you add or bump packages here with native/compiled C/C++/Rust extensions, -# make sure to also update src/platform_requirements.txt. +# If you add or bump packages here that have native/compiled C/C++/Rust/CFFI +# extensions (either directly or in their transitive dependencies in +# src/Pipfile.lock), make sure to also update src/platform_requirements.txt. cryptography = "==37.0.4" crcmod = "==1.7" future = "==0.17.1" diff --git a/src/Pipfile b/src/Pipfile index 2a3efcb090f..fcc7ac9ac86 100644 --- a/src/Pipfile +++ b/src/Pipfile @@ -4,6 +4,9 @@ verify_ssl = true name = "pypi" [packages] +# If you add or bump packages here that have native/compiled C/C++/Rust/CFFI +# extensions (either directly or in their transitive dependencies in +# src/Pipfile.lock), make sure to also update src/platform_requirements.txt. antlr4-python3-runtime = "==4.7.2" bcrypt = "==4.1.2" certifi = "==2024.2.2" diff --git a/src/platform_requirements.txt b/src/platform_requirements.txt index 8f72f28810d..102c1fc6983 100644 --- a/src/platform_requirements.txt +++ b/src/platform_requirements.txt @@ -1,20 +1,23 @@ -# This file contains dependencies from src/Pipfile that contain native/compiled -# C/C++/Rust extensions. +# This file contains direct and transitive dependencies from src/Pipfile (and +# src/Pipfile.lock) that contain native/compiled C/C++/Rust/CFFI extensions. # # When packaging bot deployment bundles for non-Linux platforms (e.g. Windows, # macOS, macOS ARM64) on a Linux build machine, butler uses this list to # download pre-compiled binary wheels for the target platform and extract them # into src/third_party. # -# If you add or bump a package in Pipfile that has native extensions, make sure -# to update it here as well. +# If you add or bump a package in src/Pipfile that has native extensions (either +# directly or via its transitive dependencies in src/Pipfile.lock), make sure to +# update it here as well. bcrypt==4.1.2 cffi==1.15.1 cryptography==37.0.4 google-crc32c==1.5.0 grpcio==1.62.2 kubernetes==34.1.0 +markupsafe==3.0.3 protobuf==4.23.4 psutil==5.9.4 +pynacl==1.6.0 PyYAML==6.0.1 wrapt==1.16.0 \ No newline at end of file