[tbb-commits] [tor-browser-bundle/master] Moving Go building into utils

gk at torproject.org gk at torproject.org
Wed Dec 7 05:39:38 UTC 2016


commit af596cb55dbcd300c989d02be7fffd1a16a7fb8a
Author: Georg Koppen <gk at torproject.org>
Date:   Wed Nov 23 13:26:45 2016 +0000

    Moving Go building into utils
---
 .../linux/gitian-pluggable-transports.yml          | 28 +++++-----------------
 gitian/descriptors/linux/gitian-utils.yml          | 24 +++++++++++++++++++
 gitian/mkbundle-linux.sh                           |  8 ++++++-
 3 files changed, 37 insertions(+), 23 deletions(-)

diff --git a/gitian/descriptors/linux/gitian-pluggable-transports.yml b/gitian/descriptors/linux/gitian-pluggable-transports.yml
index 38804dd..c790a9f 100644
--- a/gitian/descriptors/linux/gitian-pluggable-transports.yml
+++ b/gitian/descriptors/linux/gitian-pluggable-transports.yml
@@ -45,13 +45,13 @@ files:
 - "zope.interface.zip"
 - "twisted.tar.bz2"
 - "parsley.tar.gz"
-- "go14.tar.gz"
-- "go.tar.gz"
 - "dzip.sh"
 - "gmp-linux32-utils.zip"
 - "gmp-linux64-utils.zip"
 - "openssl-linux32-utils.zip"
 - "openssl-linux64-utils.zip"
+- "go-linux32-utils.zip"
+- "go-linux64-utils.zip"
 script: |
   INSTDIR="$HOME/install"
   PTDIR="$INSTDIR/Tor/PluggableTransports"
@@ -71,29 +71,13 @@ script: |
 
   unzip -d $INSTDIR gmp-linux$GBUILD_BITS-utils.zip
   unzip -d $INSTDIR openssl-linux$GBUILD_BITS-utils.zip
+  unzip -d $INSTDIR go-linux$GBUILD_BITS-utils.zip
+  export GOROOT="$INSTDIR/go"
+  export GOPATH="$HOME/go"
+  export PATH="$PATH:$GOROOT/bin"
   # FTE only needs libgmp.so.10 and no libgmpxx anymore.
   cp $INSTDIR/gmp/lib/libgmp.so.10 $INSTDIR/Tor
 
-  # Building go 1.4.x
-  # This is needed to bootstrap the go that we actually use
-  # https://golang.org/doc/install/source#go14
-  tar xvf go14.tar.gz --transform='s,^go\>,go1.4,'
-  cd go1.4/src
-  # Disable cgo to avoid conflicts with newer GCC. cgo is not needed for the bootstrap go.
-  # https://github.com/golang/go/issues/13114#issuecomment-186922245
-  CGO_ENABLED=0 ./make.bash
-  cd ../..
-  export GOROOT_BOOTSTRAP="$PWD/go1.4"
-
-  # Building go
-  # http://golang.org/doc/install/source#environment
-  export GOPATH="$HOME/go"
-  tar xvf go.tar.gz
-  cd go/src
-  ./make.bash
-  cd ../..
-  export PATH="$PATH:$PWD/go/bin"
-
   # Building pyptlib
   cd pyptlib
   find -type f -print0 | xargs -0 touch --date="$REFERENCE_DATETIME"
diff --git a/gitian/descriptors/linux/gitian-utils.yml b/gitian/descriptors/linux/gitian-utils.yml
index 7093a0d..b5246f4 100644
--- a/gitian/descriptors/linux/gitian-utils.yml
+++ b/gitian/descriptors/linux/gitian-utils.yml
@@ -33,6 +33,8 @@ files:
 - "gcc.tar.bz2"
 - "openssl.tar.gz"
 - "gmp.tar.bz2"
+- "go14.tar.gz"
+- "go.tar.gz"
 - "versions"
 - "dzip.sh"
 script: |
@@ -122,6 +124,27 @@ script: |
   make install
   cd ..
 
