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

Failed to install k6 binary with go get -u #1967

Closed
heww opened this issue Apr 15, 2021 · 2 comments
Closed

Failed to install k6 binary with go get -u #1967

heww opened this issue Apr 15, 2021 · 2 comments
Labels

Comments

@heww
Copy link

heww commented Apr 15, 2021

Environment

  • k6 version: master
  • OS and version: Ubuntu 20.04
  • Golang version: 1.15.6
  • Docker version and image, if applicable:

Expected Behavior

Run GO111MODULE=on go get -u github.com/loadimpact/k6 to install k6 in golang bin path success

Actual Behavior

Install failed and get error

go: github.com/serenize/snaker upgrade => v0.0.0-20201027110005-a7ad2135616e
go: github.com/klauspost/compress upgrade => v1.12.1
go: github.com/gorilla/context upgrade => v1.1.1
go: github.com/influxdata/influxdb1-client upgrade => v0.0.0-20200827194710-b269163b24ab
go: github.com/gin-contrib/sse upgrade => v0.1.0
go: github.com/andybalholm/cascadia upgrade => v1.2.0
go: golang.org/x/net upgrade => v0.0.0-20210414194228-064579744ee0
go: github.com/davecgh/go-spew upgrade => v1.1.1
go: github.com/gorilla/mux upgrade => v1.8.0
go: golang.org/x/time upgrade => v0.0.0-20210220033141-f8bda1e9f3ba
go: github.com/mitchellh/mapstructure upgrade => v1.4.1
go: gopkg.in/guregu/null.v3 upgrade => v3.5.0
go: github.com/Shopify/sarama upgrade => v1.28.0
go: github.com/PuerkitoBio/goquery upgrade => v1.6.1
go: github.com/tidwall/match upgrade => v1.0.3
go: github.com/konsorten/go-windows-terminal-sequences upgrade => v1.0.3
go: github.com/pierrec/lz4 upgrade => v2.6.0+incompatible
go: github.com/kardianos/osext upgrade => v0.0.0-20190222173326-2bc1f35cddc0
go: finding module for package github.com/Microsoft/go-winio
go: downloading github.com/json-iterator/go v1.1.9
go: found github.com/Microsoft/go-winio in github.com/Microsoft/go-winio v0.4.17
go: github.com/json-iterator/go upgrade => v1.1.10
go: github.com/leodido/go-urn upgrade => v1.2.1
go: github.com/go-playground/validator/v10 upgrade => v10.5.0
go: github.com/hashicorp/go-uuid upgrade => v1.0.2
go: golang.org/x/term upgrade => v0.0.0-20210406210042-72f3dc4e9b72
go: github.com/modern-go/concurrent upgrade => v0.0.0-20180306012644-bacd9c7ef1dd
go: github.com/modern-go/reflect2 upgrade => v1.0.1
# github.com/loadimpact/k6/loader
/home/ubuntu/go/1.15.6/pkg/mod/github.com/loadimpact/[email protected]/loader/filesystems.go:42:8: cannot use fsext.NewTrimFilePathSeparatorFs(osfs) (type *fsext.ChangePathFs) as type afero.Fs in assignment:
        *fsext.ChangePathFs does not implement afero.Fs (missing Chown method)

Steps to Reproduce the Problem

  1. GO111MODULE=on go get -u github.com/loadimpact/k6
@heww heww added the bug label Apr 15, 2021
@na--
Copy link
Member

na-- commented Apr 15, 2021

go get -u github.com/loadimpact/k6 tries to get both the latest k6 version, but also tries to update all of the dependencies k6 has to their latest version as well, see https://golang.org/pkg/cmd/go/internal/get/

The -u flag instructs get to use the network to update the named packages and their dependencies. By default, get uses the network to check out missing packages but does not use it to look for updates to existing packages.

We have explicitly pinned our dependencies precisely because we're reasonably sure their current versions work, but we can't guarantee that future versions won't have breaking changes, which seems to be the case here. We had a bit of a dependency update spree recently and a discussion about that, see #1933

So, instead, you should do something like this: go get github.com/loadimpact/k6@latest, to get the latest stable version of k6, or go get github.com/loadimpact/k6@master to get the bleeding-edge unreleased features in master. That is, without the -u flag.

Or, if you upgrade to Go 1.16 and above, you could actually use the even better go install github.com/loadimpact/k6@latest or go install github.com/loadimpact/k6@master, see https://golang.org/doc/go1.16#go-command

I'll leave this issue open, since we probably should explain this better in the README

@na-- na-- added docs and removed bug labels Apr 15, 2021
@mstoykov
Copy link
Contributor

Given that go get is no longer supposed to be used, we now advertise go install in the README and 1.16 is soon to stop being supported, so most users will be using it already - I am closing this issue.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Projects
None yet
Development

No branches or pull requests

3 participants