question-mark
Stuck on an issue?

Lightrun Answers was designed to reduce the constant googling that comes with debugging 3rd party libraries. It collects links to all the places you might be looking at while hunting down a tough bug.

And, if you’re still stuck at the end, we’re happy to hop on a call to see how we can help out.

Substitution of environment variables seems not to work

See original GitHub issue

Brief Issue Summary

substitution of environment variables seems not to work in cmake.configureSettings on Windows.

    "cmake.configureSettings": {
        "CMAKE_MODULE_PATH" : "${env:SOME_VAR}/utils",
    }

When i run the configure process the environment variable is not being substituted. I can check this in the CmakeCache.

Expected:

I would expect that environment variables are substituted. But this is not happening.

Apparent Behavior:

It appears that just the the rest of the string is passed to the CmakeCache.txt. It just appears the string “/utils” However the substitution of build in variables works without any problem. For example:

    "cmake.configureSettings": {
        "CMAKE_MODULE_PATH" : "${workspaceRoot}/utils",
    }

CMake Tools Log

If my module path is not correct CMake will not find some included files thats all.

Platform and Versions

  • Operating System: Windows 10 Pro 1803
  • CMake Version: 3.11.0
  • VSCode Version: 1.25.1
  • CMake Tools Extension Version: 1.1.0
  • Compiler/Toolchain: arm-none-eabi-gcc

Issue Analytics

  • State:closed
  • Created 5 years ago
  • Comments:6 (3 by maintainers)

github_iconTop GitHub Comments

1reaction
hriekehofcommented, Jul 25, 2018

Thanks. I totally missed to say, that this extension is totally awesome 🥇

0reactions
nackdaicommented, Aug 23, 2019

I’m experiencing the same bug currently. The environment variable is getting replaced by nothing currently.

Operating System: Windows 10 Pro 1803 CMake Version: 3.14.0 VSCode Version: 1.33.1 CMake Tools Extension Version: 1.1.3 Compiler/Toolchain: clang 8.0.0 with VS 2019

Me too

OS: Ubuntu 18.04 LTS CMake: 3.10.2 cmake-tools: 1.1.3 vscode: 1.37.1

Read more comments on GitHub >

github_iconTop Results From Across the Web

Environment variable substitution doesn't work in docker ...
It just doesn't do arithmetic. You only get substitution, concatenation and the ${variable:-word} and ${variable:+word} formations.
Read more >
[SOLVED] [Ozone] Environment variable substitution not working
Hello, I am having trouble getting environment variable substitution working in my .jdebug file, when trying to substitute into a file path ...
Read more >
AE environment variable substitution - IBM
The substitution process looks first for AE environment variables, ... specify a default value to use if a variable is not found so...
Read more >
Using Python environments in VS Code
Note: Variable substitution is only supported in VS Code settings files, it will not work in .env environment files. By using an environment...
Read more >
Environment variables are not working at build time
Hello there, Substitute environment variables syntax isn't yet supported in our compose file. We re actively working on build time secrets, and ...
Read more >

github_iconTop Related Medium Post

No results found

github_iconTop Related StackOverflow Question

No results found

github_iconTroubleshoot Live Code

Lightrun enables developers to add logs, metrics and snapshots to live code - no restarts or redeploys required.
Start Free

github_iconTop Related Reddit Thread

No results found

github_iconTop Related Hackernoon Post

No results found

github_iconTop Related Tweet

No results found

github_iconTop Related Dev.to Post

No results found

github_iconTop Related Hashnode Post

No results found