[tor-commits] [tor-browser-bundle/hardened-builds] Bug 19528: run get-moz-build-date before removing .git (fixup)

gk at torproject.org gk at torproject.org
Wed Sep 14 18:39:35 UTC 2016


commit b79f5d274b2093758af6cf9a2076224c40295b1d
Author: Nicolas Vigier <boklm at torproject.org>
Date:   Wed Sep 14 17:11:38 2016 +0200

    Bug 19528: run get-moz-build-date before removing .git (fixup)
    
    Additionally, we make get-moz-build-date fail with an error if it was not
    possible to get the year from git.
---
 gitian/build-helpers/get-moz-build-date       | 5 +++++
 gitian/descriptors/linux/gitian-firefox.yml   | 3 ++-
 gitian/descriptors/mac/gitian-firefox.yml     | 3 ++-
 gitian/descriptors/windows/gitian-firefox.yml | 3 ++-
 4 files changed, 11 insertions(+), 3 deletions(-)

diff --git a/gitian/build-helpers/get-moz-build-date b/gitian/build-helpers/get-moz-build-date
index 168a8c7..3dae232 100755
--- a/gitian/build-helpers/get-moz-build-date
+++ b/gitian/build-helpers/get-moz-build-date
@@ -4,6 +4,11 @@
 use strict;
 
 my ($year) = split('-', `git show -s --format='%ci'`);
+if ($? != 0) {
+    print STDERR "Failed to get year from the git commit\n";
+    print "exit 1\n";
+    exit 1;
+}
 
 die "missing argument" unless @ARGV;
 my $version = $ARGV[0];
diff --git a/gitian/descriptors/linux/gitian-firefox.yml b/gitian/descriptors/linux/gitian-firefox.yml
index 89f68fa..dc02cba 100644
--- a/gitian/descriptors/linux/gitian-firefox.yml
+++ b/gitian/descriptors/linux/gitian-firefox.yml
@@ -85,6 +85,8 @@ script: |
 
   cd tor-browser
   mv .mozconfig-asan .mozconfig
+  # run get-moz-build-date before removing .git, which is used to get the year
+  eval $(~/build/get-moz-build-date $(cat browser/config/version.txt))
   # .git and the src takes up a lot of useless space, and we need the space to build
   rm -rf .git
   find -type f -print0 | xargs -0 touch --date="$REFERENCE_DATETIME"
@@ -93,7 +95,6 @@ script: |
   # Self-Rando wrapper
   export PATH="$HOME/build/selfrando/Tools/TorBrowser/tc-wrapper/:$PATH"
   export SELFRANDO_skip_shuffle=
-  eval $(~/build/get-moz-build-date $(cat browser/config/version.txt))
   make -f client.mk configure CONFIGURE_ARGS="--with-tor-browser-version=${TORBROWSER_VERSION} --enable-update-channel=${TORBROWSER_UPDATE_CHANNEL} --enable-bundled-fonts"
   find -type f -print0 | xargs -0 touch --date="$REFERENCE_DATETIME"
   # Without disabling LSan our build is blowing up:
diff --git a/gitian/descriptors/mac/gitian-firefox.yml b/gitian/descriptors/mac/gitian-firefox.yml
index fea3139..7a852c4 100644
--- a/gitian/descriptors/mac/gitian-firefox.yml
+++ b/gitian/descriptors/mac/gitian-firefox.yml
@@ -60,13 +60,14 @@ script: |
   TB_COMMIT_DATE=$(git show -s --format='%ci')
   COPYRIGHT_YEAR=${TB_COMMIT_DATE%%-*}
   mv .mozconfig-mac .mozconfig
+  # run get-moz-build-date before removing .git, which is used to get the year
+  eval $(~/build/get-moz-build-date $(cat browser/config/version.txt))
   # .git and the src takes up a lot of useless space, and we need the space to build
   #git archive HEAD | tar -x -C $OUTDIR/src
   rm -rf .git
   find -type f -print0 | xargs -0 touch --date="$REFERENCE_DATETIME"
   rm -f configure
   rm -f js/src/configure
-  eval $(~/build/get-moz-build-date $(cat browser/config/version.txt))
   make -f client.mk configure CONFIGURE_ARGS="--with-tor-browser-version=${TORBROWSER_VERSION} --enable-update-channel=${TORBROWSER_UPDATE_CHANNEL} --enable-bundled-fonts"
   find -type f -print0 | xargs -0 touch --date="$REFERENCE_DATETIME"
   make $MAKEOPTS -f client.mk build
diff --git a/gitian/descriptors/windows/gitian-firefox.yml b/gitian/descriptors/windows/gitian-firefox.yml
index 788b053..cc7fdeb 100644
--- a/gitian/descriptors/windows/gitian-firefox.yml
+++ b/gitian/descriptors/windows/gitian-firefox.yml
@@ -68,13 +68,14 @@ script: |
   # Our flags don't get passed to NSS. We need to do that manually using an
   # obscure one.
   export DLLFLAGS="-specs=/home/ubuntu/build/msvcr100.spec"
+  # run get-moz-build-date before removing .git, which is used to get the year
+  eval $(~/build/get-moz-build-date $(cat browser/config/version.txt))
   # .git and the src takes up a lot of useless space, and we need the space to build
   #git archive HEAD | tar -x -C $OUTDIR/src
   rm -rf .git
   find -type f -print0 | xargs -0 touch --date="$REFERENCE_DATETIME"
   rm -f configure
   rm -f js/src/configure
-  eval $(~/build/get-moz-build-date $(cat browser/config/version.txt))
   make -f client.mk configure CONFIGURE_ARGS="--with-tor-browser-version=${TORBROWSER_VERSION} --enable-update-channel=${TORBROWSER_UPDATE_CHANNEL} --enable-bundled-fonts"
   find -type f -print0 | xargs -0 touch --date="$REFERENCE_DATETIME"
   #



More information about the tor-commits mailing list