Vcpkg: [magnum] build failure - actual issue is vcpkg_copy_tools.cmake

Created on 31 Oct 2020  路  5Comments  路  Source: microsoft/vcpkg

Host Environment

  • OS: [Microsoft Windows [Version 10.0.19042.610]]
  • Compiler: Visual Studio 2019 Version: 16.7.7 VS Tools Version: 14.27.29110
    Visual Studio 2017 Version: 15.9.28 VS Tools Version: 14.16.27023
  • See Additional Context below.

To Reproduce
Steps to reproduce the behavior:
.\vcpkg.exe install --x-use-aria2 --recurse --keep-going --editable magnum[al-info,anyaudioimporter,anyimageconverter,anyimageimporter,anysceneconverter,anysceneimporter,audio,cglcontext,core,debugtools,distancefieldconverter,fontconverter,gl,gl-info,glfwapplication,imageconverter,magnumfont,magnumfontconverter,meshtools,objimporter,opengltester,primitives,scenegraph,sdl2application,shaders,text,texturetools,tgaimageconverter,tgaimporter,trade,wavaudioimporter,wglcontext,windowlesswglapplication]:x64-windows magnum-extras[core,ui]:x64-windows magnum-integration[bullet,core,glm,imgui]:x64-windows magnum-plugins[core,ddsimporter,devilimageimporter,drflacaudioimporter,freetypefont,harfbuzzfont,icoimporter,jpegimageconverter,jpegimporter,miniexrimageconverter,openddl,opengeximporter,pngimageconverter,pngimporter,stanfordimporter,stanfordsceneconverter,stbimageconverter,stbimageimporter,stlimporter]:x64-windows

Failure logs

  • Cut and past the appropriate build messages from the console output.
    Computing installation plan...
    The following packages will be built and installed:
    magnum[al-info,anyaudioimporter,anyimageconverter,anyimageimporter,anysceneconverter,anysceneimporter,audio,cglcontext,core,debugtools,distancefieldconverter,fontconverter,gl,gl-info,glfwapplication,imageconverter,magnumfont,magnumfontconverter,meshtools,objimporter,opengltester,primitives,scenegraph,sdl2application,shaders,text,texturetools,tgaimageconverter,tgaimporter,trade,wavaudioimporter,wglcontext,windowlesswglapplication]:x64-windows
    magnum-extras[core,ui]:x64-windows
    magnum-integration[bullet,core,glm,imgui]:x64-windows
    magnum-plugins[core,ddsimporter,devilimageimporter,drflacaudioimporter,freetypefont,harfbuzzfont,icoimporter,jpegimageconverter,jpegimporter,miniexrimageconverter,openddl,opengeximporter,pngimageconverter,pngimporter,stanfordimporter,stanfordsceneconverter,stbimageconverter,stbimageimporter,stlimporter]:x64-windows
    Starting package 1/4: magnum:x64-windows
    Building package magnum[al-info,anyaudioimporter,anyimageconverter,anyimageimporter,anysceneconverter,anysceneimporter,audio,cglcontext,core,debugtools,distancefieldconverter,fontconverter,gl,gl-info,glfwapplication,imageconverter,magnumfont,magnumfontconverter,meshtools,objimporter,opengltester,primitives,scenegraph,sdl2application,shaders,text,texturetools,tgaimageconverter,tgaimporter,trade,wavaudioimporter,wglcontext,windowlesswglapplication]:x64-windows...
    -- Using cached D:/vcpkg_x64/vs2019/prod/downloads/mosra-magnum-v2020.06.tar.gz
    -- Extracting source D:/vcpkg_x64/vs2019/prod/downloads/mosra-magnum-v2020.06.tar.gz
    -- Applying patch 001-tools-path.patch
    -- Applying patch 002-sdl-includes.patch
    -- Using source at D:/vcpkg_x64/vs2019/prod/buildtrees/magnum/src/v2020.06-97c0869c1f
    -- Configuring x64-windows
    -- Building x64-windows-dbg
    -- Building x64-windows-rel
    -- magnum-al-infomagnum-distancefieldconvertermagnum-fontconvertermagnum-gl-infomagnum-imageconverter
    CMake Error at scripts/cmake/vcpkg_copy_tools.cmake:45 (if):
    if given arguments:

    "EXISTS" "D:/vcpkg_x64/vs2019/prod/packages/magnum_x64-windows/bin/magnum-al-info" "magnum-distancefieldconverter" "magnum-fontconverter" "magnum-gl-info" "magnum-imageconverter.exe"

    Unknown arguments specified
    Call Stack (most recent call first):
    ports/magnum/portfile.cmake:105 (vcpkg_copy_tools)
    scripts/ports.cmake:135 (include)


    Error: Building package magnum:x64-windows failed with: BUILD_FAILED
    Please ensure you're using the latest portfiles with.vcpkg update, then
    submit an issue at https://github.com/Microsoft/vcpkg/issues including:
    Package: magnum:x64-windows
    Vcpkg version: 2020.06.15-nohash

    Additionally, attach any relevant sections from the log files above.
  • Please attach any additional failure logs mentioned in the console output.
    N/A

