Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

cmd/go: cannot find main module, while building opencontainers/runc #30869

Closed
sudeeshjohn opened this issue Mar 15, 2019 · 3 comments
Closed
Labels
FrozenDueToAge modules NeedsInvestigation Someone must examine and confirm this is a valid issue and not a duplicate of an existing one. WaitingForInfo Issue is not actionable because of missing required information, which needs to be provided.

Comments

@sudeeshjohn
Copy link

What version of Go are you using (go version)?

$ go version
go version devel +cb8054a6b6 Fri Mar 15 04:15:59 2019 +0000 linux/amd64

Does this issue reproduce with the latest release?

No.

What operating system and processor architecture are you using (go env)?

go env Output
$ go env
go version devel +cb8054a6b6 Fri Mar 15 04:15:59 2019 +0000 linux/amd64
root@ubuntu18:/go/src/github.com/weaveworks/weave# go env
GOARCH="amd64"
GOBIN=""
GOCACHE="/root/.cache/go-build"
GOEXE=""
GOFLAGS=""
GOHOSTARCH="amd64"
GOHOSTOS="linux"
GOOS="linux"
GOPATH="/go"
GOPROXY=""
GORACE=""
GOROOT="/go/src/golang/go"
GOTMPDIR=""
GOTOOLDIR="/go/src/golang/go/pkg/tool/linux_amd64"
GCCGO="gccgo"
CC="gcc"
CXX="g++"
CGO_ENABLED="1"
GOMOD="/dev/null"
CGO_CFLAGS="-g -O2"
CGO_CPPFLAGS=""
CGO_CXXFLAGS="-g -O2"
CGO_FFLAGS="-g -O2"
CGO_LDFLAGS="-g -O2"
PKG_CONFIG="pkg-config"
GOGCCFLAGS="-fPIC -m64 -pthread -fmessage-length=0 -fdebug-prefix-map=/tmp/go-build376968183=/tmp/go-build -gno-record-gcc-switches"

What did you do?

git clone https://github.com/opencontainers/runc.git
cd runc
make

What did you expect to see?

make should be successful

What did you see instead?

root@ubuntu18:/go/src/github.com/opencontainers/runc# make
go build -buildmode=pie  -ldflags "-X main.gitCommit="7341c22d46a3de49fe9fdb546f33065296200d99" -X main.version=1.0.0-rc6+dev " -tags "seccomp" -o runc .
go: cannot find main module, but found vendor.conf in /go/src/github.com/opencontainers/runc
	to create a module there, run:
	go mod init
Makefile:33: recipe for target 'runc' failed
make: *** [runc] Error 1
root@ubuntu18:/go/src/github.com/opencontainers/runc#
@katiehockman
Copy link
Contributor

It seems like this is related to #30868
With GO111MODULE=on as the default at tip, that's probably why you're seeing this error now. https://github.com/opencontainers/runc isn't a module, and it looks like the go command is failing to build because it expects one.

/cc @bcmills up to you whether or not you want to mark this as a duplicate of the other issue.

@katiehockman katiehockman added the NeedsInvestigation Someone must examine and confirm this is a valid issue and not a duplicate of an existing one. label Mar 19, 2019
@katiehockman katiehockman changed the title go: cannot find main module, while building runc , weave cmd/go: cannot find main module, while building opencontainers/runc Mar 19, 2019
@bcmills
Copy link
Contributor

bcmills commented Mar 28, 2019

This seems like an issue to file against github.com/opencontainers/runc. Fundamentally, if you want to build a module in module mode, then it needs a go.mod file.

What happens if you run the suggested go mod init command?

@bcmills bcmills added WaitingForInfo Issue is not actionable because of missing required information, which needs to be provided. modules labels Mar 28, 2019
@gopherbot
Copy link

Timed out in state WaitingForInfo. Closing.

(I am just a bot, though. Please speak up if this is a mistake or you have the requested information.)

@golang golang locked and limited conversation to collaborators Apr 27, 2020
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
FrozenDueToAge modules NeedsInvestigation Someone must examine and confirm this is a valid issue and not a duplicate of an existing one. WaitingForInfo Issue is not actionable because of missing required information, which needs to be provided.
Projects
None yet
Development

No branches or pull requests

4 participants