summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorBenjamin Schubert <bschubert15@bloomberg.net>2020-09-29 21:15:35 +0000
committerBenjamin Schubert <bschubert15@bloomberg.net>2020-12-01 10:57:53 +0000
commit11b2aa717718b315d005ab5b29b56ec521424528 (patch)
tree6e86b386b643b5e374f98cba3b21c74135d378d1
parentc7fc96494d6e268a6a48e0ff68c35763200d5d77 (diff)
downloadbuildstream-11b2aa717718b315d005ab5b29b56ec521424528.tar.gz
element.py: Stop setting a deterministic umask for staging sources
This does not behaves as we would expect, as it is not always consistent, and doesn't have any impact in most cases. We should revisit our handling of permissions and umasks separately, in the meantime, this is required in order to fix building with a threaded scheduler, as it would otherwise introduce concurrency errors
-rw-r--r--src/buildstream/element.py11
-rw-r--r--src/buildstream/utils.py15
2 files changed, 2 insertions, 24 deletions
diff --git a/src/buildstream/element.py b/src/buildstream/element.py
index ac16e3103..b6b4b801c 100644
--- a/src/buildstream/element.py
+++ b/src/buildstream/element.py
@@ -1497,15 +1497,9 @@ class Element(Plugin):
#
def _stage_sources_at(self, vdirectory, usebuildtree=False):
- context = self._get_context()
-
# It's advantageous to have this temporary directory on
# the same file system as the rest of our cache.
- with self.timed_activity("Staging sources", silent_nested=True), utils._tempdir(
- dir=context.tmpdir, prefix="staging-temp"
- ) as temp_staging_directory:
-
- import_dir = temp_staging_directory
+ with self.timed_activity("Staging sources", silent_nested=True):
if not isinstance(vdirectory, Directory):
vdirectory = FileBasedDirectory(vdirectory)
@@ -1534,8 +1528,7 @@ class Element(Plugin):
import_dir = staged_sources
# Set update_mtime to ensure deterministic mtime of sources at build time
- with utils._deterministic_umask():
- vdirectory.import_files(import_dir, update_mtime=BST_ARBITRARY_TIMESTAMP)
+ vdirectory.import_files(import_dir, update_mtime=BST_ARBITRARY_TIMESTAMP)
# Ensure deterministic owners of sources at build time
vdirectory.set_deterministic_user()
diff --git a/src/buildstream/utils.py b/src/buildstream/utils.py
index 4eb62d988..956ad1d65 100644
--- a/src/buildstream/utils.py
+++ b/src/buildstream/utils.py
@@ -1563,21 +1563,6 @@ def _search_upward_for_files(directory, filenames):
directory = parent_dir
-# _deterministic_umask()
-#
-# Context managed to apply a umask to a section that may be affected by a users
-# umask. Restores old mask afterwards.
-#
-@contextmanager
-def _deterministic_umask():
- old_umask = os.umask(0o022)
-
- try:
- yield
- finally:
- os.umask(old_umask)
-
-
# _get_compression:
#
# Given a file name infer the compression