Skip to content

Commit

Permalink
Update to Golang 1.9.4
Browse files Browse the repository at this point in the history
Keep up with the latest version of Golang. Version prior to 1.9.4 are
affected by security issues on build. `go get` could have been used to do unwanted
code execution[1] CVE-2018-6574 during build.

The changes in golang now enforce more restrictive pragma declaration
when linking and compiling.

This commits, disable crosscompiling under solaris which requires an
update on the standard library.

```
../vendor/golang.org/x/sys/unix/zsyscall_solaris_amd64.go:13:3: //go:cgo_import_dynamic libc_pipe pipe "libc.so" only allowed in cgo-generated code
../vendor/golang.org/x/sys/unix/zsyscall_solaris_amd64.go:14:3: //go:cgo_import_dynamic libc_getsockname getsockname "libsocket.so" only allowed in cgo-generated code
```

We also update popsutil, thag was incorrectly defining an ldflags in a
previous release making the build fails under the new restriction.

[1] golang/go#23672
  • Loading branch information
ph committed Feb 12, 2018
1 parent 8cbede1 commit 5fc93c6
Show file tree
Hide file tree
Showing 21 changed files with 33 additions and 23 deletions.
2 changes: 1 addition & 1 deletion .go-version
Original file line number Diff line number Diff line change
@@ -1 +1 @@
1.9.2
1.9.4
1 change: 1 addition & 0 deletions CHANGELOG.asciidoc
Original file line number Diff line number Diff line change
Expand Up @@ -75,6 +75,7 @@ https://github.com/elastic/beats/compare/v6.0.0-beta2...master[Check the HEAD di
- Fix isolation of modules when merging local and global field settings. {issue}5795[5795]
- Fix panic when Events containing a float32 value are normalized. {pull}6129[6129]
- Fix `setup.dashboards.always_kibana` when using Kibana 5.6. {issue}6090[6090]
- Update Golang 1.9.4 {pull}6326[6326]

*Auditbeat*

Expand Down
4 changes: 2 additions & 2 deletions NOTICE.txt
Original file line number Diff line number Diff line change
Expand Up @@ -2843,8 +2843,8 @@ WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.

--------------------------------------------------------------------
Dependency: github.com/shirou/gopsutil
Version: v2.17.04
Revision: 9af92986dda65a8c367157a82b484553e1ec1c55
Version: v2.18.01
Revision: c432be29ccce470088d07eea25b3ea7e68a8afbb
License type (autodetected): BSD-3-Clause
./vendor/github.com/shirou/gopsutil/LICENSE:
--------------------------------------------------------------------
Expand Down
2 changes: 1 addition & 1 deletion Vagrantfile
Original file line number Diff line number Diff line change
Expand Up @@ -63,7 +63,7 @@ if [ ! -e "~/bin/gvm" ]; then
chmod +x ~/bin/gvm
echo 'export GOPATH=$HOME/go' >> ~/.bash_profile
echo 'export PATH=$HOME/bin:$GOPATH/bin:$PATH' >> ~/.bash_profile
echo 'eval "$(gvm 1.9.2)"' >> ~/.bash_profile
echo 'eval "$(gvm 1.9.4)"' >> ~/.bash_profile
fi
SCRIPT

Expand Down
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
FROM tudorg/xgo-deb6-1.9.2
FROM tudorg/xgo-deb6-1.9.4

MAINTAINER Tudor Golubenco <tudor@elastic.co>

Expand Down
2 changes: 1 addition & 1 deletion dev-tools/packer/docker/xgo-image-deb6/build.sh
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
#!/bin/sh

docker build --rm=true -t tudorg/xgo-deb6-base base/ && \
docker build --rm=true -t tudorg/xgo-deb6-1.9.2 go-1.9.2/ &&
docker build --rm=true -t tudorg/xgo-deb6-1.9.4 go-1.9.4/ &&
docker build --rm=true -t tudorg/beats-builder-deb6 beats-builder
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
# Go cross compiler (xgo): Go 1.9.2 layer
# Go cross compiler (xgo): Go 1.9.4 layer
# Copyright (c) 2014 Péter Szilágyi. All rights reserved.
#
# Released under the MIT license.
Expand All @@ -9,7 +9,7 @@ MAINTAINER Tudor Golubenco <tudor@elastic.co>

# Configure the root Go distribution and bootstrap based on it
RUN \
export ROOT_DIST="https://storage.googleapis.com/golang/go1.9.2.linux-amd64.tar.gz" && \
export ROOT_DIST_SHA1="94c889e039e3d2e94ed95e8f8cb747c5bc1c2b58" && \
export ROOT_DIST="https://storage.googleapis.com/golang/go1.9.4.linux-amd64.tar.gz" && \
export ROOT_DIST_SHA1="15b0937615809f87321a457bb1265f946f9f6e736c563d6c5e0bd2c22e44f779" && \
\
$BOOTSTRAP_PURE
2 changes: 1 addition & 1 deletion dev-tools/packer/docker/xgo-image/beats-builder/Dockerfile
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
FROM tudorg/xgo-1.9.2
FROM tudorg/xgo-1.9.4

MAINTAINER Tudor Golubenco <tudor@elastic.co>

Expand Down
2 changes: 1 addition & 1 deletion dev-tools/packer/docker/xgo-image/build.sh
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
#!/bin/sh

