[tor-commits] [tor-browser-build/master] Bug 23425: fix build when there is no terminal

gk at torproject.org gk at torproject.org
Fri Sep 8 07:00:43 UTC 2017


commit e21581e108a44915c0bd0f2acd346b02288a52a0
Author: Nicolas Vigier <boklm at torproject.org>
Date:   Thu Sep 7 16:58:01 2017 +0200

    Bug 23425: fix build when there is no terminal
    
    Set process.terminal to false when building, but keep it to true when we
    open a debugging shell.
    
    https://github.com/opencontainers/runtime-spec/blob/master/config.md#process
    
    To do that we update the runc config.json in runc/remote_exec rather
    than only once in runc/remote_start.
    
    We also redirect runc stderr to /dev/null to avoid some messages saying
    "stdin: is not a tty" during the build.
---
 projects/common/runc-config.json | 2 +-
 rbm.conf                         | 8 ++++----
 2 files changed, 5 insertions(+), 5 deletions(-)

diff --git a/projects/common/runc-config.json b/projects/common/runc-config.json
index 3da6c24..02be3b0 100644
--- a/projects/common/runc-config.json
+++ b/projects/common/runc-config.json
@@ -9,7 +9,7 @@
 [% END -%]
 	},
 	"process": {
-		"terminal": true,
+		"terminal": [% IF c("interactive") %]true[% ELSE %]false[% END %],
 		"user": {
 			"uid": 0,
 			"gid": 0
diff --git a/rbm.conf b/rbm.conf
index a93df7f..d574f7a 100644
--- a/rbm.conf
+++ b/rbm.conf
@@ -308,9 +308,6 @@ runc:
     fi
     mkdir -p '[% c("var/container/dir") %]'/rootfs/rbm
     sudo tar -C '[% c("var/container/dir") %]'/rootfs -xf $(ls -1 '[% c("remote_srcdir", { error_if_undef => 1 }) %]/container-image_'*)
-    cat > '[% c("var/container/dir") %]'/config.json << EOF
-    [% INCLUDE 'runc-config.json' %]
-    EOF
     [% SET user = c("var/container/user") -%]
     [% c("remote_exec", { exec_as_root => 1, exec_cmd => 'id ' _ user
         _ ' >/dev/null 2>&1 || adduser -m ' _ user _ ' || useradd -m ' _ user }) %]
@@ -329,7 +326,10 @@ runc:
     echo 'su - [% user %] -c /rbm/cmd' >> '[% c("var/container/dir") %]'/rootfs/rbm/run
     chmod +x '[% c("var/container/dir") %]'/rootfs/rbm/cmd
     chmod +x '[% c("var/container/dir") %]'/rootfs/rbm/run
-    sudo runc start -b '[% c("var/container/dir") %]' rbm-[% sha256(c("build_id", { error_if_undef => 1 })) %]
+    cat > '[% c("var/container/dir") %]'/config.json << EOF
+    [% INCLUDE 'runc-config.json' %]
+    EOF
+    sudo runc start -b '[% c("var/container/dir") %]' rbm-[% sha256(c("build_id", { error_if_undef => 1 })) %] [% IF ! c("interactive") %]2>/dev/null[% END %]
 
   remote_put: |
     #!/bin/sh



More information about the tor-commits mailing list