Skip to content
This repository has been archived by the owner on May 12, 2021. It is now read-only.

runtime: Kata runtime fails to build with go 1.8.3 #638

Closed
nitkon opened this issue Aug 24, 2018 · 20 comments · Fixed by #662
Closed

runtime: Kata runtime fails to build with go 1.8.3 #638

nitkon opened this issue Aug 24, 2018 · 20 comments · Fixed by #662
Assignees

Comments

@nitkon
Copy link
Contributor

nitkon commented Aug 24, 2018

Description of problem

Build and install of Kata runtime fails

Expected result

Successfully built the Kata runtime

Actual result

runtime]# make && sudo -E PATH=$PATH make install
     CLEAN   clean
     GENERATE cli/config-generated.go
     CONFIG  data/kata-collect-data.sh
kata-runtime - version 1.2.0 (commit ed6f715ae6d46171c170c98909656539005766e3)

• architecture:
	Host: x86_64
	golang: amd64
	Build: amd64

• golang:
	go version go1.8.3 linux/amd64

• Summary:

	destination install path (DESTDIR)    : /
	binary installation path (BINDIR)     : /usr/local/bin
	binaries to install                   :
	 - /usr/local/bin/kata-runtime
	 - /usr/local/bin/data/kata-collect-data.sh
	config to install (CONFIG)            : cli/config/configuration.toml
	install path (CONFIG_PATH)            : /usr/share/defaults/kata-containers/configuration.toml
	alternate config path (SYSCONFIG)     : /etc/kata-containers/configuration.toml
	hypervisor path (QEMUPATH)            : /usr/bin/qemu-lite-system-x86_64
	assets path (PKGDATADIR)              : /usr/share/kata-containers
	proxy+shim path (PKGLIBEXECDIR)       : /usr/libexec/kata-containers

     BUILD   /home/nitesh/TST/kata/src/github.com/kata-containers/runtime/kata-runtime
# github.com/kata-containers/runtime/virtcontainers
../virtcontainers/agent.go:94: cannot use kataAgent literal (type *kataAgent) as type agent in return argument:
	*kataAgent does not implement agent (wrong type for init method)
		have init("github.com/kata-containers/runtime/vendor/golang.org/x/net/context".Context, *Sandbox, interface {}) error
		want init("context".Context, *Sandbox, interface {}) error
make: *** [Makefile:331: /home/nitesh/TST/kata/src/github.com/kata-containers/runtime/kata-runtime] Error 
@jodh-intel
Copy link
Contributor

Could you try a git clean -dfx?

@jodh-intel
Copy link
Contributor

Oh - wait - I think you might be trying to build outside of your $GOPATH?

@nitkon
Copy link
Contributor Author

nitkon commented Aug 24, 2018

@jodh-intel : I think $GOPATH is set fine. I checked out 1.2.0 tag and everything built fine. Checked back to master and saw the build failure.

@devimc
Copy link

devimc commented Aug 24, 2018

@nitkon is /home/nitesh/TST/kata your GOPATH? as @jodh-intel mentions probably you are not building kata in your GOPATH

@nitkon
Copy link
Contributor Author

nitkon commented Aug 24, 2018

@devimc :

[root@nitkon runtime]# pwd
/home/nitesh/TST/kata/src/github.com/kata-containers/runtime
[root@nitkon runtime]# echo $GOPATH
/home/nitesh/TST/kata/
[root@nitkon runtime]# git branch
* master
[root@nitkon runtime]# make && sudo -E PATH=$PATH make install
     CLEAN   clean
     GENERATE cli/config-generated.go
     CONFIG  data/kata-collect-data.sh
kata-runtime - version 1.2.0 (commit ed6f715ae6d46171c170c98909656539005766e3)

• architecture:
	Host: x86_64
	golang: amd64
	Build: amd64

• golang:
	go version go1.8.3 linux/amd64

• Summary:

	destination install path (DESTDIR)    : /
	binary installation path (BINDIR)     : /usr/local/bin
	binaries to install                   :
	 - /usr/local/bin/kata-runtime
	 - /usr/local/bin/data/kata-collect-data.sh
	config to install (CONFIG)            : cli/config/configuration.toml
	install path (CONFIG_PATH)            : /usr/share/defaults/kata-containers/configuration.toml
	alternate config path (SYSCONFIG)     : /etc/kata-containers/configuration.toml
	hypervisor path (QEMUPATH)            : /usr/bin/qemu-lite-system-x86_64
	assets path (PKGDATADIR)              : /usr/share/kata-containers
	proxy+shim path (PKGLIBEXECDIR)       : /usr/libexec/kata-containers

     BUILD   /home/nitesh/TST/kata/src/github.com/kata-containers/runtime/kata-runtime
