vcpkg icon indicating copy to clipboard operation
vcpkg copied to clipboard

[msquic] Build error on arm64-windows

Open redbaron opened this issue 1 year ago • 5 comments

Package: ms-quic:[email protected]

Host Environment

  • Host: arm64-windows
  • Compiler: MSVC 19.41.34120.0
  • vcpkg-tool version: 2024-06-10-02590c430e4ed9215d27870138c2e579cc338772 vcpkg-readonly: true vcpkg-scripts version: 6f1ddd6b6878e7e66fcc35c65ba1d8feec2e01f8

To Reproduce

vcpkg install

Failure logs

-- Using cached microsoft-msquic-v2.3.5.tar.gz.
-- Cleaning sources at C:/Users/myuser/Documents/repos/myproj/cpp/myproj-cpp/build/win-arm64/vcpkg_installed/vcpkg/blds/ms-quic/src/v2.3.5-b4ab2e4e58.clean. Use --editable to skip cleaning for the packages you specify.
-- Extracting source C:/Users/myuser/AppData/Local/vcpkg/downloads/microsoft-msquic-v2.3.5.tar.gz
-- Applying patch fix-warnings.patch
-- Applying patch fix-platform.patch
-- Using source at C:/Users/myuser/Documents/repos/myproj/cpp/myproj-cpp/build/win-arm64/vcpkg_installed/vcpkg/blds/ms-quic/src/v2.3.5-b4ab2e4e58.clean
-- Using cached quictls-openssl-a6e9d76db343605dae9b59d71d2811b195ae7434.tar.gz.
-- Extracting source C:/Users/myuser/AppData/Local/vcpkg/downloads/quictls-openssl-a6e9d76db343605dae9b59d71d2811b195ae7434.tar.gz
-- Using source at C:/Users/myuser/Documents/repos/myproj/cpp/myproj-cpp/build/win-arm64/vcpkg_installed/vcpkg/blds/ms-quic/src/b195ae7434-aa88ae7c62.clean
-- Found external ninja('1.11.0').
-- Configuring arm64-windows-dbg
-- Configuring arm64-windows-rel
-- Building arm64-windows-dbg
CMake Error at scripts/cmake/vcpkg_execute_build_process.cmake:134 (message):
    Command failed: "C:/Program Files/Microsoft Visual Studio/2022/Community/Common7/IDE/CommonExtensions/Microsoft/CMake/CMake/bin/cmake.exe" --build . --config Debug --target install -- -v -j5
    Working Directory: C:/Users/myuser/Documents/repos/myproj/cpp/myproj-cpp/build/win-arm64/vcpkg_installed/vcpkg/blds/ms-quic/arm64-windows-dbg
    See logs for more information:
      C:\Users\myuser\Documents\repos\myproj\cpp\myproj-cpp\build\win-arm64\vcpkg_installed\vcpkg\blds\ms-quic\install-arm64-windows-dbg-out.log

Call Stack (most recent call first):
  C:/Users/myuser/Documents/repos/myproj/cpp/myproj-cpp/build/win-arm64/vcpkg_installed/arm64-windows/share/vcpkg-cmake/vcpkg_cmake_build.cmake:74 (vcpkg_execute_build_process)
  C:/Users/myuser/Documents/repos/myproj/cpp/myproj-cpp/build/win-arm64/vcpkg_installed/arm64-windows/share/vcpkg-cmake/vcpkg_cmake_install.cmake:16 (vcpkg_cmake_build)
  C:/Users/myuser/AppData/Local/vcpkg/registries/git-trees/79ce012c5c2a8a80f54af0bec16d6ba7d1b3ef11/portfile.cmake:61 (vcpkg_cmake_install)
  scripts/ports.cmake:175 (include)



