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.

Passing non existing environmental variable to executable weird behaviour

See original GitHub issue

When setting defaultEnv property with os_env that doesn’t exist, the environment variable will still be created, with not resolved string value.

For example

"catch2TestExplorer.defaultEnv": {
	"VAR_DOESNT_EXIST": "${os_env:VAR_DOESNT_EXIST}"
}

The literal resulting value passed to the executable would be VAR_DOESNT_EXIST == "${os_env:VAR_DOESNT_EXIST}".

Issue Analytics

  • State:closed
  • Created 4 years ago
  • Comments:8 (5 by maintainers)

github_iconTop GitHub Comments

1reaction
matepekcommented, Aug 14, 2019

I can see it is more logical in your case… But … considering

  • "PATH": "${os_env:PATH}:${os_env:EXTEND_PATH_WITH_THIS}"
  • "EXTENDED_VAR": "${os_env:SIMPLE_VAR} is extended with something".

In these cases I cannot unset PATH. Just wanted to say it is not trivial…

0reactions
matepekcommented, Aug 25, 2019

Note: new var is added @{os_env_strict:...}.

Read more comments on GitHub >

github_iconTop Results From Across the Web

tasks.options.env` do not overwrite existing environment ...
However, if an environment variable is pre-existing, it will not be overwritten in the execution environment of the task. I am extremely ...
Read more >
environment variables - strange behavior of 'echo' in 'env' bash
It interprets env as a command name and xxx=23 , echo , and $xxx as three arguments which will be passed to the...
Read more >
CMake + Tests: Environment variables ignored
I have some tests in a CMake project that depend on a DLL to run. To ensure the DLL is found I change...
Read more >
Docker-compose not seeing environment variables on the host
I figured it out, I'm posting this in case someone might need it. My problem was that the environment variables are not preserved...
Read more >
Here's how you can actually use Node environment variables
Here's how you can actually use Node environment variables · Pass it in the terminal · Use a .env file · Working with...
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