kata-containers/govmm

Compilation issues, for govmm, on Windows 10 (Go 1.15.2)

advancedwebdeveloper opened this issue · 6 comments

I was curious what blocks this package from compiling, on Windows.

$ go build -i -v -x
WORK=C:\Users\Worker\AppData\Local\Temp\go-build762776886
/C/Users/Worker/Desktop/govmm/qemu
mkdir -p $WORK\b001
cat >$WORK\b001\importcfg << 'EOF' # internal

import config

packagefile bufio=c:\go\pkg\windows_amd64\bufio.a
packagefile bytes=c:\go\pkg\windows_amd64\bytes.a
packagefile container/list=c:\go\pkg\windows_amd64\container\list.a
packagefile context=c:\go\pkg\windows_amd64\context.a
packagefile encoding/json=c:\go\pkg\windows_amd64\encoding\json.a
packagefile errors=c:\go\pkg\windows_amd64\errors.a
packagefile fmt=c:\go\pkg\windows_amd64\fmt.a
packagefile io=c:\go\pkg\windows_amd64\io.a
packagefile io/ioutil=c:\go\pkg\windows_amd64\io\ioutil.a
packagefile log=c:\go\pkg\windows_amd64\log.a
packagefile net=c:\go\pkg\windows_amd64\net.a
packagefile os=c:\go\pkg\windows_amd64\os.a
packagefile os/exec=c:\go\pkg\windows_amd64\os\exec.a
packagefile path=c:\go\pkg\windows_amd64\path.a
packagefile runtime=c:\go\pkg\windows_amd64\runtime.a
packagefile strconv=c:\go\pkg\windows_amd64\strconv.a
packagefile strings=c:\go\pkg\windows_amd64\strings.a
packagefile syscall=c:\go\pkg\windows_amd64\syscall.a
packagefile time=c:\go\pkg\windows_amd64\time.a
EOF
cd C:\Users\Worker\Desktop\govmm\qemu
"c:\go\pkg\tool\windows_amd64\compile.exe" -o "$WORK\b001\pkg.a" -trimpath "$WORK\b001=>" -p /C/Users/Worker/Desktop/govmm/qemu -complete -buildid dOlQOtmVqMsEWPaTfptx/dOlQOtmVqMsEWPaTfptx -goversion go1.15.2 -D /C/Users/Worker/Desktop/govmm/qemu -importcfg "$WORK\b001\importcfg" -pack -c=4 "C:\Users\Worker\Desktop\govmm\qemu\image.go" "C:\Users\Worker\Desktop\govmm\qemu\qemu.go" "C:\Users\Worker\Desktop\govmm\qemu\qmp.go"

/C/Users/Worker/Desktop/govmm/qemu

.\qmp.go:1517:9: undefined: syscall.UnixRights

So my environment is like follows:

$ go version
go version go1.15.2 windows/amd64

$ go env
set GO111MODULE=
set GOARCH=amd64
set GOBIN=
set GOCACHE=C:\Users\Worker\AppData\Local\go-build
set GOENV=C:\Users\Worker\AppData\Roaming\go\env
set GOEXE=.exe
set GOFLAGS=
set GOHOSTARCH=amd64
set GOHOSTOS=windows
set GOINSECURE=
set GOMODCACHE=C:\Users\Worker\go\pkg\mod
set GONOPROXY=
set GONOSUMDB=
set GOOS=windows
set GOPATH=C:\Users\Worker\go
set GOPRIVATE=
set GOPROXY=https://proxy.golang.org,direct
set GOROOT=c:\go
set GOSUMDB=sum.golang.org
set GOTMPDIR=
set GOTOOLDIR=c:\go\pkg\tool\windows_amd64
set GCCGO=gccgo
set AR=ar
set CC=gcc
set CXX=g++
set CGO_ENABLED=1
set GOMOD=
set CGO_CFLAGS=-g -O2
set CGO_CPPFLAGS=
set CGO_CXXFLAGS=-g -O2
set CGO_FFLAGS=-g -O2
set CGO_LDFLAGS=-g -O2
set PKG_CONFIG=pkg-config
set GOGCCFLAGS=-m64 -mthreads -fmessage-length=0 -fdebug-prefix-map=C:\Users\Worker\AppData\Local\Temp\go-build111068182=/tmp/go-build -gno-record-gcc-switches

$ bash --version
bash --version
GNU bash, version 4.4.23(1)-release (x86_64-pc-msys)

This file compiles:

$ go build -i -v -x image.go
go build -i -v -x image.go
WORK=C:\Users\Worker\AppData\Local\Temp\go-build661815462
command-line-arguments
mkdir -p $WORK\b001
cat >$WORK\b001\importcfg << 'EOF' # internal

import config

packagefile context=c:\go\pkg\windows_amd64\context.a
packagefile fmt=c:\go\pkg\windows_amd64\fmt.a
packagefile io/ioutil=c:\go\pkg\windows_amd64\io\ioutil.a
packagefile os=c:\go\pkg\windows_amd64\os.a
packagefile os/exec=c:\go\pkg\windows_amd64\os\exec.a
packagefile path=c:\go\pkg\windows_amd64\path.a
packagefile syscall=c:\go\pkg\windows_amd64\syscall.a
EOF
cd C:\Users\Worker\Desktop\govmm\qemu
"c:\go\pkg\tool\windows_amd64\compile.exe" -o "$WORK\b001\pkg.a" -trimpath "$WORK\b001=>" -p command-line-arguments -complete -buildid XPOY3-3akyYs77WLCkYt/XPOY3-3akyYs77WLCkYt -goversion go1.15.2 -D /C/Users/Worker/Desktop/govmm/qemu -importcfg "$WORK\b001\importcfg" -pack -c=4 "C:\Users\Worker\Desktop\govmm\qemu\image.go"
"c:\go\pkg\tool\windows_amd64\buildid.exe" -w "$WORK\b001\pkg.a" # internal
cp "$WORK\b001\pkg.a" "C:\Users\Worker\AppData\Local\go-build\5e\5e69bab978b1abfafb3ef184ac079695cc96499e60a584497677fbb471045374-d" # internal

