-
Notifications
You must be signed in to change notification settings - Fork 2.6k
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
CMake cmakeArgs does not evaluate environment variables #12848
Comments
Hello, @Lectem! Thanks for your report! Could you please try to use macro syntax to reference EMSCRIPTEN variable in 'cmakeArgs' by wrapping the variable in parentheses like this?
Please, let us know if it helps. You may also find more information about variables here: |
Yes I tried this too and it gave me the following:
I think it can probably be easily reproduced with any CMake variable and a small CMakeLists.txt cmake_minimum_required(VERSION 3.14)
message(STATUS "Value of TEST_CMAKE_TASK is: ${TEST_CMAKE_TASK}") and something using an env var such as steps:
- script: cmake -B build-script -DTEST_CMAKE_TASK=$USER
- task: CMake@1
inputs:
workingDirectory: build-task
cmakeArgs: -DTEST_CMAKE_TASK=$USER .. (I do not have time to test this right now, but it should help reproduce the issue) |
Closing the issue since changes should be deployed now. Please feel free to reopen. |
I'm not sure if this is the same issue, but I'm trying to set a package location from a previous stage in UCL/PETPVC#84. Actual code is like this
I checked that Any ideas? Edit:
If this should work, it'd be great to see an example. Thanks for your help! |
Question, Bug, or Feature?
Type: Bug
Enter Task Name:
CMake
Environment
Server - Azure Pipelines
Agent - Private:
Agent name: 'Hosted Agent'
Agent machine name: 'fv-az598'
Current agent version: '2.166.4'
Current image version: '20200430.2'
Agent running as: 'vsts'
Prepare build directory.
Set build variables.
Download all required tasks.
Downloading task: CmdLine (2.164.0)
Downloading task: CMake (1.166.0)
OS: ubuntu
Issue Description
When using environment variables in the
cmakeArgs
parameter, the environment variables are not evaluated anymore.For example, with the EMSCRIPTEN environment variable set in the image:
The first script works fine, but the one with the task will give the error
We can see that CMake receives the string with $EMSCRIPTEN instead of its value.
Multiple possibilities:
The text was updated successfully, but these errors were encountered: