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

${variant:targetVariant} is not expanded properly since v1.5 #1525

Closed
ghost opened this issue Nov 6, 2020 · 1 comment · Fixed by #1530
Closed

${variant:targetVariant} is not expanded properly since v1.5 #1525

ghost opened this issue Nov 6, 2020 · 1 comment · Fixed by #1530
Labels
Feature: configure regression used to work and no longer does. Regressions are typically high priority
Milestone

Comments

@ghost
Copy link

ghost commented Nov 6, 2020

Brief Issue Summary

The following configuration (expansion) does not work anymore since v1.5
"cmake.buildDirectory": "${workspaceFolder}/build/${variant:targetVariant}/${buildKit}"

Expected:

  1. Configuration in settings.json:
"cmake.buildDirectory": "${workspaceFolder}/build/${variant:targetVariant}/${buildKit}"
[cmake] Not searching for unused variables given on the command line.
[cmake] CMake Error at /usr/local/lib/python3.6/dist-packages/cmake/data/share/cmake-3.18/Modules/CTestTargets.cmake:59 (add_custom_target):
[cmake]   Syntax error in cmake code when parsing string
[cmake] 
[cmake]     /workspace/build/${variant:targetVariant}/X86/CMakeFiles/Experimental
[cmake] 
[cmake]   Invalid character (':') in a variable name: 'variant'

and

targetVariant:
    default: 'Test1'
    choices:
        'Test1':
            short: 'Test1'
            long: 'Test1'
            settings:
                PROJECT: "Test1"
                DEBUG_ASSERT: "false"
        'Test2':
            short: 'Test2'
            long: 'Test2'
            settings:
                PROJECT: "Test2"
                DEBUG_ASSERT: "true"
buildType:
    default: Debug
    choices:
        Debug:
            short: Debug
            long: Debug
            buildType: Debug
  1. Configuration succeeds.

Apparent Behavior:

Configuration does not work.
${buildKit} is still correctly expanded, the variant unfortunately not.

CMake Tools Log

[main] Configuring folder: workspace 
[driver] Removing /workspace/build/${variant:targetVariant}/X86/CMakeCache.txt
[driver] Removing /workspace/build/${variant:targetVariant}/X86/CMakeFiles
[proc] Executing command: /usr/local/bin/cmake --no-warn-unused-cli -DPROJECT:STRING=Test1 -DDEBUG_ASSERT:STRING=false -DCMAKE_EXPORT_COMPILE_COMMANDS:BOOL=TRUE -DCMAKE_BUILD_TYPE:STRING=Debug -DCMAKE_TOOLCHAIN_FILE:FILEPATH=/workspace/Configuration/Unittest.cmake -H/workspace -B/workspace/build/${variant:targetVariant}/X86 -G Ninja
[cmake] Not searching for unused variables given on the command line.
[cmake] CMake Error at /usr/local/lib/python3.6/dist-packages/cmake/data/share/cmake-3.18/Modules/CTestTargets.cmake:59 (add_custom_target):
[cmake]   Syntax error in cmake code when parsing string
[cmake] 
[cmake]     /workspace/build/${variant:targetVariant}/X86/CMakeFiles/Experimental
[cmake] 
[cmake]   Invalid character (':') in a variable name: 'variant'
[cmake] Call Stack (most recent call first):
[cmake]   /usr/local/lib/python3.6/dist-packages/cmake/data/share/cmake-3.18/Modules/CTest.cmake:266 (include)
[cmake]   Configuration/Unittest.cmake:19 (include)
[cmake]   /usr/local/lib/python3.6/dist-packages/cmake/data/share/cmake-3.18/Modules/CMakeDetermineSystem.cmake:93 (include)
[cmake]   CMakeLists.txt:8 (project)
[cmake] 
[cmake] 
[cmake] CMake Error: CMake was unable to find a build program corresponding to "Ninja".  CMAKE_MAKE_PROGRAM is not set.  You probably need to select a different build tool.
[cmake] CMake Error: CMAKE_C_COMPILER not set, after EnableLanguage
[cmake] CMake Error: CMAKE_CXX_COMPILER not set, after EnableLanguage
[cmake] -- Configuring incomplete, errors occurred!

Platform and Versions

  • Operating System: Docker inside WSL2 using ubuntu 18.04 LTS
  • CMake version:3.18.2
  • VsCode Version:1.50.1
  • CMake Tools Extension Version: V1.5
  • Compiler:gcc (Ubuntu 9.3.0-11ubuntu0~18.04.1) 9.3.0

Other Notes/Information

This issue arises with the new version v1.5. Previous versions still work (since at least 05/2019).

@ghost ghost changed the title ${variant:targetVariant} is not expanded properly anymore ${variant:targetVariant} is not expanded properly since v1.5 Nov 6, 2020
@bobbrow
Copy link
Member

bobbrow commented Nov 6, 2020

Thank you for reporting this issue. We will investigate and try to get a patch out soon.

@bobbrow bobbrow added Feature: configure IMPORTANT regression used to work and no longer does. Regressions are typically high priority labels Nov 6, 2020
@bobbrow bobbrow added this to the 1.5.1 milestone Nov 6, 2020
@github-actions github-actions bot locked and limited conversation to collaborators Jan 29, 2022
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
Feature: configure regression used to work and no longer does. Regressions are typically high priority
Projects
None yet
Development

Successfully merging a pull request may close this issue.

1 participant