Ticket #20023: 0002-Bug-20023-Upgrade-Go-to-1.7.3.patch

File 0002-Bug-20023-Upgrade-Go-to-1.7.3.patch, 8.8 KB (added by dcf, 3 years ago)
  • gitian/descriptors/mac/gitian-pluggable-transports.yml

    From 74d92d428d6d93eab1481ce59613639ed42d97ac Mon Sep 17 00:00:00 2001
    From: David Fifield <david@bamsoftware.com>
    Date: Sun, 10 Apr 2016 08:32:54 +0000
    Subject: [PATCH 2/2] Bug 20023: Upgrade Go to 1.7.3.
    
    Go 1.7 has a necessary fix for macOS Sierra that is not in Go 1.6.3 or
    earlier:
    https://github.com/golang/go/commit/2da5633eb9091608047881953f75b489a3134cdc
    meek was unstable on macOS Sierra when compiled with Go 1.4.3 or 1.6.3.
    Reported by tordevSZ0: https://bugs.torproject.org/20250.
    
    We need to use the Mac OS X 10.7 SDK (not 10.6) to build Go 1.7 and
    later:
    https://bugs.torproject.org/20023#comment:6
    
    We add -std=gnu99 to CFLAGS when building Go. A piece of new C code uses
    c99 features. Other code uses "asm", which requires gnu99.
    https://bugs.torproject.org/20023#comment:6
    https://trac.macports.org/ticket/52506
    
    We hack one of the source files with sed to remove -D__MAC_OS_X_VERSION_MAX_ALLOWED=1060,
    which otherwise causes the build to fail, thinking a couple of functions
    are unavailable.
    https://github.com/golang/go/issues/17732
    ---
     gitian/descriptors/mac/gitian-pluggable-transports.yml | 12 +++++++-----
     gitian/versions                                        |  4 ++--
     gitian/versions.alpha                                  |  4 ++--
     gitian/versions.beta                                   |  4 ++--
     gitian/versions.nightly                                |  4 ++--
     5 files changed, 15 insertions(+), 13 deletions(-)
    
    diff --git a/gitian/descriptors/mac/gitian-pluggable-transports.yml b/gitian/descriptors/mac/gitian-pluggable-transports.yml
    index 33b134e..519a3ee 100644
    a b files: 
    4848- "go14.tar.gz"
    4949- "go.tar.gz"
    5050- "apple-uni-sdk-10.6_20110407-0.flosoft1_i386.deb"
     51- "MacOSX10.7.sdk.tar.gz"
    5152- "multiarch-darwin11-cctools127.2-gcc42-5666.3-llvmgcc42-2336.1-Linux-120724.tar.xz"
    5253- "dzip.sh"
    5354- "gmp-mac64-utils.zip"
    script: | 
    8283  export PATH="/usr/sbin:/sbin:$PATH"
    8384  sudo dpkg -i *.deb
    8485  tar xaf multiarch-darwin*tar.xz
     86  # The 10.7 SDK is needed for Go: https://bugs.torproject.org/20023#comment:6
     87  tar xaf MacOSX10.7.sdk.tar.gz
    8588  export PATH="$PATH:$HOME/build/apple-osx/bin/"
    8689  if [ "z$INCLUDE_FTE" = "z1" ]; then
    8790    unzip -d $INSTDIR gmp-mac64-utils.zip
    script: | 
    99102  export CXX=$HOME/build/apple-osx/bin/i686-apple-darwin11-g++
    100103  # http://bugs.python.org/issue9437
    101104  export LDSHARED="$CC -pthread -shared"
    102   # XXX Clean up these flags?
    103   export CFLAGS="-m64 -I/usr/lib/apple/SDKs/MacOSX10.6.sdk/usr/include/ -I/usr/lib/gcc/i686-apple-darwin10/4.2.1/include/ -I.  -L/usr/lib/apple/SDKs/MacOSX10.6.sdk/usr/lib/ -L/usr/lib/apple/SDKs/MacOSX10.6.sdk/usr/lib/system/ -F/usr/lib/apple/SDKs/MacOSX10.6.sdk/System/Library/Frameworks -mmacosx-version-min=10.5 -L/usr/lib/apple/SDKs/MacOSX10.6.sdk/usr/lib/i686-apple-darwin10/4.2.1$FTE_EXTRA_CFLAGS"
    104   export CXXFLAGS="-m64 -I/usr/lib/apple/SDKs/MacOSX10.6.sdk/usr/include/ -I/usr/lib/gcc/i686-apple-darwin10/4.2.1/include/ -I.  -L/usr/lib/apple/SDKs/MacOSX10.6.sdk/usr/lib/ -L/usr/lib/apple/SDKs/MacOSX10.6.sdk/usr/lib/system/ -F/usr/lib/apple/SDKs/MacOSX10.6.sdk/System/Library/Frameworks -mmacosx-version-min=10.5 -L/usr/lib/apple/SDKs/MacOSX10.6.sdk/usr/lib/i686-apple-darwin10/4.2.1$FTE_EXTRA_CFLAGS"
    105   export LDFLAGS="-L/usr/lib/apple/SDKs/MacOSX10.6.sdk/usr/lib/ -L/usr/lib/apple/SDKs/MacOSX10.6.sdk/usr/lib/system/ -F/usr/lib/apple/SDKs/MacOSX10.6.sdk/System/Library/Frameworks -mmacosx-version-min=10.5"
    106105
    107106  # Building go 1.4.x
    108107  # This is needed to bootstrap the go that we actually use
    script: | 
    122121  # https://github.com/golang/go/issues/15457
    123122  CC_FOR_TARGET="$(pwd)/cc-for-target"
    124123  echo "#!/bin/sh" > "$CC_FOR_TARGET"
    125   echo "exec $CC $CFLAGS $LDFLAGS \"\$@\"" >> "$CC_FOR_TARGET"
     124  echo "exec $CC $CFLAGS $LDFLAGS -isysroot $HOME/build/MacOSX10.7.sdk -std=gnu99 \"\$@\"" >> "$CC_FOR_TARGET"
    126125  chmod +x "$CC_FOR_TARGET"
    127126  # http://golang.org/doc/install/source#environment
    128127  export GOPATH="$HOME/go"
    script: | 
    130129  export GOARCH=386
    131130  tar xvf go.tar.gz
    132131  cd go/src
     132  # Remove a preprocessor directive that causes problems when building with the 10.7 SDK.
     133  # https://github.com/golang/go/issues/17732
     134  sed -i -e '/^#cgo CFLAGS:/s/-D__MAC_OS_X_VERSION_MAX_ALLOWED=1060//' crypto/x509/root_cgo_darwin.go
    133135  CGO_ENABLED=1 CC_FOR_TARGET="$CC_FOR_TARGET" CC= CFLAGS= LDFLAGS= ./make.bash
    134136  cd ../..
    135137  export PATH="$PATH:$PWD/go/bin"
  • gitian/versions

    diff --git a/gitian/versions b/gitian/versions
    index dfcd675..64da546 100755
    a b SETUPTOOLS_VER=1.4 
    6262PARSLEY_VER=1.2
    6363# We need a Go 1.4 to bootstrap later versions; see https://golang.org/doc/install/source#go14
    6464GO14_VER=1.4.3
    65 GO_VER=1.6.3
     65GO_VER=1.7.3
    6666NSIS_VER=2.51
    6767
    6868## File names for the source packages
    PY2EXE_HASH=610a8800de3d973ed5ed4ac505ab42ad058add18a68609ac09e6cf3598ef056c 
    114114SETUPTOOLS_HASH=75d288687066ed124311d6ca5f40ffa92a0e81adcd7fff318c6e84082713cf39
    115115PARSLEY_HASH=50d30cee70770fd44db7cea421cb2fb75af247c3a1cd54885c06b30a7c85dd23
    116116GO14_HASH=9947fc705b0b841b5938c48b22dc33e9647ec0752bae66e50278df4f23f64959
    117 GO_HASH=6326aeed5f86cf18f16d6dc831405614f855e2d416a91fd3fdc334f772345b00
     117GO_HASH=79430a0027a09b0b3ad57e214c4c1acfdd7af290961dd08d322818895af1ef44
    118118NSIS_HASH=43d4c9209847e35eb6e2c7cd5a7586e1445374c056c2c7899e40a080e17a1be7
    119119NSIS_DEBIAN_HASH=1dee6957b4a4b8dfe69bcf28bc7f301a13b96b3fa5a394e36c8926ae781e774a
    120120GCC_HASH=b7dafdf89cbb0e20333dbf5b5349319ae06e3d1a30bf3515b5488f7e89dca5ad
  • gitian/versions.alpha

    diff --git a/gitian/versions.alpha b/gitian/versions.alpha
    index e60e314..c5c6479 100755
    a b SETUPTOOLS_VER=1.4 
    6262PARSLEY_VER=1.2
    6363# We need a Go 1.4 to bootstrap later versions; see https://golang.org/doc/install/source#go14
    6464GO14_VER=1.4.3
    65 GO_VER=1.6.3
     65GO_VER=1.7.3
    6666NSIS_VER=2.51
    6767
    6868## File names for the source packages
    PY2EXE_HASH=610a8800de3d973ed5ed4ac505ab42ad058add18a68609ac09e6cf3598ef056c 
    114114SETUPTOOLS_HASH=75d288687066ed124311d6ca5f40ffa92a0e81adcd7fff318c6e84082713cf39
    115115PARSLEY_HASH=50d30cee70770fd44db7cea421cb2fb75af247c3a1cd54885c06b30a7c85dd23
    116116GO14_HASH=9947fc705b0b841b5938c48b22dc33e9647ec0752bae66e50278df4f23f64959
    117 GO_HASH=6326aeed5f86cf18f16d6dc831405614f855e2d416a91fd3fdc334f772345b00
     117GO_HASH=79430a0027a09b0b3ad57e214c4c1acfdd7af290961dd08d322818895af1ef44
    118118NSIS_HASH=43d4c9209847e35eb6e2c7cd5a7586e1445374c056c2c7899e40a080e17a1be7
    119119NSIS_DEBIAN_HASH=1dee6957b4a4b8dfe69bcf28bc7f301a13b96b3fa5a394e36c8926ae781e774a
    120120GCC_HASH=b7dafdf89cbb0e20333dbf5b5349319ae06e3d1a30bf3515b5488f7e89dca5ad
  • gitian/versions.beta

    diff --git a/gitian/versions.beta b/gitian/versions.beta
    index c985e30..7f7b500 100755
    a b SETUPTOOLS_VER=1.4 
    4949PARSLEY_VER=1.2
    5050# We need a Go 1.4 to bootstrap later versions; see https://golang.org/doc/install/source#go14
    5151GO14_VER=1.4.3
    52 GO_VER=1.6.3
     52GO_VER=1.7.3
    5353
    5454## File names for the source packages
    5555OPENSSL_PACKAGE=openssl-${OPENSSL_VER}.tar.gz
    PY2EXE_HASH=610a8800de3d973ed5ed4ac505ab42ad058add18a68609ac09e6cf3598ef056c 
    9696SETUPTOOLS_HASH=75d288687066ed124311d6ca5f40ffa92a0e81adcd7fff318c6e84082713cf39
    9797PARSLEY_HASH=50d30cee70770fd44db7cea421cb2fb75af247c3a1cd54885c06b30a7c85dd23
    9898GO14_HASH=9947fc705b0b841b5938c48b22dc33e9647ec0752bae66e50278df4f23f64959
    99 GO_HASH=6326aeed5f86cf18f16d6dc831405614f855e2d416a91fd3fdc334f772345b00
     99GO_HASH=79430a0027a09b0b3ad57e214c4c1acfdd7af290961dd08d322818895af1ef44
    100100STIXMATHFONT_HASH=e3b0f712e2644438eee2d0dcd2b10b2d54f1b972039de95b2f8e800bae1adbd8
    101101NOTOEMOJIFONT_HASH=415dc6290378574135b64c808dc640c1df7531973290c4970c51fdeb849cb0c5
    102102NOTOJPFONT_HASH=3e8146c4ce0945f255cb9dbc12b392380af80bd117e0a60eae555c99c7e618da
  • gitian/versions.nightly

    diff --git a/gitian/versions.nightly b/gitian/versions.nightly
    index 0c489c9..5373b02 100755
    a b SETUPTOOLS_VER=1.4 
    6969PARSLEY_VER=1.2
    7070# We need a Go 1.4 to bootstrap later versions; see https://golang.org/doc/install/source#go14
    7171GO14_VER=1.4.3
    72 GO_VER=1.6.3
     72GO_VER=1.7.3
    7373NSIS_VER=2.51
    7474
    7575## File names for the source packages
    PY2EXE_HASH=610a8800de3d973ed5ed4ac505ab42ad058add18a68609ac09e6cf3598ef056c 
    121121SETUPTOOLS_HASH=75d288687066ed124311d6ca5f40ffa92a0e81adcd7fff318c6e84082713cf39
    122122PARSLEY_HASH=50d30cee70770fd44db7cea421cb2fb75af247c3a1cd54885c06b30a7c85dd23
    123123GO14_HASH=9947fc705b0b841b5938c48b22dc33e9647ec0752bae66e50278df4f23f64959
    124 GO_HASH=6326aeed5f86cf18f16d6dc831405614f855e2d416a91fd3fdc334f772345b00
     124GO_HASH=79430a0027a09b0b3ad57e214c4c1acfdd7af290961dd08d322818895af1ef44
    125125NSIS_HASH=43d4c9209847e35eb6e2c7cd5a7586e1445374c056c2c7899e40a080e17a1be7
    126126NSIS_DEBIAN_HASH=1dee6957b4a4b8dfe69bcf28bc7f301a13b96b3fa5a394e36c8926ae781e774a
    127127GCC_HASH=b7dafdf89cbb0e20333dbf5b5349319ae06e3d1a30bf3515b5488f7e89dca5ad