From 08956e4a4cbc4fb7083072ac2d41e7098ea3c38e Mon Sep 17 00:00:00 2001 From: Marco Vedovati Date: Mon, 19 Nov 2018 17:54:23 +0100 Subject: [PATCH 1/2] obs-packaging: remove hardcoded golang version Remove hardcoded golang version, as it overwrites the value previously fetched from the runtime/versions.yaml. NOTE: this has as consequence replacing the golang compiler version from 1.10.2 to 1.11.1 (that is currently the "newest-version" specified on master). Fixes: #242 Signed-off-by: Marco Vedovati --- obs-packaging/gen_versions_txt.sh | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/obs-packaging/gen_versions_txt.sh b/obs-packaging/gen_versions_txt.sh index 3acef5984..64f300028 100755 --- a/obs-packaging/gen_versions_txt.sh +++ b/obs-packaging/gen_versions_txt.sh @@ -5,6 +5,7 @@ # [ -z "${DEBUG}" ] || set -x +set -e set -o errexit set -o nounset set -o pipefail @@ -40,7 +41,6 @@ gen_version_file() { kernel_version=${kernel_version#v} golang_version=$(get_from_kata_deps "languages.golang.meta.newest-version" "${kata_version}") - golang_version="1.10.2" golang_sha256=$(curl -s -L "https://storage.googleapis.com/golang/go${golang_version}.linux-${ARCH}.tar.gz.sha256") # - is not a valid char for rpmbuild From 3084801cd8767d1c340e462a0e8ddfb5ecd32773 Mon Sep 17 00:00:00 2001 From: Marco Vedovati Date: Mon, 19 Nov 2018 19:22:36 +0100 Subject: [PATCH 2/2] runtime: skip golang version check in OBS pkg Skip the golang version check when building the runtime, passing to make `SKIP_GO_VERSION_CHECK=1`. This check requires yq, that's not packaged for most distributions and it can't be downloaded at build time on OBS. It is the responsibility of the package maintainer to verify that the correct golang version is used. Fixes: #242 Signed-off-by: Marco Vedovati --- obs-packaging/runtime/debian.rules-template | 8 ++++++-- obs-packaging/runtime/kata-runtime.spec-template | 6 +++++- 2 files changed, 11 insertions(+), 3 deletions(-) diff --git a/obs-packaging/runtime/debian.rules-template b/obs-packaging/runtime/debian.rules-template index a7b0be48c..84d5a6b3c 100644 --- a/obs-packaging/runtime/debian.rules-template +++ b/obs-packaging/runtime/debian.rules-template @@ -27,7 +27,10 @@ override_dh_auto_build: tar xzf /usr/src/packages/SOURCES/go$(GO_VERSION).linux-@GO_ARCH@.tar.gz -C /usr/src/packages/BUILD/local ln -s /usr/src/packages/BUILD /usr/src/packages/BUILD/go/src/$(IMPORTNAME) cd $(GOPATH)/src/$(IMPORTNAME)/; \ - make QEMUPATH=/usr/bin/$(DEFAULT_QEMU) COMMIT=@HASH@ + make \ + QEMUPATH=/usr/bin/$(DEFAULT_QEMU) \ + COMMIT=@HASH@ \ + SKIP_GO_VERSION_CHECK=1 override_dh_auto_install: mkdir -p debian/$(PKG_NAME) @@ -37,6 +40,7 @@ override_dh_auto_install: DESTDIR=$(shell pwd)/debian/$(PKG_NAME)/ \ PREFIX=/usr \ COMMIT=@HASH@ \ - QEMUPATH=/usr/bin/$(DEFAULT_QEMU) + QEMUPATH=/usr/bin/$(DEFAULT_QEMU) \ + SKIP_GO_VERSION_CHECK=1 sed -i -e '/^initrd =/d' $(shell pwd)/debian/$(PKG_NAME)/usr/share/defaults/kata-containers/configuration.toml diff --git a/obs-packaging/runtime/kata-runtime.spec-template b/obs-packaging/runtime/kata-runtime.spec-template index d6996fb15..f2b9af7ed 100644 --- a/obs-packaging/runtime/kata-runtime.spec-template +++ b/obs-packaging/runtime/kata-runtime.spec-template @@ -69,7 +69,10 @@ export GOPATH=$HOME/rpmbuild/BUILD/go/ mkdir -p $HOME/rpmbuild/BUILD/go/src/%{DOMAIN}/%{ORG} ln -s $HOME/rpmbuild/BUILD/kata-runtime-%{version} $HOME/rpmbuild/BUILD/go/src/%{IMPORTNAME} cd $HOME/rpmbuild/BUILD/go/src/%{IMPORTNAME} -make QEMUPATH=/usr/bin/%{DEFAULT_QEMU} COMMIT=@HASH@ +make \ + QEMUPATH=/usr/bin/%{DEFAULT_QEMU} \ + COMMIT=@HASH@ \ + SKIP_GO_VERSION_CHECK=1 %check export http_proxy=http://127.0.0.1:9/ @@ -88,6 +91,7 @@ make \ PREFIX=/usr \ QEMUPATH=/usr/bin/%{DEFAULT_QEMU} \ COMMIT=@HASH@ \ + SKIP_GO_VERSION_CHECK=1 \ install sed -i -e '/^initrd =/d' %{buildroot}/usr/share/defaults/kata-containers/configuration.toml