[tor-commits] [tor-browser-build/master] Revert "Merge remote-tracking branch 'dcf/bug_27827'"

gk at torproject.org gk at torproject.org
Fri Oct 19 11:00:04 UTC 2018


commit 4ae6ba4f9d62113a818e706f63a8c3fb9c011e06
Author: Georg Koppen <gk at torproject.org>
Date:   Fri Oct 19 10:55:55 2018 +0000

    Revert "Merge remote-tracking branch 'dcf/bug_27827'"
    
    This reverts commit 889be4318d80f11f2b5b2b845ab11868149c48f1, reversing
    changes made to d8ce7fca64a15cf9b71f7685ef2a8f36dae6a21a.
    
    The patch for bug 27827 leads to a busted Linux build.
---
 projects/go/config       |  4 ++--
 projects/snowflake/build | 27 +++++++++++++++++++++++----
 2 files changed, 25 insertions(+), 6 deletions(-)

diff --git a/projects/go/config b/projects/go/config
index 1841705..2a3b1ad 100644
--- a/projects/go/config
+++ b/projects/go/config
@@ -1,5 +1,5 @@
 # vim: filetype=yaml sw=2
-version: 1.11.1
+version: 1.8.3
 filename: '[% project %]-[% c("version") %]-[% c("var/build_id") %].tar.gz'
 
 var:
@@ -84,7 +84,7 @@ input_files:
     enable: '[% c("var/windows") || c("var/osx") %]'
   - URL: 'https://golang.org/dl/go[% c("version") %].src.tar.gz'
     name: go
-    sha256sum: 558f8c169ae215e25b81421596e8de7572bd3ba824b79add22fba6e284db1117
+    sha256sum: 5f5dea2447e7dcfdc50fa6b94c512e58bfba5673c039259fd843f68829d99fa6
   - URL: 'https://golang.org/dl/go[% c("var/go14_version") %].src.tar.gz'
     name: go14
     sha256sum: 9947fc705b0b841b5938c48b22dc33e9647ec0752bae66e50278df4f23f64959
diff --git a/projects/snowflake/build b/projects/snowflake/build
index a66a1e9..f3616f4 100644
--- a/projects/snowflake/build
+++ b/projects/snowflake/build
@@ -30,13 +30,32 @@ cd client
 [% IF c("var/osx") -%]
   # Without faketime, snowflake-client would contain the timestamp of the
   # temporary client.a file created during "go build".
-  # The -tmpdir flag overrides what would otherwise be a randomly generated
-  # path, /tmp/go-link-RANDOMNUM/go.o.
-  mkdir -p /var/tmp/go-link.tmpdir
-  [% c("var/faketime") %] go build -ldflags '-s -tmpdir /var/tmp/go-link.tmpdir'
+  [% c("var/faketime") %] go build -ldflags '-s'
 [% ELSE -%]
   go build -ldflags '-s'
 [% END -%]
+[% IF c("var/osx") -%]
+  # Hack: Overwrite variable absolute paths embedded in the binary. clang 3.8.0
+  # on Darwin embeds such paths and the issue is unsolved in upstream Go as of
+  # 2016-06-28:
+  # https://github.com/golang/go/issues/9206#issuecomment-310476743
+  # The two kinds of paths are ("000000000" stands for 9 random digits):
+  #   /tmp/go-build000000000
+  #   /tmp/go-link-000000000
+  # Such paths are the output of ioutil.TempDir("", "go-build") and
+  # ioutil.TempDir("", "go-link-").
+  cp -a client client.stomped
+  sed -i -E -e 's#(/tmp/go-build|/tmp/go-link-)[0-9]{9}/#\1XXXXXXXXX/#g' client.stomped
+  # Sanity check: make sure the file actually changed. If it did not, it could
+  # mean that a change in go or clang has made this step unnecessary.
+  if cmp client client.stomped
+  then
+    echo "No paths replaced in snowflake-client. Maybe the replacement failed or is no longer needed."
+    echo "Check projects/snowflake/build"
+    exit 1
+  fi
+  mv -f client.stomped client
+[% END -%]
 cp -a client[% IF c("var/windows") %].exe[% END %] $PTDIR/snowflake-client[% IF c("var/windows") %].exe[% END %]
 
 cd ..





More information about the tor-commits mailing list