Skip to content

Commit

Permalink
Update to Golang 1.9.4 (elastic#6326)
Browse files Browse the repository at this point in the history
* Update to Golang 1.9.4

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

* update vendor correctly
  • Loading branch information
ph authored and ruflin committed Feb 13, 2018
1 parent 12b14fa commit 9e46667
Show file tree
Hide file tree
Showing 46 changed files with 773 additions and 357 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 @@ -82,6 +82,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 <[email protected]>

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 <[email protected]>

# 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 <[email protected]>

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 <[email protected]>

# 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 <[email protected]>

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 <[email protected]>

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 <[email protected]>

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
15 changes: 12 additions & 3 deletions vendor/github.com/shirou/gopsutil/disk/disk_darwin.go

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

8 changes: 6 additions & 2 deletions vendor/github.com/shirou/gopsutil/disk/disk_darwin_cgo.go

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

10 changes: 9 additions & 1 deletion vendor/github.com/shirou/gopsutil/disk/disk_darwin_nocgo.go

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

20 changes: 18 additions & 2 deletions vendor/github.com/shirou/gopsutil/disk/disk_fallback.go

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

24 changes: 19 additions & 5 deletions vendor/github.com/shirou/gopsutil/disk/disk_freebsd.go

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

Loading

0 comments on commit 9e46667

Please sign in to comment.