C:\Users\myuser\Documents\repos\myproj\cpp\myproj-cpp\build\win-arm64\vcpkg_installed\vcpkg\blds\ms-quic\install-arm64-windows-dbg-out.log
Change Dir: 'C:/Users/myuser/Documents/repos/myproj/cpp/myproj-cpp/build/win-arm64/vcpkg_installed/vcpkg/blds/ms-quic/arm64-windows-dbg'

Run Build Command(s): "C:/Program Files/Microsoft Visual Studio/2022/Community/Common7/IDE/CommonExtensions/Microsoft/CMake/Ninja/ninja.exe" -v -v -j5 install
[1/62] C:\Windows\system32\cmd.exe /C "cd /D C:\Users\myuser\Documents\repos\myproj\cpp\myproj-cpp\build\win-arm64\vcpkg_installed\vcpkg\blds\ms-quic\arm64-windows-dbg\_deps\opensslquic-build\submodules\openssl\debug && perl C:/Users/myuser/Documents/repos/myproj/cpp/myproj-cpp/build/win-arm64/vcpkg_installed/vcpkg/blds/ms-quic/src/v2.3.5-b4ab2e4e58.clean/submodules/openssl/Configure enable-tls1_3 no-makedepend no-dgram no-ssl3 no-psk no-srp no-zlib no-egd no-idea no-rc5 no-rc4 no-afalgeng no-comp no-cms no-ct no-srp no-srtp no-ts no-gost no-dso no-ec2m no-tls1 no-tls1_1 no-tls1_2 no-dtls no-dtls1 no-dtls1_2 no-ssl no-ssl3-method no-tls1-method no-tls1_1-method no-tls1_2-method no-dtls1-method no-dtls1_2-method no-siphash no-whirlpool no-aria no-bf no-blake2 no-sm2 no-sm3 no-sm4 no-camellia no-cast no-md4 no-mdc2 no-ocb no-rc2 no-rmd160 no-scrypt no-seed no-weak-ssl-ciphers no-shared no-tests --openssldir="C:\Program Files\Common Files\SSL" VC-WIN64-ARM /Qspectre --debug --prefix=C:/Users/myuser/Documents/repos/myproj/cpp/myproj-cpp/build/win-arm64/vcpkg_installed/vcpkg/blds/ms-quic/arm64-windows-dbg/_deps/opensslquic-build/openssl/debug "
FAILED: _deps/opensslquic-build/submodules/openssl/debug/makefile C:/Users/myuser/Documents/repos/myproj/cpp/myproj-cpp/build/win-arm64/vcpkg_installed/vcpkg/blds/ms-quic/arm64-windows-dbg/_deps/opensslquic-build/submodules/openssl/debug/makefile 
C:\Windows\system32\cmd.exe /C "cd /D C:\Users\myuser\Documents\repos\myproj\cpp\myproj-cpp\build\win-arm64\vcpkg_installed\vcpkg\blds\ms-quic\arm64-windows-dbg\_deps\opensslquic-build\submodules\openssl\debug && perl C:/Users/myuser/Documents/repos/myproj/cpp/myproj-cpp/build/win-arm64/vcpkg_installed/vcpkg/blds/ms-quic/src/v2.3.5-b4ab2e4e58.clean/submodules/openssl/Configure enable-tls1_3 no-makedepend no-dgram no-ssl3 no-psk no-srp no-zlib no-egd no-idea no-rc5 no-rc4 no-afalgeng no-comp no-cms no-ct no-srp no-srtp no-ts no-gost no-dso no-ec2m no-tls1 no-tls1_1 no-tls1_2 no-dtls no-dtls1 no-dtls1_2 no-ssl no-ssl3-method no-tls1-method no-tls1_1-method no-tls1_2-method no-dtls1-method no-dtls1_2-method no-siphash no-whirlpool no-aria no-bf no-blake2 no-sm2 no-sm3 no-sm4 no-camellia no-cast no-md4 no-mdc2 no-ocb no-rc2 no-rmd160 no-scrypt no-seed no-weak-ssl-ciphers no-shared no-tests --openssldir="C:\Program Files\Common Files\SSL" VC-WIN64-ARM /Qspectre --debug --prefix=C:/Users/myuser/Documents/repos/myproj/cpp/myproj-cpp/build/win-arm64/vcpkg_installed/vcpkg/blds/ms-quic/arm64-windows-dbg/_deps/opensslquic-build/openssl/debug "
'perl' is not recognized as an internal or external command,

