Skip to content

Commit

Permalink
Convert to using go-1.9 for PR jobs, update readme to refer to snap f…
Browse files Browse the repository at this point in the history
…or go install
  • Loading branch information
Nicholas Skaggs committed Oct 11, 2017
1 parent 911e093 commit bb93740
Show file tree
Hide file tree
Showing 5 changed files with 13 additions and 19 deletions.
4 changes: 2 additions & 2 deletions .ci/check-merge.groovy
Original file line number Diff line number Diff line change
Expand Up @@ -64,7 +64,7 @@ node('juju-core-slave-b') {

sh(script: "${scripts_dir}/clean_lxd.py")

withEnv(["PATH+GO=/usr/lib/go-1.8/bin/"]) {
withEnv(["PATH+GO=/usr/lib/go-1.9/bin/"]) {
retcode = sh(
script: "${release_scripts}/make-pr-tarball.bash ${env.CHANGE_ID}",
returnStatus: true)
Expand Down Expand Up @@ -124,4 +124,4 @@ node('juju-core-slave-b') {
deleteDir()
}
}
}
}
11 changes: 4 additions & 7 deletions Makefile
Original file line number Diff line number Diff line change
Expand Up @@ -17,7 +17,7 @@ else
endif

ifeq ($(shell uname -p | sed -r 's/.*(86|armel|armhf|aarch64|ppc64le|s390x).*/golang/'), golang)
GO_C = golang-1.8
GO_C = golang-1.9
INSTALL_FLAGS =
else
GO_C = gccgo-4.9 gccgo-go
Expand Down Expand Up @@ -96,7 +96,7 @@ rebuild-dependencies.tsv: godeps
# Install packages required to develop Juju and run tests. The stable
# PPA includes the required mongodb-server binaries.
install-dependencies:
@echo Adding juju PPAs for golang and juju
@echo Adding juju PPA for mongodb
@sudo apt-add-repository --yes ppa:juju/stable
@sudo apt-get update
@echo Installing dependencies
Expand Down Expand Up @@ -125,11 +125,8 @@ check-deps:
@echo "$(GOCHECK_COUNT) instances of gocheck not in test code"

install-go:
@echo Adding juju PPAs for golang and juju
@sudo apt-add-repository -y ppa:juju/golang
@sudo apt-get update
@echo Installing $(GO_C)
@sudo apt-get -y install $(GO_C)
@echo Installing go-1.9 snap
@sudo snap install go --channel=1.9/stable

.PHONY: build check install
.PHONY: clean format simplify
Expand Down
11 changes: 4 additions & 7 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -16,17 +16,14 @@ Getting started
`juju` is written in Go (http://golang.org), a modern, compiled, statically typed,
concurrent language. This document describes how to build `juju` from source.

If you are looking for binary releases of `juju`, they are available from the Juju
stable PPA, `https://launchpad.net/~juju/+archive/stable`, and can be installed with:
If you are looking for binary releases of `juju`, they are available in the snap store

sudo apt-add-repository ppa:juju/stable
sudo apt-get update
sudo apt-get install juju
snap install juju --classic

Installing Go
--------------

`Juju's` source code currently depends on Go 1.8. One of the easiest ways
`Juju's` source code currently depends on Go 1.9. One of the easiest ways
to install golang is from a snap. You may need to first install
the [snap client](https://snapcraft.io/docs/core/install). Installing the golang
snap package is then as easy as
Expand All @@ -37,7 +34,7 @@ You can read about the "classic" confinement policy [here](https://insights.ubun

If you want to use `apt`, then you can add the [juju-golang PPA](https://launchpad.net/~juju/+archive/ubuntu/golang) and then run the following

sudo apt install golang-1.8
sudo apt install golang-1.9

Alternatively, you can always follow the official [binary installation instructions](https://golang.org/doc/install#install)

Expand Down
2 changes: 1 addition & 1 deletion acceptancetests/run-unit-tests
Original file line number Diff line number Diff line change
Expand Up @@ -179,7 +179,7 @@ if [[ "$INSTANCE_TYPE" != "lxc" && "$INSTANCE_TYPE" != "host" ]]; then
done
$FIXUP_SOURCES
fi
export PATH=/usr/lib/go-1.8/bin:$PATH
export PATH=/usr/lib/go-1.9/bin:$PATH
export DEBIAN_FRONTEND=noninteractive
sudo apt-get update
sudo apt-get install -y make gcc software-properties-common distro-info-data
Expand Down
4 changes: 2 additions & 2 deletions releasetests/crossbuild.py
Original file line number Diff line number Diff line change
Expand Up @@ -14,7 +14,7 @@
import traceback


GOLANG_VERSION = '1.8'
GOLANG_VERSION = '1.9'
CROSSCOMPILE_SOURCE = (
'https://raw.githubusercontent.com'
'/davecheney/golang-crosscompile/master/crosscompile.bash')
Expand Down Expand Up @@ -95,7 +95,7 @@ def setup_cross_building(build_dir, dry_run=False, verbose=False):
sudo apt-get install winetricks wine innoextract dpkg-dev xvfb
apt-get source golang-go={GOLANG_VERSION}*
export GOROOT=/var/lib/jenkins/crossbuild/golang-{GOLANG_VERSION}
export GOROOT_BOOTSTRAP=/usr/lib/go-1.8/
export GOROOT_BOOTSTRAP=/usr/lib/go-1.9/
# For sl90x, ppc64el, arm64
go-crosscompile-build linux/$GOARCH
Expand Down

0 comments on commit bb93740

Please sign in to comment.