+  # Building go 1.4.x
+  # This is needed to bootstrap the go that we actually use
+  # https://golang.org/doc/install/source#go14
+  tar xvf go14.tar.gz --transform='s,^go\>,go1.4,'
+  cd go1.4/src
+  # Disable cgo to avoid conflicts with newer GCC. cgo is not needed for the bootstrap go.
+  # https://github.com/golang/go/issues/13114#issuecomment-186922245
+  CGO_ENABLED=0 ./make.bash
+  cd ../..
+  export GOROOT_BOOTSTRAP="$PWD/go1.4"
+
+  # Building go
+  # http://golang.org/doc/install/source#environment
+  export GOROOT="$INSTDIR/go"
+  tar xvf go.tar.gz
+  cd go/src
+  ./make.bash
+  cd ../..
+  # Let's get it zipped up.
+  mv go $INSTDIR
+
   # Grabbing the remaining results and making sure timestamps don't spoil them
   # Since we stopped using libfaketime, the binutils, gcc, openssl,
   # libevent archives are no longer reproducible. The main reason
@@ -133,4 +156,5 @@ script: |
   ~/build/dzip.sh openssl-$OPENSSL_VER-linux$GBUILD_BITS-utils.zip openssl
   ~/build/dzip.sh libevent-${LIBEVENT_TAG#release-}-linux$GBUILD_BITS-utils.zip libevent
   ~/build/dzip.sh gmp-$GMP_VER-linux$GBUILD_BITS-utils.zip gmp
+  ~/build/dzip.sh go-$GO_VER-linux$GBUILD_BITS-utils.zip go
   cp *utils.zip $OUTDIR/
diff --git a/gitian/mkbundle-linux.sh b/gitian/mkbundle-linux.sh
index 430b666..156d2ba 100755
--- a/gitian/mkbundle-linux.sh
+++ b/gitian/mkbundle-linux.sh
@@ -110,7 +110,9 @@ if [ ! -f inputs/binutils-$BINUTILS_VER-linux32-utils.zip -o \
      ! -f inputs/libevent-${LIBEVENT_TAG_ORIG#release-}-linux32-utils.zip -o \
      ! -f inputs/libevent-${LIBEVENT_TAG_ORIG#release-}-linux64-utils.zip -o \
      ! -f inputs/gmp-$GMP_VER-linux32-utils.zip -o \
-     ! -f inputs/gmp-$GMP_VER-linux64-utils.zip ];
+     ! -f inputs/gmp-$GMP_VER-linux64-utils.zip -o \
+     ! -f inputs/go-$GO_VER-linux32-utils.zip -o \
+     ! -f inputs/go-$GO_VER-linux64-utils.zip ];
 then
   echo
   echo "****** Starting Utilities Component of Linux Bundle (1/6 for Linux) ******"
@@ -135,6 +137,8 @@ then
   ln -sf libevent-${LIBEVENT_TAG_ORIG#release-}-linux64-utils.zip libevent-linux64-utils.zip
   ln -sf gmp-$GMP_VER-linux32-utils.zip gmp-linux32-utils.zip
   ln -sf gmp-$GMP_VER-linux64-utils.zip gmp-linux64-utils.zip
+  ln -sf go-$GO_VER-linux32-utils.zip go-linux32-utils.zip
+  ln -sf go-$GO_VER-linux64-utils.zip go-linux64-utils.zip
   cd ..
   #cp -a result/utils-linux-res.yml inputs/
 else
@@ -154,6 +158,8 @@ else
   ln -sf libevent-${LIBEVENT_TAG_ORIG#release-}-linux64-utils.zip libevent-linux64-utils.zip
   ln -sf gmp-$GMP_VER-linux32-utils.zip gmp-linux32-utils.zip
   ln -sf gmp-$GMP_VER-linux64-utils.zip gmp-linux64-utils.zip
+  ln -sf go-$GO_VER-linux32-utils.zip go-linux32-utils.zip
+  ln -sf go-$GO_VER-linux64-utils.zip go-linux64-utils.zip
   cd ..
 fi
 



More information about the tbb-commits mailing list