# github.com/kata-containers/runtime/virtcontainers
../virtcontainers/agent.go:94: cannot use kataAgent literal (type *kataAgent) as type agent in return argument:
	*kataAgent does not implement agent (wrong type for init method)
		have init("github.com/kata-containers/runtime/vendor/golang.org/x/net/context".Context, *Sandbox, interface {}) error
		want init("context".Context, *Sandbox, interface {}) error
make: *** [Makefile:331: /home/nitesh/TST/kata/src/github.com/kata-containers/runtime/kata-runtime] Error 2
[root@nitkon runtime]# git checkout 1.2.0
Note: checking out '1.2.0'.

You are in 'detached HEAD' state. You can look around, make experimental
changes and commit them, and you can discard any commits you make in this
state without impacting any branches by performing another checkout.

If you want to create a new branch to retain commits you create, you may
do so (now or later) by using -b with the checkout command again. Example:

  git checkout -b <new-branch-name>

HEAD is now at 0bcb32f... Merge pull request #555 from jcvenegas/1.2.0-branch-bump
[root@nitkon runtime]# make && sudo -E PATH=$PATH make install
     CLEAN   clean
     GENERATE cli/config-generated.go
     CONFIG  data/kata-collect-data.sh
kata-runtime - version 1.2.0 (commit 0bcb32f7042625ea0ecee8f37b99b4459ebd5af8)

• architecture:
	Host: x86_64
	golang: amd64
	Build: amd64

• golang:
	go version go1.8.3 linux/amd64

• Summary:

	destination install path (DESTDIR)    : /
	binary installation path (BINDIR)     : /usr/local/bin
	binaries to install                   :
	 - /usr/local/bin/kata-runtime
	 - /usr/local/bin/data/kata-collect-data.sh
	config to install (CONFIG)            : cli/config/configuration.toml
	install path (CONFIG_PATH)            : /usr/share/defaults/kata-containers/configuration.toml
	alternate config path (SYSCONFIG)     : /etc/kata-containers/configuration.toml
	hypervisor path (QEMUPATH)            : /usr/bin/qemu-lite-system-x86_64
	assets path (PKGDATADIR)              : /usr/share/kata-containers
	proxy+shim path (PKGLIBEXECDIR)       : /usr/libexec/kata-containers

     BUILD   /home/nitesh/TST/kata/src/github.com/kata-containers/runtime/kata-runtime
     CONFIG  cli/config/configuration.toml
kata-runtime - version 1.2.0 (commit 0bcb32f7042625ea0ecee8f37b99b4459ebd5af8)

• architecture:
	Host: x86_64
	golang: amd64
	Build: amd64

• golang:
	go version go1.8.3 linux/amd64

• Summary:

	destination install path (DESTDIR)    : /
	binary installation path (BINDIR)     : /usr/local/bin
	binaries to install                   :
	 - /usr/local/bin/kata-runtime
	 - /usr/local/bin/data/kata-collect-data.sh
	config to install (CONFIG)            : cli/config/configuration.toml
	install path (CONFIG_PATH)            : /usr/share/defaults/kata-containers/configuration.toml
	alternate config path (SYSCONFIG)     : /etc/kata-containers/configuration.toml
	hypervisor path (QEMUPATH)            : /usr/bin/qemu-lite-system-x86_64
	assets path (PKGDATADIR)              : /usr/share/kata-containers
	proxy+shim path (PKGLIBEXECDIR)       : /usr/libexec/kata-containers

     INSTALL install-scripts
     INSTALL install-completions
     INSTALL install-config
     INSTALL install-bin

@jodh-intel
Copy link
Contributor

Do you have local changes maybe? (git checkout -f to reset?)

Does this work for you?

dir="/tmp/go"
url="github.com/kata-containers/runtime"
GOPATH="$dir" go get -d "$url"
cd "$dir/src/$url"
GOPATH="$dir" make

@nitkon
Copy link
Contributor Author

nitkon commented Aug 24, 2018

No, I do not have any local changes.

[root@nitkon runtime]# dir="/tmp/go"
[root@nitkon runtime]# url="github.com/kata-containers/runtime"
[root@nitkon runtime]# GOPATH="$dir" go get -d "$url"
package github.com/kata-containers/runtime: no buildable Go source files in /tmp/go/src/github.com/kata-containers/runtime
[root@nitkon runtime]# cd "$dir/src/$url"
[root@nitkon runtime]# GOPATH="$dir" make
     CLEAN   clean
     GENERATE cli/config-generated.go
     CONFIG  data/kata-collect-data.sh
