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

go 1.16 compatibitity #9

Closed
pmalhaire opened this issue Mar 1, 2021 · 3 comments · Fixed by #10
Closed

go 1.16 compatibitity #9

pmalhaire opened this issue Mar 1, 2021 · 3 comments · Fixed by #10
Labels
bug Something isn't working

Comments

@pmalhaire
Copy link

pmalhaire commented Mar 1, 2021

TLDR

using go 1.16 :

2021/03/01 18:02:48 [INFO] exec (timeout=0s): /usr/local/go/bin/go build -o /home/pierrot/Downloads/k6 -ldflags -w -s -trimpath 
go: k6: package github.com/loadimpact/k6/cmd imported from implicitly required module; to add missing requirements, run:
	go get github.com/loadimpact/k6/cmd@v0.30.1-0.20210208205855-a379c3787372

workarround (Working fine)

Artificially add the k6 repo as golang 1.16 does not implicitly adds it to go mod.

./xk6 build  --with github.com/pmalhaire/xk6-mqtt --with github.com/loadimpact/k6/cmd

details

I may have done something wrong but compiling my extension does not seam to work using golang 1.16

with go 1.16

go version go1.16 linux/amd64
xk6 build  --with github.com/pmalhaire/xk6-mqtt 
2021/03/01 18:02:47 [INFO] Temporary folder: /tmp/buildenv_2021-03-01-1802.161811804
2021/03/01 18:02:47 [INFO] Writing main module: /tmp/buildenv_2021-03-01-1802.161811804/main.go
2021/03/01 18:02:47 [INFO] Initializing Go module
2021/03/01 18:02:47 [INFO] exec (timeout=10s): /usr/local/go/bin/go mod init k6 
go: creating new go.mod: module k6
go: to add module requirements and sums:
	go mod tidy
2021/03/01 18:02:47 [INFO] Pinning versions
2021/03/01 18:02:47 [INFO] exec (timeout=0s): /usr/local/go/bin/go get -d -v github.com/loadimpact/k6 
go get: added github.com/loadimpact/k6 v0.30.0
2021/03/01 18:02:48 [INFO] exec (timeout=0s): /usr/local/go/bin/go get -d -v github.com/pmalhaire/xk6-mqtt 
go get: upgraded github.com/loadimpact/k6 v0.30.0 => v0.30.1-0.20210208205855-a379c3787372
go get: added github.com/pmalhaire/xk6-mqtt v0.0.0-20210301160808-4ee3400d52b1
2021/03/01 18:02:48 [INFO] Build environment ready
2021/03/01 18:02:48 [INFO] Building k6
2021/03/01 18:02:48 [INFO] exec (timeout=0s): /usr/local/go/bin/go build -o /home/pierrot/Downloads/k6 -ldflags -w -s -trimpath 
go: k6: package github.com/loadimpact/k6/cmd imported from implicitly required module; to add missing requirements, run:
	go get github.com/loadimpact/k6/cmd@v0.30.1-0.20210208205855-a379c3787372
2021/03/01 18:02:48 [INFO] Cleaning up temporary folder: /tmp/buildenv_2021-03-01-1802.161811804
2021/03/01 18:02:48 [FATAL] exit status 1

with go 1.15 all fine

xk6 build  --with github.com/pmalhaire/xk6-mqtt 
2021/03/01 17:59:40 [INFO] Temporary folder: /tmp/buildenv_2021-03-01-1759.483292408
2021/03/01 17:59:40 [INFO] Writing main module: /tmp/buildenv_2021-03-01-1759.483292408/main.go
2021/03/01 17:59:40 [INFO] Initializing Go module
2021/03/01 17:59:40 [INFO] exec (timeout=10s): /usr/local/go/bin/go mod init k6 
go: creating new go.mod: module k6
2021/03/01 17:59:40 [INFO] Pinning versions
2021/03/01 17:59:40 [INFO] exec (timeout=0s): /usr/local/go/bin/go get -d -v github.com/loadimpact/k6 
go: github.com/loadimpact/k6 upgrade => v0.30.0
2021/03/01 17:59:40 [INFO] exec (timeout=0s): /usr/local/go/bin/go get -d -v github.com/pmalhaire/xk6-mqtt 
go: github.com/pmalhaire/xk6-mqtt upgrade => v0.0.0-20210301160808-4ee3400d52b1
2021/03/01 17:59:41 [INFO] Build environment ready
2021/03/01 17:59:41 [INFO] Building k6
2021/03/01 17:59:41 [INFO] exec (timeout=0s): /usr/local/go/bin/go build -o /home/pierrot/stereolabs/xk6-mqtt/k6 -ldflags -w -s -trimpath 
2021/03/01 17:59:50 [INFO] Build complete: ./k6
2021/03/01 17:59:50 [INFO] Cleaning up temporary folder: /tmp/buildenv_2021-03-01-1759.483292408
@na--
Copy link
Member

na-- commented Mar 5, 2021

Thanks for notifying us of this! I've added some xk6 compatibility tests in the xk6 repo with grafana/k6#1885, so when we fix this, we should add checks for Go 1.16 there and bump the used versions when new Go versions are released.

@na-- na-- added the bug Something isn't working label Mar 5, 2021
@pmalhaire
Copy link
Author

Good TDD way !

The workarround I wrote works fine, so it's not blocking.

@kuchaguangjie
Copy link

Seems the general solution is go mod tidy, before start program.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug Something isn't working
Projects
None yet
Development

Successfully merging a pull request may close this issue.

3 participants