mirror of
https://github.com/NixOS/nix
synced 2025-06-27 00:11:17 +02:00
Treat empty env var paths as unset
We make sure the env var paths are actually set (ie. not "") before sending them to the canonicalization function. If we forget to do so, the user will end up facing a puzzled failed assertion internal error. We issue a non-failing warning as a stop-gap measure. We could want to revisit this to issue a detailed failing error message in the future.
This commit is contained in:
parent
4489def1b3
commit
25300c0ecd
4 changed files with 24 additions and 8 deletions
|
@ -39,6 +39,10 @@ extern const std::string nativeSystem;
|
|||
/* Return an environment variable. */
|
||||
std::optional<std::string> getEnv(const std::string & key);
|
||||
|
||||
/* Return a non empty environment variable. Returns nullopt if the env
|
||||
variable is set to "" */
|
||||
std::optional<std::string> getEnvNonEmpty(const std::string & key);
|
||||
|
||||
/* Get the entire environment. */
|
||||
std::map<std::string, std::string> getEnv();
|
||||
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue