From 307515e6d3ec10e94366d1b0423a015661ee0bcb Mon Sep 17 00:00:00 2001 From: Zanie Blue Date: Tue, 9 Jun 2026 09:38:20 -0500 Subject: [PATCH] Use ICF for macOS release builds --- .github/workflows/build-binaries.yml | 8 ++++++++ 1 file changed, 8 insertions(+) diff --git a/.github/workflows/build-binaries.yml b/.github/workflows/build-binaries.yml index 9c7f694119..25efcb324c 100644 --- a/.github/workflows/build-binaries.yml +++ b/.github/workflows/build-binaries.yml @@ -87,6 +87,10 @@ jobs: maturin-version: v1.13.3 target: x86_64 args: --release --locked --out dist --compatibility pypi + env: + # Use Rust's bundled Mach-O LLD, which supports ICF. + # ICF reduces the macOS x86_64 ty binary size by ~1.1%. + RUSTFLAGS: "-C linker=rust-lld -C linker-flavor=ld64.lld -C link-arg=--icf=safe" - name: "Upload wheels" uses: actions/upload-artifact@043fb46d1a93c77aae656e7c1c64a875d1fc6a0a # v7.0.1 with: @@ -130,6 +134,10 @@ jobs: maturin-version: v1.13.3 target: aarch64 args: --release --locked --out dist --compatibility pypi + env: + # Use Rust's bundled Mach-O LLD, which supports ICF. + # ICF reduces the macOS aarch64 ty binary size by ~0.7%. + RUSTFLAGS: "-C linker=rust-lld -C linker-flavor=ld64.lld -C link-arg=--icf=safe" - name: "Test wheel - aarch64" run: | pip install dist/"${PACKAGE_NAME}"-*.whl --force-reinstall