fix(ci): build vendored OpenSSL on Windows so webauthn-rs links (#6161)#6163
Merged
Conversation
The passkey/WebAuthn work (#5981) added webauthn-rs, which pulls in webauthn-rs-core and its native openssl-sys link. Windows MSVC CI runners have no discoverable system OpenSSL, so the workspace test build fails there with "Could not find directory of OpenSSL installation, and this -sys crate cannot proceed". Linux and macOS runners ship a probed system OpenSSL and are unaffected. Add a cfg(windows)-gated openssl = { features = ["vendored"] } dependency to crates/librefang-api so cargo feature-unification builds openssl-sys from source on Windows only; Unix keeps using the fast system library. No NASM setup step is needed: the vendored builder (openssl-src) auto-detects nasm and falls back to a no-asm build when it is absent, and both Windows runner images already ship the Perl the build requires. Closes #6161.
houko
added a commit
that referenced
this pull request
Jun 17, 2026
…lane (#6171) * fix(ci): pin vendored OpenSSL to Strawberry Perl on the Windows test lane #6163 added a Windows-gated vendored `openssl-sys` so `webauthn-rs` links, on the assumption the runner's bundled Perl would build it. That assumption only holds outside Git Bash. The `Test / Windows` job runs `cargo nextest` under `shell: bash`, which prepends the MSYS toolchain to `PATH`, so `openssl-src` resolves `perl` to Git Bash's `/usr/share/perl5/core_perl` instead of Strawberry Perl. That Perl cannot configure OpenSSL's `VC-WIN64A` build — its `IPC::Cmd` / `Params::Check` modules fail to compile and `./Configure` aborts, failing both shards with exit code 101. #6163's own CI never caught this because the Windows test lane is main-push-only and does not run on PRs, so the break only surfaced after merge to `main`. Set `OPENSSL_SRC_PERL` (openssl-src's documented Perl override, ahead of `PERL` and the bare `perl` fallback) to the runner's Windows-native `C:/Strawberry/perl/bin/perl.exe` on the test step. NASM is unaffected — the failing Configure args carried no `no-asm`, so the runner's `nasm` was already detected. The release Windows jobs need no change: their `cargo build` step runs under the default `pwsh`, where the system `PATH` resolves `perl` to Strawberry directly. Refs #6161. * fix(ci): correct CHANGELOG PR ref and trim multi-line comment block --------- Co-authored-by: Evan <[email protected]> Co-authored-by: Claude <[email protected]>
This was referenced Jun 17, 2026
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Problem
mainis red on the Windows test lane.PR #6129 / #5981 (passkey, WebAuthn) added
webauthn-rs, which pulls inwebauthn-rs-coreand through it the nativeopenssl-syscrate.On the Windows MSVC CI runners there is no discoverable system OpenSSL and the vendored build was not enabled, so the workspace test build fails with:
Linux and macOS runners ship a probed system OpenSSL, so they are unaffected — the failure is Windows-only.
Failing run: https://github.com/librefang/librefang/actions/runs/27675199468
Fix
Add a
cfg(windows)-gated dependency tocrates/librefang-api/Cargo.tomlthat enables the vendored OpenSSL build:Cargo feature-unification then makes
openssl-sysbuild from vendored source on Windows only.Unix targets keep using the fast system library already present in CI — the
cfg(windows)gate means nothing changes for Linux/macOS.The dependency is added to the existing
[target.'cfg(windows)'.dependencies]table (which already carrieswindows-sys), not a duplicate table.version = "0.10"matches theopenssl 0.10.81already resolved inCargo.lock.Why no NASM / Perl setup step
The vendored builder is
openssl-src. It auto-detects whethernasm.exeis on PATH: if present it enables the assembly routines, if absent it configuresno-asmand builds without them rather than failing (OPENSSL_RUST_USE_NASMleft unset → auto-detect).So the absence of NASM on the GitHub Windows runner images is not a build blocker.
Both
windows-2022andwindows-2025runner images ship Perl (5.32.1 / 5.42.0), which is the only host prerequisite the vendored build actually needs.This keeps the change to a single line — no new CI install step. (I verified the
test-windowsjob in.github/workflows/ci.ymlhas no existingnasm/perlsetup step and confirmed against theactions/runner-imagesreadmes that Perl is preinstalled and NASM is not.)Changes
crates/librefang-api/Cargo.toml: addcfg(windows)-gatedopenssl = { version = "0.10", features = ["vendored"] }with an explanatory comment.Cargo.lock: regenerated — addsopenssl-src 300.6.1+3.6.3as a dependency ofopenssl-sys, andopensslas a direct dep oflibrefang-api. The lockfile is target-agnostic, so thecfg(windows)dep resolves and locks even on a Linux host.CHANGELOG.md: one### Fixedbullet under[Unreleased]..secrets.baseline: line-number refresh emitted by thedetect-secretspre-commit hook (an existing already-baselined CHANGELOG entry shifted down 6 lines); no new secret.Verification
This host has no native cargo, so verification ran through the repo's sanctioned
librefang-rust-devDocker image (Linux), using a per-worktree target volume + the shared download volume, exactly asCLAUDE.md(“Verifying without a native toolchain”) prescribes:Results:
cargo check -p librefang-api— clean (Finishedin ~1m12s); this regeneratedCargo.lock.cargo check -p librefang-api --locked— clean, no further lockfile changes (Finishedin 0.26s), confirmingCargo.lockis--locked-clean.cargo check --workspace --lib --locked— clean (Finishedin ~1m05s).No
.rsfiles were touched, socargo fmtwas not required.The container is Linux-only and cannot compile the
cfg(windows)branch, so it does not itself exercise the vendored OpenSSL build — but the lockfile resolution above proves the dependency graph is correct, and the fix is the standard MSVC remedy for anopenssl-syslink failure.CI nuance
The Windows test lane (
test-windowsin.github/workflows/ci.yml) runs only on push tomainand in the merge queue (github.event_name == 'push' || 'merge_group') — it does not run on pull requests, and there is noworkflow_dispatchor label to trigger it on a PR.So this PR's own CI will not exercise Windows.
If the repo merges through a merge queue, the
merge_groupevent will run the Windows job before this lands onmain; otherwise the first Windows validation happens on the post-mergemainpush.Either way the fix is the canonical vendored-OpenSSL remedy and has been validated by dependency-graph resolution + the Docker Linux checks above.
Closes #6161.