diff options
author | Ankit Jain <radical@gmail.com> | 2018-06-16 01:42:45 +0300 |
---|---|---|
committer | Alexander Köplinger <alex.koeplinger@outlook.com> | 2018-06-16 01:42:45 +0300 |
commit | c47d9ace7b9178b39f5bd83d0d3ba2d8b4f70a3c (patch) | |
tree | 3c1ac7d66b47780bd44d2163336c95a7cb825456 | |
parent | 3737ca0ec8ac23bbe8b6cbc30a1da0797e977f78 (diff) |
Environment.set(key,val): Expand env vars in the value (#67)
Given,
env.set('XDG_CONFIG_HOME', '$HOME/.config')
.. then the value got exported as the literal string
`$HOME/.config`, with no shell expansion. And any subprocess would get
the unexpanded value for that env var.
So, we always shell expand the values now.
This broke msbuild build on jenkins, because of ..
bockbuild/unixprofile.py: self.env.set('XDG_CONFIG_HOME', '$HOME/.config')
.. and this being surfaced to nuget via mono's
`Environment.SpecialFolder.ApplicationData`. The nuget tasks treated the
`"$HOME/.config"` string as a relative path, causing build breakage.
For reference: https://github.com/mono/mono/pull/9112#issuecomment-397138139
-rw-r--r-- | bockbuild/environment.py | 2 |
1 files changed, 1 insertions, 1 deletions
diff --git a/bockbuild/environment.py b/bockbuild/environment.py index f854d12..4d1f9ff 100644 --- a/bockbuild/environment.py +++ b/bockbuild/environment.py @@ -12,7 +12,7 @@ class EnvironmentItem: self.values = values def __str__(self): - return self.joinchar.join(self.values) + return os.path.expandvars(self.joinchar.join(self.values)) class Environment: |