Not sure if there is a bug, for this one:

$ go build -i -v -x qemu.go
go build -i -v -x qemu.go
WORK=C:\Users\Worker\AppData\Local\Temp\go-build019254310
command-line-arguments
mkdir -p $WORK\b001
cat >$WORK\b001\importcfg << 'EOF' # internal

import config

packagefile bytes=c:\go\pkg\windows_amd64\bytes.a
packagefile context=c:\go\pkg\windows_amd64\context.a
packagefile fmt=c:\go\pkg\windows_amd64\fmt.a
packagefile log=c:\go\pkg\windows_amd64\log.a
packagefile os=c:\go\pkg\windows_amd64\os.a
packagefile os/exec=c:\go\pkg\windows_amd64\os\exec.a
packagefile runtime=c:\go\pkg\windows_amd64\runtime.a
packagefile strconv=c:\go\pkg\windows_amd64\strconv.a
packagefile strings=c:\go\pkg\windows_amd64\strings.a
packagefile syscall=c:\go\pkg\windows_amd64\syscall.a
EOF
cd C:\Users\Worker\Desktop\govmm\qemu
"c:\go\pkg\tool\windows_amd64\compile.exe" -o "$WORK\b001\pkg.a" -trimpath "$WORK\b001=>" -p command-line-arguments -complete -buildid Jxi0_B80s_Le9rXLW0f2/Jxi0_B80s_Le9rXLW0f2 -goversion go1.15.2 -D /C/Users/Worker/Desktop/govmm/qemu -importcfg "$WORK\b001\importcfg" -pack -c=4 "C:\Users\Worker\Desktop\govmm\qemu\qemu.go"

command-line-arguments

.\qemu.go:2622:42: undefined: QMPLog
.\qemu.go:2624:12: undefined: qmpNullLogger
.\qemu.go:2644:39: undefined: QMPLog
.\qemu.go:2693:36: undefined: QMPLog
.\qemu.go:2695:12: undefined: qmpNullLogger

Same here

$ go build -i -v -x qmp.go
go build -i -v -x qmp.go
WORK=C:\Users\Worker\AppData\Local\Temp\go-build669825426
command-line-arguments
mkdir -p $WORK\b001
cat >$WORK\b001\importcfg << 'EOF' # internal

import config

packagefile bufio=c:\go\pkg\windows_amd64\bufio.a
packagefile container/list=c:\go\pkg\windows_amd64\container\list.a
packagefile context=c:\go\pkg\windows_amd64\context.a
packagefile encoding/json=c:\go\pkg\windows_amd64\encoding\json.a
packagefile errors=c:\go\pkg\windows_amd64\errors.a
packagefile fmt=c:\go\pkg\windows_amd64\fmt.a
packagefile io=c:\go\pkg\windows_amd64\io.a
packagefile net=c:\go\pkg\windows_amd64\net.a
packagefile os=c:\go\pkg\windows_amd64\os.a
packagefile strconv=c:\go\pkg\windows_amd64\strconv.a
packagefile strings=c:\go\pkg\windows_amd64\strings.a
packagefile syscall=c:\go\pkg\windows_amd64\syscall.a
packagefile time=c:\go\pkg\windows_amd64\time.a
EOF
cd C:\Users\Worker\Desktop\govmm\qemu
"c:\go\pkg\tool\windows_amd64\compile.exe" -o "$WORK\b001\pkg.a" -trimpath "$WORK\b001=>" -p command-line-arguments -complete -buildid rKsTjYkiSmEuLY0mI365/rKsTjYkiSmEuLY0mI365 -goversion go1.15.2 -D /C/Users/Worker/Desktop/govmm/qemu -importcfg "$WORK\b001\importcfg" -pack -c=4 "C:\Users\Worker\Desktop\govmm\qemu\qmp.go"

command-line-arguments

.\qmp.go:849:16: undefined: VirtioTransport
.\qmp.go:1022:14: undefined: VirtioNetPCI
.\qmp.go:1063:13: undefined: VirtioNetCCW
.\qmp.go:1118:16: undefined: VirtioTransport
.\qmp.go:1158:16: undefined: VirtioTransport
.\qmp.go:1161:19: undefined: VfioCCW
.\qmp.go:1163:19: undefined: VfioPCI
.\qmp.go:1186:14: undefined: VfioPCI
.\qmp.go:1206:15: undefined: VfioPCI
.\qmp.go:1223:15: undefined: VfioAP
.\qmp.go:1223:15: too many errors

Hi @advancedwebdeveloper - Thanks for raising this. However, the primary target for govmm has always been Linux afaik.
govmm uses Unix sockets for QMP comms but there may well be other complications trying to get this working on Windows.

Out of interest, what is your use-case? The main user of govmm is Kata Containers (https://github.com/kata-containers/runtime and https://github.com/kata-containers/kata-containers/tree/2.0-dev/src/runtime) and that too targets Linux environments.

Hi @advancedwebdeveloper - I hope you don't mind, but I've assigned this to you ;) Feel free to close it if you wish to.

As the GoVMM project has been moved under the Kata Containers project, please, feel free to open a new issue there in case you're still hitting it.

For now I'm closing the issue as there's no activity here since January 2021.