diff options
author | Chandan Singh <chandan@chandansingh.net> | 2019-07-18 22:45:34 +0100 |
---|---|---|
committer | Chandan Singh <chandan@chandansingh.net> | 2019-07-19 17:07:01 +0000 |
commit | c9e7114a0f3f7966038d25c9b3c3bb2b3a1bfe07 (patch) | |
tree | 48411b0a31ddf9f1dbf7fe412ea803c3811eecbc | |
parent | 52b54a65f0d78efe5c4bc446d8e7649d26ce0871 (diff) | |
download | buildstream-c9e7114a0f3f7966038d25c9b3c3bb2b3a1bfe07.tar.gz |
stream.py: Don't checkout sources in the parent of the location
It is incorrect to assume that BuildStream will have write access to the
parent directory of the specified destination. Instead of that, use the
temporary directory of the current context for checking out sources
temporarily.
Fixes #1083.
-rw-r--r-- | src/buildstream/_stream.py | 3 |
1 files changed, 1 insertions, 2 deletions
diff --git a/src/buildstream/_stream.py b/src/buildstream/_stream.py index bc0f55009..11ac53f3f 100644 --- a/src/buildstream/_stream.py +++ b/src/buildstream/_stream.py @@ -1366,12 +1366,11 @@ class Stream(): tar=False, include_build_scripts=False): location = os.path.abspath(location) - location_parent = os.path.abspath(os.path.join(location, "..")) # Stage all our sources in a temporary directory. The this # directory can be used to either construct a tarball or moved # to the final desired location. - temp_source_dir = tempfile.TemporaryDirectory(dir=location_parent) + temp_source_dir = tempfile.TemporaryDirectory(dir=self._context.tmpdir) try: self._write_element_sources(temp_source_dir.name, elements) if include_build_scripts: |