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

Makefile: Change "GOPATH not set" to "No GO command" #1286

Merged
merged 1 commit into from
Mar 4, 2019

Conversation

teawater
Copy link
Member

@teawater teawater commented Feb 27, 2019

The cause that make "sudo make install" fail is not "GOPATH not set",
but no go command in path.
But the commit still keep the "GOPATH not set" because
execute "unset GOPATH; make" will fail because "go build" cannot work
without GOPATH.

@teawater
Copy link
Member Author

/test

Makefile Outdated
@@ -12,8 +12,10 @@ for file in /etc/os-release /usr/lib/os-release; do \
fi \
done)

HAVEGO=$(shell go version 2>/dev/null)
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

This is already used in golang.mk so why not use that?

Copy link
Member Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

@jodh-intel Thanks for your remind.
I pushed a new version that replaces HAVEGO to golang_version_raw.

@teawater
Copy link
Member Author

This PR doesn't change the default running behavior of kata-runtime.
So I think the fails of unit tests in jenkins-ci-ARM-ubuntu-18-04 do not have relation with this PR.

@teawater
Copy link
Member Author

/test

@jodh-intel
Copy link
Contributor

$ (unset GOPATH; go version;make)
go version go1.11.5 linux/amd64
INFO: yq was not found, installing it
make: /bin/yq: Command not found
golang.mk:30: *** "ERROR: cannot determine minimum golang version". Arrêt.

The problem is that golang.mk needs GOPATH to find the yq binary so that it can check versions.yaml to check for the minimum golang version.

Personally, I'd just set GOPATH 😄

@teawater
Copy link
Member Author

/test

@teawater
Copy link
Member Author

teawater commented Mar 1, 2019

@jodh-intel Both "GOPATH not set" or "No GO command" will make kata-runtime build failed now.
So I changed "GOPATH not set" to "No GO command or GOPATH not set".

@teawater
Copy link
Member Author

teawater commented Mar 1, 2019

jenkins-ci-ARM-ubuntu-18-04 failed

--- FAIL: TestNewConsole (0.00s)
    assertions.go:239: 
                          
	Error Trace:	console_test.go:28
        
	Error:      	Received unexpected error:
        
	            	open /dev/ptmx: no such device
        
	Messages:   	failed to create a new console: open /dev/ptmx: no such device
panic: runtime error: invalid memory address or nil pointer dereference
	panic: runtime error: invalid memory address or nil pointer dereference [recovered]
	panic: runtime error: invalid memory address or nil pointer dereference
[signal SIGSEGV: segmentation violation code=0x1 addr=0x10 pc=0xac486c]

goroutine 148 [running]:
testing.tRunner.func1(0x40003a4200)
	/usr/local/go/src/testing/testing.go:792 +0x30c
panic(0xc259a0, 0x154d880)
	/usr/local/go/src/runtime/panic.go:513 +0x18c
github.com/kata-containers/runtime/cli.(*Console).Close(0x0, 0x4000393780, 0x2)
	/home/jenkins/workspace/kata-containers-runtime-ARM-18.04-PR/go/src/github.com/kata-containers/runtime/cli/console.go:88 +0x44
panic(0xc259a0, 0x154d880)
	/usr/local/go/src/runtime/panic.go:513 +0x18c
github.com/kata-containers/runtime/cli.(*Console).Path(...)
	/home/jenkins/workspace/kata-containers-runtime-ARM-18.04-PR/go/src/github.com/kata-containers/runtime/cli/console.go:73
github.com/kata-containers/runtime/cli.TestNewConsole(0x40003a4200)
	/home/jenkins/workspace/kata-containers-runtime-ARM-18.04-PR/go/src/github.com/kata-containers/runtime/cli/console_test.go:31 +0xf0
testing.tRunner(0x40003a4200, 0xd7fd60)
	/usr/local/go/src/testing/testing.go:827 +0xa8
created by testing.(*T).Run
	/usr/local/go/src/testing/testing.go:878 +0x2b0
FAIL	github.com/kata-containers/runtime/cli	1.655s
Makefile:524: recipe for target 'go-test' failed
make: *** [go-test] Error 1
Build step 'Execute shell' marked build as failure
Performing Post build task...
Match found for :.* : True
Logical operation result is TRUE
Running script  : #!/bin/bash

This PR doesn't change the behavior of kata-runtime execution. So it has nothing to do with this failure.

Copy link
Contributor

@jodh-intel jodh-intel left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

lgtm

golang.mk Outdated Show resolved Hide resolved
The cause that make "sudo make install" fail is not "GOPATH not set",
but no go command in path.
But the commit still keep the "GOPATH not set" because
execute "unset GOPATH; make" will fail because "go build" cannot work
without GOPATH.

Fixes: kata-containers#1285

Signed-off-by: Hui Zhu <[email protected]>
@teawater
Copy link
Member Author

teawater commented Mar 1, 2019

/test

@lifupan
Copy link
Member

lifupan commented Mar 4, 2019

lgtm

@lifupan lifupan merged commit 2af09d1 into kata-containers:master Mar 4, 2019
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 this pull request may close these issues.

3 participants