kata-runtime - version 1.2.0 (commit 8b5fa32d9b55b8a456807fe3e7fe527633bf389b)

• architecture:
	Host: x86_64
	golang: amd64
	Build: amd64

• golang:
	go version go1.8.3 linux/amd64

• Summary:

	destination install path (DESTDIR)    : /
	binary installation path (BINDIR)     : /usr/local/bin
	binaries to install                   :
	 - /usr/local/bin/kata-runtime
	 - /usr/local/bin/data/kata-collect-data.sh
	config to install (CONFIG)            : cli/config/configuration.toml
	install path (CONFIG_PATH)            : /usr/share/defaults/kata-containers/configuration.toml
	alternate config path (SYSCONFIG)     : /etc/kata-containers/configuration.toml
	hypervisor path (QEMUPATH)            : /usr/bin/qemu-lite-system-x86_64
	assets path (PKGDATADIR)              : /usr/share/kata-containers
	proxy+shim path (PKGLIBEXECDIR)       : /usr/libexec/kata-containers

     BUILD   /tmp/go/src/github.com/kata-containers/runtime/kata-runtime
# github.com/kata-containers/runtime/virtcontainers
../virtcontainers/agent.go:94: cannot use kataAgent literal (type *kataAgent) as type agent in return argument:
	*kataAgent does not implement agent (wrong type for init method)
		have init("github.com/kata-containers/runtime/vendor/golang.org/x/net/context".Context, *Sandbox, interface {}) error
		want init("context".Context, *Sandbox, interface {}) error
make: *** [Makefile:331: /tmp/go/src/github.com/kata-containers/runtime/kata-runtime] Error 2

@devimc
Copy link

devimc commented Aug 24, 2018

@nitkon ahhh the problem is the version go1.8.3 , please try with a new version

@devimc
Copy link

devimc commented Aug 24, 2018

btw I faced some runtime failures using that version

@devimc
Copy link

devimc commented Aug 24, 2018

@caoruidong I think so, and I think we shouldn't support that version any more

@devimc
Copy link

devimc commented Aug 24, 2018

@egernst @jodh-intel @bergwolf what do you think ?

@caoruidong
Copy link
Member

Yes. We can update

runtime/versions.yaml

Lines 183 to 188 in 8b5fa32

golang:
description: "Google's 'go' language"
notes: "'version' is the default minimum version used by this project."
version: "1.8.3"
meta:
newest-version: "1.10"
. But how to limit it from compiling?

@grahamwhaley
Copy link
Contributor

If I'm reading this correctly: https://golang.org/dl/
then 1.8.x is not a stable release anymore - minimum looks like v1.9.7

We'll need to fix up:
https://github.com/kata-containers/runtime/blob/master/versions.yaml#L186

Works for me, if it is not listed as effectively supported on the golang pages any more.

@jodh-intel
Copy link
Contributor

