From af75a4160f8926c6cf1b19ee09f765325028b63f Mon Sep 17 00:00:00 2001 From: yhirose Date: Tue, 25 Aug 2026 19:09:56 -0400 Subject: [PATCH] CI: quote the OpenSSL installer's /DIR argument Start-Process joins ArgumentList entries with spaces, so /DIR=C:\Program Files\OpenSSL reached Inno Setup as /DIR=C:\Program and the install landed there. Linking still succeeded, because the import libraries were present under that path, and the failure surfaced only when gtest_discover_tests ran the test binary: exit code 0xc0000135, DLL not found, since PATH pointed at C:\Program Files\OpenSSL\bin. Quote the value, and assert that the import libraries and runtime DLLs are where we expect before exporting PATH, so a misplaced install fails loudly at the install step instead of quietly at load time. --- .github/workflows/test.yaml | 14 ++++++++++++-- 1 file changed, 12 insertions(+), 2 deletions(-) diff --git a/.github/workflows/test.yaml b/.github/workflows/test.yaml index 0997d10..fab7a4a 100644 --- a/.github/workflows/test.yaml +++ b/.github/workflows/test.yaml @@ -552,12 +552,22 @@ jobs: } # Same silent flags the Chocolatey package used. The installer is Inno - # Setup, so /DIR pins the location CMake already looks in. + # Setup, so /DIR pins the location CMake already looks in. The inner + # quotes matter: ArgumentList joins on spaces, so an unquoted /DIR + # would install to C:\Program and only fail later, at load time. $dir = 'C:\Program Files\OpenSSL' $proc = Start-Process $installer -Wait -PassThru -ArgumentList ` - '/VERYSILENT', '/SUPPRESSMSGBOXES', '/NORESTART', '/SP-', "/DIR=$dir" + '/VERYSILENT', '/SUPPRESSMSGBOXES', '/NORESTART', '/SP-', "/DIR=`"$dir`"" if ($proc.ExitCode -ne 0) { throw "Installer exited with $($proc.ExitCode)" } + # Catch a misplaced install here rather than at link or load time. + if (-not (Test-Path "$dir\lib\VC\x64\MD\libcrypto.lib")) { + throw "OpenSSL import libraries missing under $dir" + } + if (-not (Get-ChildItem "$dir\bin\libcrypto-*.dll" -ErrorAction SilentlyContinue)) { + throw "OpenSSL runtime DLLs missing under $dir\bin" + } + "$dir\bin" | Out-File $env:GITHUB_PATH -Append -Encoding utf8 "OPENSSL_CONF=$dir\bin\openssl.cfg" | Out-File $env:GITHUB_ENV -Append -Encoding utf8 - name: Configure CMake ${{ matrix.config.name }}