Accepting request 848440 from home:jfehlig:branches:Virtualization

- Fix -buildmode=pie
  fix-goflags-overwrite.patch, dont-build-virtctl-darwin.patch

OBS-URL: https://build.opensuse.org/request/show/848440
OBS-URL: https://build.opensuse.org/package/show/Virtualization/kubevirt?expand=0&rev=23
This commit is contained in:
2020-11-13 23:47:58 +00:00
committed by Git OBS Bridge
parent 49a0e4fd51
commit 4ac524d8c9
4 changed files with 77 additions and 0 deletions

View File

@@ -0,0 +1,34 @@
Don't build virtctl for darwin and windows
Noticed the following build failure when specifying '-buildmode=pie'
in GOFLAGS
/usr/lib64/go/1.13/pkg/tool/linux_amd64/link: running gcc failed: exit status 1
/usr/lib64/gcc/x86_64-suse-linux/10/../../../../x86_64-suse-linux/bin/ld: cannot
find 1144: No such file or directory
The failure was encountered when building virtctl for darwin and windows.
Remove the builds for these OSes.
Signed-off-by: Jim Fehlig <jfehlig@suse.com>
Index: kubevirt-0.35.0/hack/build-go.sh
===================================================================
--- kubevirt-0.35.0.orig/hack/build-go.sh
+++ kubevirt-0.35.0/hack/build-go.sh
@@ -114,15 +114,6 @@ for arg in $args; do
kubevirt::version::get_version_vars
echo "$KUBEVIRT_GIT_VERSION" >${CMD_OUT_DIR}/${BIN_NAME}/.version
-
- # build virtctl also for darwin and windows
- if [ "${BIN_NAME}" = "virtctl" ]; then
- GOOS=darwin GOARCH=amd64 go_build -i -o ${CMD_OUT_DIR}/${BIN_NAME}/${ARCH_BASENAME}-darwin-amd64 -ldflags "$(kubevirt::version::ldflags)" $(pkg_dir darwin amd64)
- GOOS=windows GOARCH=amd64 go_build -i -o ${CMD_OUT_DIR}/${BIN_NAME}/${ARCH_BASENAME}-windows-amd64.exe -ldflags "$(kubevirt::version::ldflags)" $(pkg_dir windows amd64)
- # Create symlinks to the latest binary of each architecture
- (cd ${CMD_OUT_DIR}/${BIN_NAME} && ln -sf ${ARCH_BASENAME}-darwin-amd64 ${BIN_NAME}-darwin)
- (cd ${CMD_OUT_DIR}/${BIN_NAME} && ln -sf ${ARCH_BASENAME}-windows-amd64.exe ${BIN_NAME}-windows.exe)
- fi
)
else
(

View File

@@ -0,0 +1,35 @@
Don't overwrite user-provided GOFLAGS
Signed-off-by: Jim Fehlig <jfehlig@suse.com>
Index: kubevirt-0.35.0/hack/common.sh
===================================================================
--- kubevirt-0.35.0.orig/hack/common.sh
+++ kubevirt-0.35.0/hack/common.sh
@@ -4,7 +4,7 @@ if [ -f cluster-up/hack/common.sh ]; the
source cluster-up/hack/common.sh
fi
-export GOFLAGS=-mod=vendor
+export GOFLAGS="$GOFLAGS -mod=vendor"
KUBEVIRT_DIR="$(
cd "$(dirname "$BASH_SOURCE[0]")/../"
@@ -23,7 +23,7 @@ ARCHITECTURE=$(uname -m)
function build_func_tests() {
mkdir -p "${TESTS_OUT_DIR}/"
- GOPROXY=off GOFLAGS=-mod=vendor \
+ GOPROXY=off GOFLAGS="$GOFLAGS -mod=vendor" \
go test -c "${KUBEVIRT_DIR}/tests" -o "${TESTS_OUT_DIR}/tests.test"
}
@@ -62,7 +62,7 @@ function kubevirt_version() {
KUBEVIRT_VERSION="$(kubevirt_version)"
function go_build() {
- GOPROXY=off GOFLAGS=-mod=vendor go build "$@"
+ GOPROXY=off GOFLAGS="$GOFLAGS -mod=vendor" go build "$@"
}
# Use this environment variable to set a local path to a custom CA certificate for

View File

@@ -1,3 +1,9 @@
-------------------------------------------------------------------
Fri Nov 13 23:32:52 UTC 2020 - James Fehlig <jfehlig@suse.com>
- Fix -buildmode=pie
fix-goflags-overwrite.patch, dont-build-virtctl-darwin.patch
-------------------------------------------------------------------
Tue Nov 10 15:54:58 UTC 2020 - jfehlig@suse.com

View File

@@ -26,6 +26,8 @@ URL: https://github.com/kubevirt/kubevirt
Source0: %{name}-%{version}.tar.gz
Source1: kubevirt-psp-caasp.yaml
Source100: %{name}-rpmlintrc
Patch0: fix-goflags-overwrite.patch
Patch1: dont-build-virtctl-darwin.patch
BuildRequires: glibc-devel-static
BuildRequires: golang-packaging
BuildRequires: pkgconfig