Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

[magnum] build failure - actual issue is vcpkg_copy_tools.cmake #14329

Closed
StarGate-One opened this issue Oct 31, 2020 · 5 comments · Fixed by #14383
Closed

[magnum] build failure - actual issue is vcpkg_copy_tools.cmake #14329

StarGate-One opened this issue Oct 31, 2020 · 5 comments · Fixed by #14383
Assignees
Labels
category:port-bug The issue is with a library, which is something the port should already support

Comments

@StarGate-One
Copy link
Contributor

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 [gamma] Fix find dependency libsndfile #13698 [vcpkg] FIx more cases of semicolon mishandling in "scripts" - followup to PR [execute_process] Don't strip embedded semicolons #12926 0ff75ac#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:
    if(EXISTS ${tool_path})
  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.
@StarGate-One StarGate-One changed the title [<magnum>] build failure - actual issue is vcpkg_copy_tools.cmake [magnum] build failure - actual issue is vcpkg_copy_tools.cmake Oct 31, 2020
@PhoebeHui PhoebeHui self-assigned this Nov 2, 2020
@PhoebeHui PhoebeHui added the category:vcpkg-bug The issue is with the vcpkg system (including helper scripts in `scripts/cmake/`) label Nov 2, 2020
@PhoebeHui
Copy link
Contributor

@StarGate-One, thanks for reporting this issue!

It looks regression isssues involved by PR #13968 recently, cc @jgehw

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

@PhoebeHui
Copy link
Contributor

PhoebeHui commented Nov 3, 2020

After some investigation, and found the changes in

cmake_parse_arguments(PARSE_ARGV 0 _vct "AUTO_CLEAN" "SEARCH_DIR" "TOOL_NAMES")
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

@StarGate-One
Copy link
Contributor Author

@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?

@PhoebeHui
Copy link
Contributor

@StarGate-One, I have summited PR #14383 to remove the backslash in args.

@PhoebeHui PhoebeHui added category:port-bug The issue is with a library, which is something the port should already support and removed category:vcpkg-bug The issue is with the vcpkg system (including helper scripts in `scripts/cmake/`) labels Nov 5, 2020
@StarGate-One
Copy link
Contributor Author

@PhoebeHui Thank you very much.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
category:port-bug The issue is with a library, which is something the port should already support
Projects
None yet
Development

Successfully merging a pull request may close this issue.

2 participants