fix(windows): vendor OpenSSL for the windows-gnu cross build #27
Loading…
Add table
Add a link
Reference in a new issue
No description provided.
Delete branch "fix/windows-vendored-openssl"
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?
Problem
just build-windows(and the Windows CI build) failed cross-compiling tox86_64-pc-windows-gnu.openssl-sysis linked transitively by the libgit2 git stack (git2->libgit2-sys->libssh2-sys) and byreqwest's defaultnative-tls, and there is nox86_64-w64-mingw32OpenSSL to link against.Fix
Vendor the Windows-target OpenSSL. A
cfg(windows)-gatedopenssldependency with thevendoredfeature pullsopenssl-src, which builds OpenSSL from source with the mingw gcc.openssl-sysuseslinks = "openssl", so the single vendored feature unifies across the whole graph (git2 + reqwest) for the Windows build. Native Linux builds are untouched (the dep is gated to Windows targets) and keep using the distro OpenSSL.Cargo.lockgainsopenssl-src.oci-build/Dockerfile.windowsbumps its base torust-builder-glibc-windows:v1.1.0, which adds the toolchain bits the build needs:make+ fullperl(the slim base ships onlyperl-base, which lacks the modules OpenSSL'sConfigureneeds) for the vendored target build, andlibssl-devfor a secondopenssl-systhat gets compiled for the build host becausessh2-configbuild-depends ongit2.Verification
Built end-to-end against a local image patched with those three packages: produces a valid
PE32+ executable ... x86-64fj.exe(~32 MB).cargo checkon Linux is unchanged.Sequencing
Depends on
niceguyit/oci-imagespublishingrust-builder-glibc-windows:v1.1.0(themake+perl+libssl-devadditions). Until that image is live, this PR's Windows CI build will fail to pull the base image. Merge after the image is published.