diff --git a/.github/actions/build-pyinstaller-bundle/action.yml b/.github/actions/build-pyinstaller-bundle/action.yml index e2b873ca9..130fdb114 100644 --- a/.github/actions/build-pyinstaller-bundle/action.yml +++ b/.github/actions/build-pyinstaller-bundle/action.yml @@ -31,6 +31,17 @@ runs: ;; esac + # The manylinux_2_34 image's binutils 2.41 breaks ELF alignment when + # stripping .so files (https://sourceware.org/bugzilla/show_bug.cgi?id=31208); + # install a fixed strip (>= 2.43) from conda-forge. + - name: Install fixed binutils (strip >= 2.43) + shell: bash + run: | + mkdir -p /tmp/micromamba + curl -Ls https://micro.mamba.pm/api/micromamba/linux-64/latest | tar -xj -C /tmp/micromamba + /tmp/micromamba/bin/micromamba create -y -p /opt/bf -c conda-forge binutils=2.44 + echo "/opt/bf/bin" >> "$GITHUB_PATH" + - name: Build PyInstaller bundle shell: bash run: | diff --git a/ecc.spec b/ecc.spec index 9e59a4309..8e8743ed3 100644 --- a/ecc.spec +++ b/ecc.spec @@ -24,6 +24,7 @@ ECC_DIR = Path(SPECPATH) HOOKS_DIR = ECC_DIR / "hooks" CODESIGN_IDENTITY = os.environ.get("APPLE_SIGNING_IDENTITY") BUNDLE_MODE = os.environ.get("ECOS_PYINSTALLER_MODE", "onedir").strip().lower() +STRIP_BINARIES = sys.platform.startswith("linux") if BUNDLE_MODE not in {"onedir", "onefile"}: raise SystemExit(f"Unsupported ECOS_PYINSTALLER_MODE={BUNDLE_MODE!r}; use onedir or onefile.") @@ -262,7 +263,7 @@ if BUNDLE_MODE == "onedir": [], exclude_binaries=True, name="ecc", - strip=False, + strip=STRIP_BINARIES, upx=False, console=True, codesign_identity=CODESIGN_IDENTITY, @@ -273,7 +274,7 @@ if BUNDLE_MODE == "onedir": a.binaries, a.zipfiles, a.datas, - strip=False, + strip=STRIP_BINARIES, upx=False, name="ecc", ) @@ -286,7 +287,7 @@ else: a.datas, [], name="ecc", - strip=False, + strip=STRIP_BINARIES, upx=True, console=True, codesign_identity=CODESIGN_IDENTITY,