fix(build): vendor OpenSSL on macOS so the build works natively #82
Loading…
Reference in a new issue
No description provided.
Delete branch "fix/macos-build"
Deleting a branch is permanent. Although the deleted branch may continue to exist for a short time before it actually gets removed, it CANNOT be undone in most cases. Continue?
cargo buildfailed on a stock Mac:openssl-syscannot find a system OpenSSL because macOS ships neither OpenSSL headers norpkg-config, andgit2'shttps+sshfeatures pull it in throughlibgit2-sysandlibssh2-sys. The crate already vendors OpenSSL for musl and Windows for the same reason, so extend that tocfg(target_os = "macos").The macOS entry has to appear twice.
ssh2-configdeclares an unconditionalgit2build-dependency, which puts a secondopenssl-sysin the build-script half of the graph, and Cargo's v2 resolver resolves build-dependency features separately from normal-dependency ones. With only the normal-dependency entry the build-script copy still went looking for a system OpenSSL and failed, so a matching[target.'cfg(target_os = "macos")'.build-dependencies.openssl]putsopenssl-sys/vendoredon the build side too.Nothing changes for the release targets: both entries are gated on
cfg(target_os = "macos"), and Cargo.lock is untouched because the vendoredopensslwas already locked for the musl and Windows targets. The nix flake gainsperlon Darwin, whichopenssl-srcshells out to during the vendored build. Verified on aarch64-apple-darwin: debug and release builds, the full test suite (9 binaries, no failures),cargo fmt --check,cargo clippy, a livefj repo viewagainst codeberg.org, and a livefj repo cloneover https, which exercises libgit2 against the vendored OpenSSL at runtime.Co-Authored-By: Claude Opus 5 (1M context) noreply@anthropic.com