operable program or batch file.

[2/62] C:\Windows\system32\cmd.exe /C "cd /D C:\Users\myuser\Documents\repos\myproj\cpp\myproj-cpp\build\win-arm64\vcpkg_installed\vcpkg\blds\ms-quic\arm64-windows-dbg && mc.exe -um -h C:/Users/myuser/Documents/repos/myproj/cpp/myproj-cpp/build/win-arm64/vcpkg_installed/vcpkg/blds/ms-quic/arm64-windows-dbg/inc -r C:/Users/myuser/Documents/repos/myproj/cpp/myproj-cpp/build/win-arm64/vcpkg_installed/vcpkg/blds/ms-quic/arm64-windows-dbg/inc C:/Users/myuser/Documents/repos/myproj/cpp/myproj-cpp/build/win-arm64/vcpkg_installed/vcpkg/blds/ms-quic/src/v2.3.5-b4ab2e4e58.clean/src/manifest/MsQuicEtw.man"
[3/62] C:\PROGRA~1\MICROS~1\2022\COMMUN~1\VC\Tools\MSVC\1441~1.341\bin\HOSTAR~1\arm64\cl.exe   -DQUIC_DISABLE_SHARED_PORT_TESTS -DQUIC_EVENTS_STUB -DQUIC_LOGS_STUB -DQUIC_TEST_OPENSSL_FLAGS=1 -DSECURITY_WIN32 -DVER_BUILD_ID=0 -DVER_SUFFIX=-private -DWIN32_LEAN_AND_MEAN -IC:\Users\myuser\Documents\repos\myproj\cpp\myproj-cpp\build\win-arm64\vcpkg_installed\vcpkg\blds\ms-quic\src\v2.3.5-b4ab2e4e58.clean\src\inc /nologo /DWIN32 /D_WINDOWS /W3 /utf-8 /MP  /D_DEBUG /MDd /Z7 /Ob0 /Od /RTC1  -std:c11 -MTd /analyze /Qspectre /guard:cf /MP /W4 /sdl /showIncludes /Fosrc\core\CMakeFiles\core.dir\ack_tracker.c.obj /Fdsrc\core\CMakeFiles\core.dir\core.pdb /FS -c C:\Users\myuser\Documents\repos\myproj\cpp\myproj-cpp\build\win-arm64\vcpkg_installed\vcpkg\blds\ms-quic\src\v2.3.5-b4ab2e4e58.clean\src\core\ack_tracker.c
cl : Command line warning D9025 : overriding '/MDd' with '/MTd'
cl : Command line warning D9025 : overriding '/W3' with '/W4'
[4/62] C:\PROGRA~1\MICROS~1\2022\COMMUN~1\VC\Tools\MSVC\1441~1.341\bin\HOSTAR~1\arm64\cl.exe   -DQUIC_DISABLE_SHARED_PORT_TESTS -DQUIC_EVENTS_STUB -DQUIC_LOGS_STUB -DQUIC_TEST_OPENSSL_FLAGS=1 -DSECURITY_WIN32 -DVER_BUILD_ID=0 -DVER_SUFFIX=-private -DWIN32_LEAN_AND_MEAN -IC:\Users\myuser\Documents\repos\myproj\cpp\myproj-cpp\build\win-arm64\vcpkg_installed\vcpkg\blds\ms-quic\src\v2.3.5-b4ab2e4e58.clean\src\inc /nologo /DWIN32 /D_WINDOWS /W3 /utf-8 /MP  /D_DEBUG /MDd /Z7 /Ob0 /Od /RTC1  -std:c11 -MTd /analyze /Qspectre /guard:cf /MP /W4 /sdl /showIncludes /Fosrc\core\CMakeFiles\core.dir\api.c.obj /Fdsrc\core\CMakeFiles\core.dir\core.pdb /FS -c C:\Users\myuser\Documents\repos\myproj\cpp\myproj-cpp\build\win-arm64\vcpkg_installed\vcpkg\blds\ms-quic\src\v2.3.5-b4ab2e4e58.clean\src\core\api.c
cl : Command line warning D9025 : overriding '/MDd' with '/MTd'
cl : Command line warning D9025 : overriding '/W3' with '/W4'
[5/62] C:\PROGRA~1\MICROS~1\2022\COMMUN~1\VC\Tools\MSVC\1442~1.341\bin\HOSTAR~1\arm64\cl.exe   -DQUIC_DISABLE_SHARED_PORT_TESTS -DQUIC_EVENTS_STUB -DQUIC_LOGS_STUB -DQUIC_TEST_OPENSSL_FLAGS=1 -DSECURITY_WIN32 -DVER_BUILD_ID=0 -DVER_SUFFIX=-private -DWIN32_LEAN_AND_MEAN -IC:\Users\myuser\Documents\repos\myproj\cpp\myproj-cpp\build\win-arm64\vcpkg_installed\vcpkg\blds\ms-quic\src\v2.3.5-b4ab2e4e58.clean\src\inc /nologo /DWIN32 /D_WINDOWS /W3 /utf-8 /MP  /D_DEBUG /MDd /Z7 /Ob0 /Od /RTC1  -std:c11 -MTd /analyze /Qspectre /guard:cf /MP /W4 /sdl /showIncludes /Fosrc\core\CMakeFiles\core.dir\binding.c.obj /Fdsrc\core\CMakeFiles\core.dir\core.pdb /FS -c C:\Users\myuser\Documents\repos\myproj\cpp\myproj-cpp\build\win-arm64\vcpkg_installed\vcpkg\blds\ms-quic\src\v2.3.5-b4ab2e4e58.clean\src\core\binding.c
cl : Command line warning D9025 : overriding '/MDd' with '/MTd'
cl : Command line warning D9025 : overriding '/W3' with '/W4'
ninja: build stopped: subcommand failed.

