summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorChandan Singh <chandan@chandansingh.net>2019-07-18 22:45:34 +0100
committerChandan Singh <chandan@chandansingh.net>2019-07-18 22:45:34 +0100
commite1658f6bb67fae4fe69e426b816f230328d99fa0 (patch)
treee2667a12b4f5cd6490e05c050246ef0cbd8a74a8
parent93ad9d47bdea437356c64d3a63dc4b25d1cde3c5 (diff)
downloadbuildstream-chandan/fix-source-checkout-1083.tar.gz
stream.py: Don't checkout sources in the parent of the locationchandan/fix-source-checkout-1083
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.py3
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: