[Author Prev][Author Next][Thread Prev][Thread Next][Author Index][Thread Index]

[tor-commits] [tor-browser-bundle/master] Bug 20758: Make the gb build directory deterministic



commit 27cf6fc8837ab98cb702d8c4db093e7b8f9d1c07
Author: Georg Koppen <gk@xxxxxxxxxxxxxx>
Date:   Tue Dec 6 21:38:57 2016 +0000

    Bug 20758: Make the gb build directory deterministic
    
    The build directory `gb` uses is created with `ioutil.TempDir()` which
    results in a different one for every started build with high
    probability. We make it deterministic with this commit.
---
 gitian/descriptors/linux/gitian-sandbox.yml |  2 ++
 gitian/patches/gb-build-dir.patch           | 31 +++++++++++++++++++++++++++++
 gitian/versions.nightly                     |  4 ++--
 3 files changed, 35 insertions(+), 2 deletions(-)

diff --git a/gitian/descriptors/linux/gitian-sandbox.yml b/gitian/descriptors/linux/gitian-sandbox.yml
index 0f4f78c..0c67126 100644
--- a/gitian/descriptors/linux/gitian-sandbox.yml
+++ b/gitian/descriptors/linux/gitian-sandbox.yml
@@ -29,6 +29,7 @@ files:
 - "go-linux32-utils.zip"
 - "go-linux64-utils.zip"
 - "dzip.sh"
+- "gb-build-dir.patch"
 script: |
   INSTDIR="$HOME/install"
   mkdir $INSTDIR/sandbox
@@ -59,6 +60,7 @@ script: |
 
   # Building gb
   cd gb
+  patch -p1 < ../gb-build-dir.patch
   find -type f -print0 | xargs -0 touch --date="$REFERENCE_DATETIME"
   mkdir -p "$GOPATH/src/github.com/constabulary/"
   ln -sf "$PWD" "$GOPATH/src/github.com/constabulary/gb"
diff --git a/gitian/patches/gb-build-dir.patch b/gitian/patches/gb-build-dir.patch
new file mode 100644
index 0000000..a52ca69
--- /dev/null
+++ b/gitian/patches/gb-build-dir.patch
@@ -0,0 +1,31 @@
+From a7b198e3a32509197150d7c2767262a7319ff339 Mon Sep 17 00:00:00 2001
+From: Georg Koppen <gk@xxxxxxxxxxxxxx>
+Date: Tue, 6 Dec 2016 21:34:16 +0000
+Subject: [PATCH] Make the gb build directory deterministic
+
+
+diff --git a/context.go b/context.go
+index 53c00da..d040082 100644
+--- a/context.go
++++ b/context.go
+@@ -3,7 +3,6 @@ package gb
+ import (
+ 	"fmt"
+ 	"io"
+-	"io/ioutil"
+ 	"os"
+ 	"os/exec"
+ 	"path/filepath"
+@@ -136,7 +135,8 @@ func NewContext(p Project, opts ...func(*Context) error) (*Context, error) {
+ 		},
+ 		GcToolchain(),
+ 	}
+-	workdir, err := ioutil.TempDir("", "gb")
++	workdir := filepath.Join(os.TempDir(), "gb")
++	err := os.Mkdir(workdir, 0777)
+ 	if err != nil {
+ 		return nil, err
+ 	}
+-- 
+2.10.2
+
diff --git a/gitian/versions.nightly b/gitian/versions.nightly
index 304284d..2df094b 100755
--- a/gitian/versions.nightly
+++ b/gitian/versions.nightly
@@ -48,8 +48,8 @@ GO_X_CRYPTO_TAG=master
 GO_X_NET_TAG=master
 OBFS4_TAG=master
 NOTOFONTS_TAG=720e34851382ee3c1ef024d8dffb68ffbfb234c2
-ERRORS_TAG=master
-GB_TAG=master
+ERRORS_TAG=248dadf4e9068a0b3e79f02ed0a610d935de5302
+GB_TAG=06cc925cce6592e922dcc4839a8b44feb384e71e
 SANDBOX_TAG=master
 
 GITIAN_TAG=tor-browser-builder-4

_______________________________________________
tor-commits mailing list
tor-commits@xxxxxxxxxxxxxxxxxxxx
https://lists.torproject.org/cgi-bin/mailman/listinfo/tor-commits