Additional context

vcpkg.json
{
  "name": "myproj-cpp",
  "version": "1.0.0",
  "dependencies": [
    {
      "name": "ms-quic",
      "version>=": "2.3.5"
    },
    {
      "name": "protobuf"
    }
  ],
  "default-features": [],
  "builtin-baseline": "3508985146f1b1d248c67ead13f8f54be5b4f5da"
}

redbaron avatar Aug 26 '24 07:08 redbaron

I can't reproduce this issue in my side with the latest vcpkg and the vcpkg.json file you provided. Here are a few points to note:

  1. ms-quic was renamed to msquic two months ago, so if your command is running correctly, your local vcpkg version is likely outdated. I suggest you run the git pull command locally.
  2. Please avoid setting the vcpkg_installed path too deep (the current path length is already 37 characters), as this may cause some build issues.
  3. You can delete the local downloads folder before installing the port.

Cheney-W avatar Aug 26 '24 09:08 Cheney-W

@Cheney-W , do you build it on arm64 windows? it looks I can't build msquic in latest Visual Studio 2022 v17.11.1 for either x64-windows or arm64-windows target triplets, my host triplet is arm64-windows . It doesn't change if I update baseline to latest with vcpkg x-update-baseline and use maquis instead.

Including full reproducer. Create 3 files in empty dir, open in VS 2022 . It fails with different error than perl not found:

