Skip to content

Commit

Permalink
Updates version of go used to build buildpack from source on CF
Browse files Browse the repository at this point in the history
  • Loading branch information
ForestEckhardt committed Dec 4, 2020
1 parent 60ee906 commit 91bb15e
Show file tree
Hide file tree
Showing 19 changed files with 19 additions and 588 deletions.
2 changes: 1 addition & 1 deletion bin/finalize
Original file line number Diff line number Diff line change
Expand Up @@ -13,7 +13,7 @@ output_dir=$(mktemp -d -t finalizeXXX)

echo "-----> Running go build finalize"
pushd $BUILDPACK_DIR
GOROOT=$GoInstallDir/go $GoInstallDir/go/bin/go build -mod=vendor -o $output_dir/finalize ./src/binary/finalize/cli
GOROOT=$GoInstallDir $GoInstallDir/bin/go build -mod=vendor -o $output_dir/finalize ./src/binary/finalize/cli
popd

$output_dir/finalize "$BUILD_DIR" "$CACHE_DIR" "$DEPS_DIR" "$DEPS_IDX" "$PROFILE_DIR"
Expand Down
2 changes: 1 addition & 1 deletion bin/supply
Original file line number Diff line number Diff line change
Expand Up @@ -12,7 +12,7 @@ output_dir=$(mktemp -d -t supplyXXX)

echo "-----> Running go build supply"
pushd $BUILDPACK_DIR
GOROOT=$GoInstallDir/go $GoInstallDir/go/bin/go build -mod=vendor -o $output_dir/supply ./src/binary/supply/cli
GOROOT=$GoInstallDir $GoInstallDir/bin/go build -mod=vendor -o $output_dir/supply ./src/binary/supply/cli
popd

$output_dir/supply "$BUILD_DIR" "$CACHE_DIR" "$DEPS_DIR" "$DEPS_IDX"
2 changes: 1 addition & 1 deletion go.mod
Original file line number Diff line number Diff line change
Expand Up @@ -5,7 +5,7 @@ require (
github.com/nxadm/tail v1.4.5 // indirect
github.com/onsi/ginkgo v1.14.2
github.com/onsi/gomega v1.10.3
golang.org/x/sys v0.0.0-20201130171929-760e229fe7c5 // indirect
golang.org/x/sys v0.0.0-20201202213521-69691e467435 // indirect
)

go 1.13
2 changes: 2 additions & 0 deletions go.sum
Original file line number Diff line number Diff line change
Expand Up @@ -543,6 +543,8 @@ golang.org/x/sys v0.0.0-20200523222454-059865788121/go.mod h1:h1NjWce9XRLGQEsW7w
golang.org/x/sys v0.0.0-20200930185726-fdedc70b468f/go.mod h1:h1NjWce9XRLGQEsW7wpKNCjG9DtNlClVuFLEZdDNbEs=
golang.org/x/sys v0.0.0-20201130171929-760e229fe7c5 h1:dMDtAap8F/+vsyXblqK90iTzYJjNix5MsXDicSYol6w=
golang.org/x/sys v0.0.0-20201130171929-760e229fe7c5/go.mod h1:h1NjWce9XRLGQEsW7wpKNCjG9DtNlClVuFLEZdDNbEs=
golang.org/x/sys v0.0.0-20201202213521-69691e467435 h1:25AvDqqB9PrNqj1FLf2/70I4W0L19qqoaFq3gjNwbKk=
golang.org/x/sys v0.0.0-20201202213521-69691e467435/go.mod h1:h1NjWce9XRLGQEsW7wpKNCjG9DtNlClVuFLEZdDNbEs=
golang.org/x/text v0.0.0-20160726164857-2910a502d2bf/go.mod h1:NqM8EUOU14njkJ3fqMW+pc6Ldnwhi/IjpwHt7yyuwOQ=
golang.org/x/text v0.0.0-20170915032832-14c0d48ead0c/go.mod h1:NqM8EUOU14njkJ3fqMW+pc6Ldnwhi/IjpwHt7yyuwOQ=
golang.org/x/text v0.3.0 h1:g61tztE5qeGQ89tm6NTjjM9VPIm088od1l6aSorWRWg=
Expand Down
17 changes: 9 additions & 8 deletions scripts/install_go.sh
Original file line number Diff line number Diff line change
Expand Up @@ -2,10 +2,10 @@

set -euo pipefail

GO_VERSION="1.12.4"
GO_VERSION="1.15.5"

if [ $CF_STACK == "cflinuxfs3" ]; then
GO_SHA256="e68279204493307782c51105c3dd5254ab066d0b5d9aafa3ce3a2878ebbef53f"
GO_SHA256="fd04494f7a2dd478b0d31cb949aae7f154749cae1242581b1574f7e590b3b7e6"
else
echo " **ERROR** Unsupported stack"
echo " See https://docs.cloudfoundry.org/devguide/deploy-apps/stacks.html for more info"
Expand All @@ -16,22 +16,23 @@ export GoInstallDir="/tmp/go$GO_VERSION"
mkdir -p $GoInstallDir

if [ ! -f $GoInstallDir/go/bin/go ]; then
URL=https://buildpacks.cloudfoundry.org/dependencies/go/go${GO_VERSION}.linux-amd64-${CF_STACK}-${GO_SHA256:0:8}.tar.gz
URL=https://buildpacks.cloudfoundry.org/dependencies/go/go_${GO_VERSION}_linux_x64_${CF_STACK}_${GO_SHA256:0:8}.tgz

echo "-----> Download go ${GO_VERSION}"
curl -s -L --retry 15 --retry-delay 2 $URL -o /tmp/go.tar.gz
curl -s -L --retry 15 --retry-delay 2 $URL -o /tmp/go.tgz

DOWNLOAD_SHA256=$(shasum -a 256 /tmp/go.tar.gz | cut -d ' ' -f 1)
DOWNLOAD_SHA256=$(shasum -a 256 /tmp/go.tgz | cut -d ' ' -f 1)

if [[ $DOWNLOAD_SHA256 != $GO_SHA256 ]]; then
echo " **ERROR** SHA256 mismatch: got $DOWNLOAD_SHA256 expected $GO_SHA256"
exit 1
fi

tar xzf /tmp/go.tar.gz -C $GoInstallDir
rm /tmp/go.tar.gz
tar xzf /tmp/go.tgz -C $GoInstallDir
rm /tmp/go.tgz
fi
if [ ! -f $GoInstallDir/go/bin/go ]; then

if [ ! -f $GoInstallDir/bin/go ]; then
echo " **ERROR** Could not download go"
exit 1
fi
1 change: 0 additions & 1 deletion vendor/golang.org/x/sys/unix/syscall_darwin.1_13.go

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

2 changes: 0 additions & 2 deletions vendor/golang.org/x/sys/unix/zsyscall_darwin_386.1_13.go

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

0 comments on commit 91bb15e

Please sign in to comment.