- Use -buildmode=pie for tests and binary build. bsc#1048046 bsc#1051429

This also includes some various improvements to the packaging of runc,
containerd and docker-runc.

OBS-URL: https://build.opensuse.org/package/show/Virtualization:containers/docker?expand=0&rev=197
This commit is contained in:
Aleksa Sarai 2017-08-11 12:09:59 +00:00 committed by Git OBS Bridge
parent 18b17a0bdb
commit ca3f73206d
2 changed files with 15 additions and 8 deletions

View File

@ -1,3 +1,8 @@
-------------------------------------------------------------------
Wed Aug 2 13:37:16 UTC 2017 - asarai@suse.com
- Use -buildmode=pie for tests and binary build. bsc#1048046 bsc#1051429
------------------------------------------------------------------- -------------------------------------------------------------------
Wed Jul 19 18:12:26 UTC 2017 - jmassaguerpla@suse.com Wed Jul 19 18:12:26 UTC 2017 - jmassaguerpla@suse.com

View File

@ -200,6 +200,8 @@ export DOCKER_GITCOMMIT=%{git_version}
# Until boo#1038493 is fixed properly we need to do this hack to get the # Until boo#1038493 is fixed properly we need to do this hack to get the
# compiled-into-the-binary GOROOT. # compiled-into-the-binary GOROOT.
export GOROOT="$(GOROOT= go env GOROOT)" export GOROOT="$(GOROOT= go env GOROOT)"
# Make sure we always build PIC code. bsc#1048046
export BUILDFLAGS="-buildmode=pie"
EOF EOF
) > docker_build_env ) > docker_build_env
. ./docker_build_env . ./docker_build_env
@ -209,6 +211,7 @@ man/md2man-all.sh
# build the tests binary # build the tests binary
GOPATH=$(pwd)/vendor:$(pwd)/.gopath/ go test \ GOPATH=$(pwd)/vendor:$(pwd)/.gopath/ go test \
-buildmode=pie \
-tags "$DOCKER_BUILDTAGS daemon autogen" \ -tags "$DOCKER_BUILDTAGS daemon autogen" \
-c github.com/docker/docker/integration-cli -o tests.main -c github.com/docker/docker/integration-cli -o tests.main
@ -265,14 +268,13 @@ PKG_LIST=$(go list -e \
| grep -v 'github.com/docker/docker/cmd/dockerd$' \ | grep -v 'github.com/docker/docker/cmd/dockerd$' \
| grep -v 'github.com/docker/docker/builder/dockerfile/parser$' \ | grep -v 'github.com/docker/docker/builder/dockerfile/parser$' \
| grep -v 'github.com/docker/docker/man$' \ | grep -v 'github.com/docker/docker/man$' \
%if 0%{?with_libseccomp}
| grep -v 'github.com/docker/docker/pkg/integration$')
%else
| grep -v 'github.com/docker/docker/pkg/integration$' \ | grep -v 'github.com/docker/docker/pkg/integration$' \
| grep -v 'github.com/docker/docker/profiles/seccomp$') %if ! 0%{?with_libseccomp}
| grep -v 'github.com/docker/docker/profiles/seccomp$' \
%endif %endif
)
go test -cover -ldflags -w -tags "$DOCKER_BUILDTAGS" -a -test.timeout=10m $PKG_LIST go test -buildmode=pie -cover -ldflags -w -tags "$DOCKER_BUILDTAGS" -a -test.timeout=10m $PKG_LIST
%install %install
install -d %{buildroot}%{go_contribdir} install -d %{buildroot}%{go_contribdir}