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:41 UTC

[buildstream] branch abderrahim/background updated (66ec67cbc -> 7393276c5)

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


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

This update added new revisions after undoing existing revisions.
That is to say, some revisions that were in the old version of the
branch are not in the new version.  This situation occurs
when a user --force pushes a change and generates a repository
containing something like this:

 * -- * -- B -- O -- O -- O   (66ec67cbc)
            \
             N -- N -- N   refs/heads/abderrahim/background (7393276c5)

You should already have received notification emails for all of the O
revisions, and so the following emails describe only the N revisions
from the common base, B.

Any revisions marked "omit" are not gone; other references still
refer to them.  Any revisions marked "discard" are gone forever.

The 1 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.


Summary of changes:
 src/buildstream/_cas/cascache.py | 2 ++
 1 file changed, 2 insertions(+)


[buildstream] 01/01: _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 7393276c5c024aec942541b463723bca19004b95
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))