[10/65] C:\Windows\system32\cmd.exe /C "cd /D C:\Users\myuser\source\repos\bug40642\out\build\x64-debug\vcpkg_installed\vcpkg\blds\msquic\x64-windows-dbg\_deps\opensslquic-build\submodules\openssl\debug && perl C:/Users/myuser/source/repos/bug40642/out/build/x64-debug/vcpkg_installed/vcpkg/blds/msquic/src/v2.3.5-48bc6bb96f.clean/submodules/openssl/Configure enable-tls1_3 no-makedepend no-dgram no-ssl3 no-psk no-srp no-zlib no-egd no-idea no-rc5 no-rc4 no-afalgeng no-comp no-cms no-ct no-srp no-srtp no-ts no-gost no-dso no-ec2m no-tls1 no-tls1_1 no-tls1_2 no-dtls no-dtls1 no-dtls1_2 no-ssl no-ssl3-method no-tls1-method no-tls1_1-method no-tls1_2-method no-dtls1-method no-dtls1_2-method no-siphash no-whirlpool no-aria no-bf no-blake2 no-sm2 no-sm3 no-sm4 no-camellia no-cast no-md4 no-mdc2 no-ocb no-rc2 no-rmd160 no-scrypt no-seed no-weak-ssl-ciphers no-shared no-tests --openssldir="C:\Program Files\Common Files\SSL" VC-WIN64A /Qspectre --debug --prefix=C:/Users/myuser/source/repos/bug40642/out/build/x64-debug/vcpkg_installed/vcpkg/blds/msquic/x64-windows-dbg/_deps/opensslquic-build/openssl/debug "
FAILED: _deps/opensslquic-build/submodules/openssl/debug/makefile C:/Users/myuser/source/repos/bug40642/out/build/x64-debug/vcpkg_installed/vcpkg/blds/msquic/x64-windows-dbg/_deps/opensslquic-build/submodules/openssl/debug/makefile 
C:\Windows\system32\cmd.exe /C "cd /D C:\Users\myuser\source\repos\bug40642\out\build\x64-debug\vcpkg_installed\vcpkg\blds\msquic\x64-windows-dbg\_deps\opensslquic-build\submodules\openssl\debug && perl C:/Users/myuser/source/repos/bug40642/out/build/x64-debug/vcpkg_installed/vcpkg/blds/msquic/src/v2.3.5-48bc6bb96f.clean/submodules/openssl/Configure enable-tls1_3 no-makedepend no-dgram no-ssl3 no-psk no-srp no-zlib no-egd no-idea no-rc5 no-rc4 no-afalgeng no-comp no-cms no-ct no-srp no-srtp no-ts no-gost no-dso no-ec2m no-tls1 no-tls1_1 no-tls1_2 no-dtls no-dtls1 no-dtls1_2 no-ssl no-ssl3-method no-tls1-method no-tls1_1-method no-tls1_2-method no-dtls1-method no-dtls1_2-method no-siphash no-whirlpool no-aria no-bf no-blake2 no-sm2 no-sm3 no-sm4 no-camellia no-cast no-md4 no-mdc2 no-ocb no-rc2 no-rmd160 no-scrypt no-seed no-weak-ssl-ciphers no-shared no-tests --openssldir="C:\Program Files\Common Files\SSL" VC-WIN64A /Qspectre --debug --prefix=C:/Users/myuser/source/repos/bug40642/out/build/x64-debug/vcpkg_installed/vcpkg/blds/msquic/x64-windows-dbg/_deps/opensslquic-build/openssl/debug "
Configuring OpenSSL version 1.1.1w+quic (0x1010117fL) for VC-WIN64A

Using os-specific seed configuration

*** Couldn't find any of:

..\..\..\..\..\..\src\v2.3.5-48bc6bb96f.clean\submodules\openssl\Configurations\windows-makefile.tmpl

..\..\..\..\..\..\src\v2.3.5-48bc6bb96f.clean\submodules\openssl\Configurations\makefile.tmpl

vcpkg.json:

