Skip to content

Commit b2b3712

Browse files
fix: exclude bundled OpenSSL libs from Linux binary (#466)
* fix: exclude bundled OpenSSL libs from Linux binary (#462) PyInstaller's bootloader sets LD_LIBRARY_PATH to the binary directory in --onedir mode. When apm spawns git, git-remote-https inherits that path and loads the bundled (build-machine) libssl instead of the system one. On distros where system libcurl requires a newer OpenSSL ABI than the build machine provides (e.g. Fedora 43 with OPENSSL_3.2.0), this causes symbol lookup errors and git clone failures. Fix: exclude libssl.so.3 and libcrypto.so.3 from a.binaries on Linux. Python's _ssl module still works because it finds system libssl via the standard dynamic linker search path. Validated via Docker: built on Ubuntu 24.04, tested on Fedora 43 -- apm --version, apm --help, git clone over HTTPS all pass. Co-authored-by: Copilot <223556219+Copilot@users.noreply.github.com> * fix: address PR review comments - CHANGELOG: use PR number (#466) instead of issue number - apm.spec: soften 'always available' to 'expected on supported targets' Co-authored-by: Copilot <223556219+Copilot@users.noreply.github.com> --------- Co-authored-by: Copilot <223556219+Copilot@users.noreply.github.com>
1 parent 8549142 commit b2b3712

2 files changed

Lines changed: 17 additions & 0 deletions

File tree

CHANGELOG.md

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -15,6 +15,7 @@ and this project adheres to [Semantic Versioning](https://semver.org/spec/v2.0.0
1515
- Skills now deploy to all active targets (`.opencode/`, `.cursor/`) instead of only `.github/` (#456)
1616
- `apm install` no longer rewrites `apm.lock.yaml` when dependencies are unchanged, eliminating `generated_at` churn in version control (#456)
1717
- `.github/` is no longer auto-created when other target dirs (`.claude/`, `.cursor/`, `.opencode/`) already exist; copilot is only the fallback for greenfield projects (#456)
18+
- Linux binary no longer bundles `libssl.so.3`/`libcrypto.so.3`, preventing OpenSSL ABI conflicts on distros where system `libcurl` requires a newer OpenSSL than the build machine (e.g. Fedora 43) (#466)
1819
- SSH-style Git URLs (`git@host:owner/../evil`) now reject path traversal sequences, closing a bypass of the HTTPS validation added in #437 -- by @thakoreh (#458)
1920

2021
### Changed

build/apm.spec

Lines changed: 16 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -209,6 +209,22 @@ a = Analysis(
209209
optimize=2, # Python optimization level for smaller, faster binaries
210210
)
211211

212+
# Exclude bundled OpenSSL shared libraries on Linux.
213+
# PyInstaller's bootloader sets LD_LIBRARY_PATH to the binary directory in
214+
# --onedir mode. When apm spawns git, git-remote-https inherits that path
215+
# and loads the bundled (build-machine) libssl instead of the system one.
216+
# On distros where system libcurl requires a newer OpenSSL ABI than the
217+
# build machine provides (e.g. Fedora 43 with OPENSSL_3.2.0), this causes
218+
# "symbol lookup error" and git clone failures. Excluding these libs lets
219+
# the system OpenSSL be used instead, which is expected to be available on
220+
# supported Linux targets. Python's _ssl module still works because it finds
221+
# system libssl via the standard dynamic linker search path. See:
222+
# github.com/microsoft/apm/issues/462
223+
if sys.platform == 'linux':
224+
_openssl_libs = {'libssl.so.3', 'libcrypto.so.3'}
225+
a.binaries = [(name, path, typ) for name, path, typ in a.binaries
226+
if name not in _openssl_libs]
227+
212228
pyz = PYZ(a.pure, a.zipped_data, cipher=None)
213229

214230
# GNU strip corrupts Windows PE/COFF binaries; only enable on Unix

0 commit comments

Comments
 (0)