You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@buildstream.apache.org by GitBox <gi...@apache.org> on 2021/02/19 08:36:44 UTC
[GitHub] [buildstream] gtristan commented on a change in pull request #1440: _context.py: make directories in the configuration absolute
gtristan commented on a change in pull request #1440:
URL: https://github.com/apache/buildstream/pull/1440#discussion_r579012757
##########
File path: src/buildstream/_context.py
##########
@@ -282,6 +282,7 @@ def load(self, config=None):
path = os.path.expanduser(path)
path = os.path.expandvars(path)
path = os.path.normpath(path)
+ path = os.path.abspath(path)
Review comment:
I am also reluctant to allow relative paths in user configuration.
In the case that user configuration is used to store user preferences, having BuildStream behave differently depending on what your CWD might be at the time of invocation is undesirable, I much prefer it be impossible for the user to accidentally hurt themselves in this way.
If the user configuration is ephemeral, e.g. it is automatically generated as a part of some CI, then it will be fine to feed in full paths anyway.
Further, @juergbi points out the possibility of using `XDG_CACHE_HOME` instead of the user config to relocate the directories, but I should also point out that the directories in user config will expand any environment variables (so you can even specify your own custom env vars to control these).
----------------------------------------------------------------
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.
For queries about this service, please contact Infrastructure at:
users@infra.apache.org