summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorBenjamin Schubert <contact@benschubert.me>2020-09-29 21:15:35 +0000
committerBenjamin Schubert <contact@benschubert.me>2020-10-06 19:06:07 +0000
commitc314d8a501c2b50088e9ecbd1c954460bf56844b (patch)
tree49d2efcabe8126d0720acab56fa1d3b467add2e1
parent85fd225f007d3f06000bd4af628272714cd572af (diff)
downloadbuildstream-c314d8a501c2b50088e9ecbd1c954460bf56844b.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 3df8894f0..5e5b69dc4 100644
--- a/src/buildstream/element.py
+++ b/src/buildstream/element.py
@@ -1512,15 +1512,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)
@@ -1549,8 +1543,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 1d1336cb4..036f44d36 100644
--- a/src/buildstream/utils.py
+++ b/src/buildstream/utils.py
@@ -1568,21 +1568,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