I agree - 1.8.3 is getting pretty old now (https://github.com/golang/go/releases/tag/go1.8.3). Centos 7 even has golang 1.9.4 in their repo.

I'll raise a PR to bump the YAML config...

@jodh-intel
Copy link
Contributor

See #643.

@nitkon
Copy link
Contributor Author

nitkon commented Aug 24, 2018

@devimc : So kata runtime with golang version 1.9.7 builds fine? I might have a local setup issue then ...

[root@nitkon runtime]# export GOROOT=/usr/local/go
[root@nitkon runtime]# export GOPATH=/home/nitesh/TST/kata/
[root@nitkon runtime]# export PATH=$GOPATH/bin:$GOROOT/bin:$PATH
[root@nitkon runtime]# go version
go version go1.9.7 linux/amd64
[root@nitkon runtime]# cat versions.yaml | grep "Google's 'go' language" -A2 -B2

  golang:
    description: "Google's 'go' language"
    notes: "'version' is the default minimum version used by this project."
    version: "1.9.7"
[root@nitkon runtime]# PWD
bash: PWD: command not found...
Similar command is: 'pwd'
[root@nitkon runtime]# pwd
/home/nitesh/TST/kata/src/github.com/kata-containers/runtime
[root@nitkon runtime]# make && sudo -E PATH=$PATH make install
     CLEAN   clean
     GENERATE cli/config-generated.go
     CONFIG  data/kata-collect-data.sh
kata-runtime - version 1.2.0 (commit ed6f715ae6d46171c170c98909656539005766e3-dirty)

• architecture:
	Host: x86_64
	golang: amd64
	Build: amd64

• golang:
	go version go1.9.7 linux/amd64

• Summary:

	destination install path (DESTDIR)    : /
	binary installation path (BINDIR)     : /usr/local/bin
	binaries to install                   :
	 - /usr/local/bin/kata-runtime
	 - /usr/local/bin/data/kata-collect-data.sh
	config to install (CONFIG)            : cli/config/configuration.toml
	install path (CONFIG_PATH)            : /usr/share/defaults/kata-containers/configuration.toml
	alternate config path (SYSCONFIG)     : /etc/kata-containers/configuration.toml
	hypervisor path (QEMUPATH)            : /usr/bin/qemu-lite-system-x86_64
	assets path (PKGDATADIR)              : /usr/share/kata-containers
	proxy+shim path (PKGLIBEXECDIR)       : /usr/libexec/kata-containers

     BUILD   /home/nitesh/TST/kata/src/github.com/kata-containers/runtime/kata-runtime
# runtime
/usr/local/go/src/runtime/mstkbar.go:151:10: debug.gcstackbarrieroff undefined (type struct { allocfreetrace int32; cgocheck int32; efence int32; gccheckmark int32; gcpacertrace int32; gcshrinkstackoff int32; gcrescanstacks int32; gcstoptheworld int32; gctrace int32; invalidptr int32; sbrk int32; scavenge int32; scheddetail int32; schedtrace int32 } has no field or method gcstackbarrieroff)
/usr/local/go/src/runtime/mstkbar.go:162:24: division by zero
/usr/local/go/src/runtime/mstkbar.go:162:43: invalid expression unsafe.Sizeof(composite literal)
/usr/local/go/src/runtime/mstkbar.go:162:44: undefined: stkbar
/usr/local/go/src/runtime/mstkbar.go:212:4: gp.stkbar undefined (type *g has no field or method stkbar)
/usr/local/go/src/runtime/mstkbar.go:213:15: gp.stkbar undefined (type *g has no field or method stkbar)
/usr/local/go/src/runtime/mstkbar.go:216:23: undefined: stackBarrierPC
/usr/local/go/src/runtime/mstkbar.go:226:28: gp.stkbarPos undefined (type *g has no field or method stkbarPos)
/usr/local/go/src/runtime/mstkbar.go:227:19: gp.stkbarPos undefined (type *g has no field or method stkbarPos)
/usr/local/go/src/runtime/mstkbar.go:248:41: undefined: stkbar
/usr/local/go/src/runtime/mstkbar.go:227:19: too many errors
make: *** [Makefile:331: /home/nitesh/TST/kata/src/github.com/kata-containers/runtime/kata-runtime] Error 2

@jodh-intel
Copy link
Contributor

@nitkon - file /usr/local/go/src/runtime/mstkbar.go:151 is specific to go1.8.3 fwics so, yes, I think you have an environment issue.

@nitkon
Copy link
Contributor Author

nitkon commented Aug 24, 2018

@jodh-intel : Yes, you were right! I cleaned up and now I am able to build it without errors. Cool!

@devimc
Copy link

devimc commented Aug 24, 2018

should we close this issue?

@jodh-intel jodh-intel changed the title runtime: Kata runtime fails to build on x86 runtime: Kata runtime fails to build with go 1.8.3 Aug 24, 2018
@jodh-intel
Copy link
Contributor

I think so as it's... cough... "fixed" by #643.

@nitkon nitkon closed this as completed Aug 24, 2018
WeiZhang555 added a commit to WeiZhang555/runtime that referenced this issue Aug 29, 2018
Fixes kata-containers#638

Latest kata-runtime can't build with golang 1.8.3, fix it for backward compatibility.

Signed-off-by: Wei Zhang <[email protected]>
WeiZhang555 added a commit to WeiZhang555/runtime that referenced this issue Aug 30, 2018
Fixes kata-containers#638

Latest kata-runtime can't build with golang 1.8.3, fix it for backward compatibility.

Signed-off-by: Wei Zhang <[email protected]>
WeiZhang555 added a commit to WeiZhang555/runtime that referenced this issue Aug 31, 2018
Fixes kata-containers#638.

Latest kata-runtime can't build with golang 1.8.3, fix it for backward compatibility.

Signed-off-by: Wei Zhang <[email protected]>
lifupan pushed a commit to hyperhq/kata-runtime that referenced this issue Sep 17, 2018
Fixes kata-containers#638.

Latest kata-runtime can't build with golang 1.8.3, fix it for backward compatibility.

Signed-off-by: Wei Zhang <[email protected]>
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
None yet
Projects
None yet
Development

Successfully merging a pull request may close this issue.

6 participants