You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@buildstream.apache.org by ak...@apache.org on 2022/11/05 11:19:19 UTC

[buildstream] branch abderrahim/background created (now 66ec67cbc)

This is an automated email from the ASF dual-hosted git repository.

akitouni pushed a change to branch abderrahim/background
in repository https://gitbox.apache.org/repos/asf/buildstream.git


      at 66ec67cbc _sandboxbuildboxrun.py: Restore terminal after exit of interactive child

This branch includes the following new commits:

     new 891633f37 cascache.py: remove _cache_usage_monitor_forbidden
     new 66ec67cbc _sandboxbuildboxrun.py: Restore terminal after exit of interactive child

The 2 revisions listed above as "new" are entirely new to this
repository and will be described in separate emails.  The revisions
listed as "add" were already present in the repository and have only
been added to this reference.



[buildstream] 02/02: _sandboxbuildboxrun.py: Restore terminal after exit of interactive child

Posted by ak...@apache.org.
This is an automated email from the ASF dual-hosted git repository.

akitouni pushed a commit to branch abderrahim/background
in repository https://gitbox.apache.org/repos/asf/buildstream.git

commit 66ec67cbc5d9cee1673b3659a98cddae077eacb7
Author: Abderrahim Kitouni <ak...@gnome.org>
AuthorDate: Sat Nov 5 12:18:46 2022 +0100

    _sandboxbuildboxrun.py: Restore terminal after exit of interactive child
    
    This is a port of 8f401127c450ea1c2a1e2878d2ac28a7166d355c to the
    buildbox-run sandbox
    
    Fixes #1690
---
 src/buildstream/sandbox/_sandboxbuildboxrun.py | 12 ++++++++++++
 1 file changed, 12 insertions(+)

diff --git a/src/buildstream/sandbox/_sandboxbuildboxrun.py b/src/buildstream/sandbox/_sandboxbuildboxrun.py
index 1987ebac1..3a82e4d11 100644
--- a/src/buildstream/sandbox/_sandboxbuildboxrun.py
+++ b/src/buildstream/sandbox/_sandboxbuildboxrun.py
@@ -223,6 +223,18 @@ class SandboxBuildBoxRun(SandboxREAPI):
             except psutil.NoSuchProcess:
                 pass
 
+            if interactive:
+                # Make this process the foreground process again, otherwise the
+                # next read() on stdin will trigger SIGTTIN and stop the process.
+                # This is required because the sandboxed process does not have
+                # permission to do this on its own (running in separate PID namespace).
+                #
+                # tcsetpgrp() will trigger SIGTTOU when called from a background
+                # process, so ignore it temporarily.
+                handler = signal.signal(signal.SIGTTOU, signal.SIG_IGN)
+                os.tcsetpgrp(0, os.getpid())
+                signal.signal(signal.SIGTTOU, handler)
+
             if returncode != 0:
                 raise SandboxError("buildbox-run failed with returncode {}".format(returncode))
 


[buildstream] 01/02: cascache.py: remove _cache_usage_monitor_forbidden

Posted by ak...@apache.org.
This is an automated email from the ASF dual-hosted git repository.

akitouni pushed a commit to branch abderrahim/background
in repository https://gitbox.apache.org/repos/asf/buildstream.git

commit 891633f3723c927210742b87bfd8ef4b26b9a0ae
Author: Abderrahim Kitouni <ak...@gnome.org>
AuthorDate: Fri Dec 10 22:48:24 2021 +0100

    cascache.py: remove _cache_usage_monitor_forbidden
    
    This is a relic from the job pickling era
---
 src/buildstream/_cas/cascache.py | 2 --
 1 file changed, 2 deletions(-)

diff --git a/src/buildstream/_cas/cascache.py b/src/buildstream/_cas/cascache.py
index 42937c1d6..a489e6e6c 100644
--- a/src/buildstream/_cas/cascache.py
+++ b/src/buildstream/_cas/cascache.py
@@ -76,7 +76,6 @@ class CASCache:
         os.makedirs(self.tmpdir, exist_ok=True)
 
         self._cache_usage_monitor = None
-        self._cache_usage_monitor_forbidden = False
 
         self._remote_cache = bool(remote_cache_spec)
 
@@ -730,7 +729,6 @@ class CASCache:
     #     (CASCacheUsage): The current status
     #
     def get_cache_usage(self):
-        assert not self._cache_usage_monitor_forbidden
         return self._cache_usage_monitor.get_cache_usage()
 
     # get_casd_process_manager()