Additional context
Add any other context about the problem here, such as what you have already tried to resolve the issue.

  1. The actual problem appears to be related to the change made to vcpkg_copy_tools.cmake line 29 PR #13698 [vcpkg] FIx more cases of semicolon mishandling in "scripts" - followup to PR #12926 https://github.com/microsoft/vcpkg/commit/0ff75ac80b9a3770afb3d2971c572628d80a631e#diff-ab246505744d35f525b9356b69b69acb36b60b8f1a99300a2f05bff5d4ab77f2 was changed from:
    cmake_parse_arguments(_vct "AUTO_CLEAN" "SEARCH_DIR" "TOOL_NAMES" ${ARGN}) to
    cmake_parse_arguments(PARSE_ARGV 0 _vct "AUTO_CLEAN" "SEARCH_DIR" "TOOL_NAMES")
  2. Somehow this change causes vcpkg_copy_tools.cmake line 45 if state to fail: https://github.com/microsoft/vcpkg/blob/e9ff3cd5a04cd0e8122ff56e9873985ff71aa3ca/scripts/cmake/vcpkg_copy_tools.cmake#L45
  3. If I back out this single change to vcpkg_copy_tools.cmake line 29 only, then magnum and related features and other ports with magnum dependency install normally.
port-bug

Most helpful comment

@StarGate-One, I have summited PR https://github.com/microsoft/vcpkg/pull/14383 to remove the backslash in args.

All 5 comments

@StarGate-One, thanks for reporting this issue!

It looks regression isssues involved by PR https://github.com/microsoft/vcpkg/pull/13968 recently, cc @jgehw

Repro:
./vcpkg install magnum[al-info,distancefieldconverter,fontconverter,gl-info,imageconverter]:x64-windows

After some investigation, and found the changes in https://github.com/microsoft/vcpkg/blob/e9ff3cd5a04cd0e8122ff56e9873985ff71aa3ca/scripts/cmake/vcpkg_copy_tools.cmake#L30 cause the issue.

Currently it switch to
cmake_parse_arguments(PARSE_ARGV 0 _vct "AUTO_CLEAN" "SEARCH_DIR" "TOOL_NAMES")

The TOOL_NAMES is

magnum-al-info\;magnum-distancefieldconverter\;magnum-fontconverter\;magnum-gl-info\;magnum-imageconverter

And for previous revision:
cmake_parse_arguments(_vct "AUTO_CLEAN" "SEARCH_DIR" "TOOL_NAMES" ${ARGN})

The TOOL_NAMES is

magnum-al-info;magnum-distancefieldconverter;magnum-fontconverter;magnum-gl-info;magnum-imageconverter

This is is known CMake issue https://gitlab.kitware.com/cmake/cmake/-/issues/20317.

I think we have 2 workaounds:

  1. Revert the changes for vcpkg_copy_tools.cmake
  2. Replace the in TOOL_NAMES

@PhoebeHui thank you.
Right now I have backed out the change for now, but I believe the best fix would be to remove the "" in TOOL_NAMES list as you suggest in the second work around.
CMake has been aware of the issue for 8 months without much progress as it seems they are debating whether they should change it or not??? :
I would attempt to figure a fix, but I am not well versed/familiar in CMake to figure out a regex to remove the "" before semi-colons in the tool list?

@StarGate-One, I have summited PR https://github.com/microsoft/vcpkg/pull/14383 to remove the backslash in args.

@PhoebeHui Thank you very much.

Was this page helpful?
0 / 5 - 0 ratings