docker build --rm=true -t tudorg/xgo-base base/ && \
docker build --rm=true -t tudorg/xgo-1.9.2 go-1.9.2/ &&
docker build --rm=true -t tudorg/xgo-1.9.4 go-1.9.4/ &&
docker build --rm=true -t tudorg/beats-builder beats-builder
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
# Go cross compiler (xgo): Go 1.9.2 layer
# Go cross compiler (xgo): Go 1.9.4 layer
# Copyright (c) 2014 Péter Szilágyi. All rights reserved.
#
# Released under the MIT license.
Expand All @@ -9,7 +9,7 @@ MAINTAINER Tudor Golubenco <tudor@elastic.co>

# Configure the root Go distribution and bootstrap based on it
RUN \
export ROOT_DIST="https://storage.googleapis.com/golang/go1.9.2.linux-amd64.tar.gz" && \
export ROOT_DIST_SHA1="94c889e039e3d2e94ed95e8f8cb747c5bc1c2b58" && \
export ROOT_DIST="https://storage.googleapis.com/golang/go1.9.4.linux-amd64.tar.gz" && \
export ROOT_DIST_SHA1="15b0937615809f87321a457bb1265f946f9f6e736c563d6c5e0bd2c22e44f779" && \
\
$BOOTSTRAP_PURE
2 changes: 1 addition & 1 deletion filebeat/Dockerfile
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
FROM golang:1.9.2
FROM golang:1.9.4
MAINTAINER Nicolas Ruflin <ruflin@elastic.co>

RUN set -x && \
Expand Down
2 changes: 1 addition & 1 deletion generator/beat/{beat}/.travis.yml
Original file line number Diff line number Diff line change
Expand Up @@ -6,7 +6,7 @@ services:
language: go

go:
- 1.9.2
- 1.9.4

os:
- linux
Expand Down
2 changes: 1 addition & 1 deletion libbeat/Dockerfile
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
# Beats dockerfile used for testing
FROM golang:1.9.2
FROM golang:1.9.4
MAINTAINER Nicolas Ruflin <ruflin@elastic.co>

RUN set -x && \
Expand Down
2 changes: 1 addition & 1 deletion libbeat/docs/version.asciidoc
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
:stack-version: 7.0.0-alpha1
:doc-branch: master
:go-version: 1.9.2
:go-version: 1.9.4
:release-state: unreleased
:python: 2.7.9
:docker: 1.12
Expand Down
2 changes: 1 addition & 1 deletion libbeat/scripts/Makefile
Original file line number Diff line number Diff line change
Expand Up @@ -52,7 +52,7 @@ NOSETESTS_OPTIONS?=--process-timeout=$(TIMEOUT) --with-timer -v --with-xunit --x
TEST_ENVIRONMENT?=false ## @testing if true, "make testsuite" runs integration tests and system tests in a dockerized test environment
SYSTEM_TESTS?=false ## @testing if true, "make test" and "make testsuite" run unit tests and system tests
STRESS_TESTS?=false ## @testing if true, "make test" and "make testsuite" run also run the stress tests
GOX_OS?=linux darwin windows solaris freebsd netbsd openbsd ## @Building List of all OS to be supported by "make crosscompile".
GOX_OS?=linux darwin windows freebsd netbsd openbsd ## @Building List of all OS to be supported by "make crosscompile".
GOX_OSARCH?=!darwin/arm !darwin/arm64 !darwin/386 ## @building Space separated list of GOOS/GOARCH pairs to build by "make crosscompile".
GOX_FLAGS?= ## @building Additional flags to append to the gox command used by "make crosscompile".
TESTING_ENVIRONMENT?=snapshot## @testing The name of the environment under test
Expand Down
2 changes: 1 addition & 1 deletion metricbeat/Dockerfile
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
FROM golang:1.9.2
FROM golang:1.9.4
MAINTAINER Nicolas Ruflin <ruflin@elastic.co>

RUN set -x && \
Expand Down
2 changes: 1 addition & 1 deletion metricbeat/Makefile
Original file line number Diff line number Diff line change
Expand Up @@ -11,7 +11,7 @@ GOPACKAGES=$(shell go list ${BEAT_PATH}/... | grep -v /vendor/)
ES_BEATS?=..

# Metricbeat can only be cross-compiled on platforms not requiring CGO.
GOX_OS=solaris netbsd linux windows
GOX_OS=netbsd linux windows
GOX_FLAGS=-arch="amd64 386 arm ppc64 ppc64le"


Expand Down
2 changes: 1 addition & 1 deletion metricbeat/module/http/_meta/Dockerfile
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
FROM golang:1.9.2
FROM golang:1.9.4

COPY test/main.go main.go

Expand Down

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

1 change: 1 addition & 0 deletions vendor/github.com/shirou/gopsutil/doc.go

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

8 changes: 8 additions & 0 deletions vendor/vendor.json
Original file line number Diff line number Diff line change
Expand Up @@ -1025,6 +1025,14 @@
"revision": "5bf94b69c6b68ee1b541973bb8e1144db23a194b",
"revisionTime": "2017-03-21T23:07:31Z"
},
{
"checksumSHA1": "JDLkZ5oQHhfdtBVh/0K4hlE8y5g=",
"path": "github.com/shirou/gopsutil",
"revision": "c432be29ccce470088d07eea25b3ea7e68a8afbb",
"revisionTime": "2018-01-30T01:13:38Z",
"version": "v2.18.01",
"versionExact": "v2.18.01"
},
{
"checksumSHA1": "9ev6lHyQOxl1/VndOHAnMfbLmvs=",
"path": "github.com/shirou/gopsutil/disk",
Expand Down

0 comments on commit 5fc93c6

Please sign in to comment.