Skip to content

Commit b938b70

Browse files
committed
internal: Alias OpenSSL's import libs for the Windows Native link too
Scala Native's javalib links -lcrypto and -lssl, which clang in MSVC mode asks for as crypto.lib / ssl.lib while vcpkg writes libcrypto.lib / libssl.lib. The link died on LNK1104: cannot open file 'crypto.lib'. The compile stage is now fully clean, uni_curl_shim.c included, which is the regression this job is here to catch.
1 parent 7df7f4c commit b938b70

1 file changed

Lines changed: 12 additions & 6 deletions

File tree

.github/workflows/test.yml

Lines changed: 12 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -152,18 +152,24 @@ jobs:
152152
id: vcpkg-cache
153153
with:
154154
path: C:\vcpkg\installed
155-
key: vcpkg-windows-x64-curl-zlib-v1
156-
- name: Install libcurl and zlib
155+
key: vcpkg-windows-x64-curl-zlib-openssl-v2
156+
- name: Install libcurl, zlib and OpenSSL
157157
if: steps.vcpkg-cache.outputs.cache-hit != 'true'
158-
run: vcpkg install curl:x64-windows zlib:x64-windows
158+
run: vcpkg install curl:x64-windows zlib:x64-windows openssl:x64-windows
159159
shell: pwsh
160-
- name: Expose libcurl and zlib to the compiler, the linker and the test binary
161-
# build.sbt links with `-lcurl -lz`, which clang in MSVC mode resolves as curl.lib / z.lib.
160+
- name: Expose the native libraries to the compiler, the linker and the test binary
161+
# Each `-lfoo` / @link("foo") reaches clang in MSVC mode as a request for `foo.lib`:
162+
# `-lcurl -lz` from this build, and `-lcrypto -lssl` from Scala Native's own javalib.
162163
# vcpkg installs those import libraries under their upstream names, so alias them across.
163164
run: |
164165
$root = "$env:VCPKG_INSTALLATION_ROOT\installed\x64-windows"
165166
$libDir = "$root\lib"
166-
@{ "curl.lib" = "libcurl.lib"; "z.lib" = "zlib.lib" }.GetEnumerator() | ForEach-Object {
167+
@{
168+
"curl.lib" = "libcurl.lib"
169+
"z.lib" = "zlib.lib"
170+
"crypto.lib" = "libcrypto.lib"
171+
"ssl.lib" = "libssl.lib"
172+
}.GetEnumerator() | ForEach-Object {
167173
$dst = Join-Path $libDir $_.Key
168174
$src = Join-Path $libDir $_.Value
169175
if (-not (Test-Path $dst) -and (Test-Path $src)) {

0 commit comments

Comments
 (0)