{
  "name": "bug40642",
  "version": "1.0.0",
  "dependencies": [
    {
      "name": "msquic",
      "version>=": "2.3.5"
    }
  ],
  "default-features": [],
  "builtin-baseline": "509f71e53f45e46c13fa7935d2f6a45803580c07"
}

CMakePresets.json:

{
    "version": 3,
    "configurePresets": [
        {
            "name": "windows-base",
            "hidden": true,
            "generator": "Ninja",
            "binaryDir": "${sourceDir}/out/build/${presetName}",
            "installDir": "${sourceDir}/out/install/${presetName}",
            "cacheVariables": {
              "CMAKE_C_COMPILER": "cl.exe",
              "CMAKE_CXX_COMPILER": "cl.exe",
              "CMAKE_TOOLCHAIN_FILE": "$env{VCPKG_ROOT}/scripts/buildsystems/vcpkg.cmake"
            },
            "condition": {
                "type": "equals",
                "lhs": "${hostSystemName}",
                "rhs": "Windows"
            }
        },
        {
            "name": "x64-debug",
            "displayName": "x64 Debug",
            "inherits": "windows-base",
            "architecture": {
                "value": "x64",
                "strategy": "external"
            },
            "cacheVariables": {
              "CMAKE_BUILD_TYPE": "Debug",
              "VCPKG_TARGET_TRIPLET": "x64-windows",
              "VCPKG_HOST_TRIPLET":  "arm64-windows"
            }
        }
    ]
}

CMakeLists.txt:

cmake_minimum_required (VERSION 3.28.0)

project ("bug40642" LANGUAGE C CXX)

find_package(msquic CONFIG REQUIRED)

redbaron avatar Aug 27 '24 00:08 redbaron

My local machine is a Windows x64 machine; I only set the build triplet to arm64-windows. Could you please try the following steps to reproduce this issue:

  1. Open PowerShell and navigate to a drive with enough space, such as the E or F drive.
  2. git clone https://github.com/Microsoft/vcpkg.git
  3. cd vcpkg
  4. .\bootstrap-vcpkg.bat
  5. .\vcpkg install msquic:arm64-windows

Cheney-W avatar Aug 27 '24 10:08 Cheney-W

Interesting, when I use classic mode as you suggested or manifest mode in my reproducer it works from console, but it doesn't work when project is loaded from Visual Studio

redbaron avatar Aug 27 '24 13:08 redbaron

Did you run .\vcpkg integrate install before opening Visual Studio?

Cheney-W avatar Aug 28 '24 02:08 Cheney-W

Did you run .\vcpkg integrate install before opening Visual Studio?

My understanding is it affect MSBuilds, which is not used when VCPKG toolchain installs dependencies in manifest mode early in Cmake configure phase.

redbaron avatar Aug 29 '24 08:08 redbaron

You mentioned earlier that this issue only occurs when you load the project from VS. The command I mentioned is intended to help VS recognize which vcpkg it should use. If you only created a CMake project in VS, you don't need to run this command. Instead, you need to set the value of CMAKE_TOOLCHAIN_FILE to point to the path of scripts/buildsystems/vcpkg.cmake.

Cheney-W avatar Aug 29 '24 09:08 Cheney-W

If you only created a CMake project in VS, you don't need to run this command. Instead, you need to set the value of CMAKE_TOOLCHAIN_FILE to point to the path of scripts/buildsystems/vcpkg.cmake.

Yes, that's what I do , if you see my reproducer CMakePresets.json has:

"CMAKE_TOOLCHAIN_FILE": "$env{VCPKG_ROOT}/scripts/buildsystems/vcpkg.cmake"

and VCPKG_ROOT is set by Visual Studio

redbaron avatar Aug 29 '24 10:08 redbaron

If I remove vcpkg component from visual studio and just use vcpkg on a side via user-defined VCPKG_ROOT env vat it all works flawlessly.

redbaron avatar Sep 01 '24 09:09 redbaron