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

xk6 failing to build due to missing 3rd party dependencies #49

Closed
agilob opened this issue Sep 28, 2022 · 7 comments
Closed

xk6 failing to build due to missing 3rd party dependencies #49

agilob opened this issue Sep 28, 2022 · 7 comments

Comments

@agilob
Copy link

agilob commented Sep 28, 2022

I dont know if you manage these in grafana or k6, but this is happening since yesterday

❯ ./xk6 build
2022/09/28 09:39:40 [INFO] Temporary folder: /tmp/buildenv_2022-09-28-0939.48910491
2022/09/28 09:39:40 [INFO] Initializing Go module
2022/09/28 09:39:40 [INFO] exec (timeout=10s): /usr/bin/go mod init k6
go: creating new go.mod: module k6
2022/09/28 09:39:40 [INFO] Pinning versions
2022/09/28 09:39:40 [INFO] exec (timeout=0s): /usr/bin/go mod tidy -compat=1.17
go: warning: "all" matched no packages
2022/09/28 09:39:40 [INFO] Writing main module: /tmp/buildenv_2022-09-28-0939.48910491/main.go
2022/09/28 09:39:40 [INFO] exec (timeout=0s): /usr/bin/go mod tidy -compat=1.17
go: finding module for package go.k6.io/k6/cmd
go: found go.k6.io/k6/cmd in go.k6.io/k6 v0.40.0
go: finding module for package github.com/spf13/afero
go: finding module for package github.com/mailru/easyjson
go: finding module for package github.com/Soontao/goHttpDigestClient
go: finding module for package github.com/spf13/pflag
go: finding module for package github.com/davecgh/go-spew/spew
go: finding module for package github.com/oxtoacart/bpool
go: finding module for package github.com/go-sourcemap/sourcemap
go: finding module for package github.com/mailru/easyjson/jlexer
go: finding module for package gopkg.in/guregu/null.v3
go: finding module for package github.com/mailru/easyjson/jwriter
go: found github.com/spf13/afero in github.com/spf13/afero v1.9.2
go: found gopkg.in/guregu/null.v3 in gopkg.in/guregu/null.v3 v3.5.0
go: finding module for package github.com/spf13/pflag
go: finding module for package github.com/mailru/easyjson/jwriter
go: finding module for package github.com/mailru/easyjson/jlexer
go: finding module for package github.com/davecgh/go-spew/spew
go: finding module for package github.com/mailru/easyjson
go: finding module for package github.com/go-sourcemap/sourcemap
go: finding module for package github.com/oxtoacart/bpool
go: finding module for package github.com/Soontao/goHttpDigestClient
k6 imports
        go.k6.io/k6/cmd imports
        github.com/spf13/pflag: module github.com/spf13/pflag@latest found (v1.0.5), but does not contain package github.com/spf13/pflag
k6 imports
        go.k6.io/k6/cmd imports
        go.k6.io/k6/cloudapi imports
        github.com/mailru/easyjson: module github.com/mailru/easyjson@latest found (v0.7.7), but does not contain package github.com/mailru/easyjson
k6 imports
        go.k6.io/k6/cmd imports
        go.k6.io/k6/cloudapi imports
        github.com/mailru/easyjson/jlexer: module github.com/mailru/easyjson@latest found (v0.7.7), but does not contain package github.com/mailru/easyjson/jlexer
k6 imports
        go.k6.io/k6/cmd imports
        go.k6.io/k6/cloudapi imports
        github.com/mailru/easyjson/jwriter: module github.com/mailru/easyjson@latest found (v0.7.7), but does not contain package github.com/mailru/easyjson/jwriter
k6 imports
        go.k6.io/k6/cmd imports
        go.k6.io/k6/js imports
        github.com/oxtoacart/bpool: module github.com/oxtoacart/bpool@latest found (v0.0.0-20190530202638-03653db5a59c), but does not contain package github.com/oxtoacart/bpool
k6 imports
        go.k6.io/k6/cmd imports
        go.k6.io/k6/js imports
        go.k6.io/k6/js/compiler imports
        github.com/go-sourcemap/sourcemap: package github.com/go-sourcemap/sourcemap provided by github.com/go-sourcemap/sourcemap at latest version v2.1.3+incompatible but not at required version v2.1.4-0.20211119122758-180fcef48034+incompatible
k6 imports
        go.k6.io/k6/cmd imports
        go.k6.io/k6/output/cloud imports
        go.k6.io/k6/lib/netext/httpext imports
        github.com/Soontao/goHttpDigestClient: module github.com/Soontao/goHttpDigestClient@latest found (v0.0.0-20170320082612-6d28bb1415c5), but does not contain package github.com/Soontao/goHttpDigestClient
k6 imports
        go.k6.io/k6/cmd tested by
        go.k6.io/k6/cmd.test imports
        github.com/stretchr/testify/assert imports
        github.com/davecgh/go-spew/spew: module github.com/davecgh/go-spew@latest found (v1.1.1), but does not contain package github.com/davecgh/go-spew/spew
2022/09/28 09:39:42 [INFO] Cleaning up temporary folder: /tmp/buildenv_2022-09-28-0939.48910491
2022/09/28 09:39:42 [FATAL] exit status 1
@mstoykov
Copy link
Contributor

Hi, thanks for reporting 🙇

This seems like something is wrong with your machine resolving the dependencies. I definitely can't reproduce it. Both with go1.18.6 and 1.19.1

Can you provide go env output? And maybe if you can think of anything that has changed since yesterday?

Also, xk6 build does not build in the local extension it just builds k6 which is likely not what you want 🤔 ?

@agilob
Copy link
Author

agilob commented Sep 28, 2022

❯ go env
GO111MODULE=""
GOARCH="amd64"
GOBIN=""
GOCACHE="/home/agilob/.cache/go-build"
GOENV="/home/agilob/.config/go/env"
GOEXE=""
GOEXPERIMENT=""
GOFLAGS=""
GOHOSTARCH="amd64"
GOHOSTOS="linux"
GOINSECURE=""
GOMODCACHE="/home/agilob/go/pkg/mod"
GONOPROXY=""
GONOSUMDB=""
GOOS="linux"
GOPATH="/home/agilob/go"
GOPRIVATE=""
GOPROXY="https://proxy.golang.org,direct"
GOROOT="/usr/lib/go"
GOSUMDB="sum.golang.org"
GOTMPDIR=""
GOTOOLDIR="/usr/lib/go/pkg/tool/linux_amd64"
GOVCS=""
GOVERSION="go1.19.1"
GCCGO="gccgo"
GOAMD64="v1"
AR="ar"
CC="gcc"
CXX="g++"
CGO_ENABLED="1"
GOMOD="/dev/null"
GOWORK=""
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 -Wl,--no-gc-sections -fmessage-length=0 -fdebug-prefix-map=/tmp/go-build3095097441=/tmp/go-build -gno-record-gcc-switches"

Also, xk6 build does not build in the local extension it just builds k6 which is likely not what you want thinking ?

Yes, I know what, building with extensions also doesn't work 👀

We need a k6 build using go 1.19.1 which isn't provided yet in official docker images, but that tooling is used for k6 binary on mac and linux. I was thinking if you should standardise go version for containers and binaries.

❯ ./xk6 build v0.40.0 --with github.com/tmieulet/xk6-cognito
2022/09/28 10:07:14 [INFO] Temporary folder: /tmp/buildenv_2022-09-28-1007.2930389991
2022/09/28 10:07:14 [INFO] Initializing Go module
2022/09/28 10:07:14 [INFO] exec (timeout=10s): /usr/bin/go mod init k6
go: creating new go.mod: module k6
2022/09/28 10:07:14 [INFO] Pinning versions
2022/09/28 10:07:14 [INFO] exec (timeout=0s): /usr/bin/go mod edit -require github.com/tmieulet/xk6-cognito@latest
2022/09/28 10:07:14 [INFO] exec (timeout=0s): /usr/bin/go mod tidy -compat=1.17
go: downloading github.com/tmieulet/xk6-cognito v0.0.1
go: finding module for package go.k6.io/k6/js/modules
go: finding module for package github.com/aws/aws-sdk-go-v2/service/cognitoidentityprovider
go: finding module for package github.com/aws/aws-sdk-go-v2/config
go: finding module for package github.com/aws/aws-sdk-go-v2/service/cognitoidentityprovider/types
go: finding module for package github.com/alexrudd/cognito-srp/v4
go: finding module for package github.com/aws/aws-sdk-go-v2/aws
go: downloading github.com/aws/aws-sdk-go-v2/service/cognitoidentityprovider v1.20.1
go: downloading github.com/aws/aws-sdk-go-v2/config v1.17.7
go: downloading github.com/aws/aws-sdk-go-v2 v1.16.16
go: downloading github.com/alexrudd/cognito-srp/v4 v4.1.0
go: downloading github.com/alexrudd/cognito-srp v0.0.0-20190402174326-7bb6280c912c
go: found github.com/alexrudd/cognito-srp/v4 in github.com/alexrudd/cognito-srp/v4 v4.1.0
go: found github.com/aws/aws-sdk-go-v2/aws in github.com/aws/aws-sdk-go-v2 v1.16.16
go: found github.com/aws/aws-sdk-go-v2/config in github.com/aws/aws-sdk-go-v2/config v1.17.7
go: found github.com/aws/aws-sdk-go-v2/service/cognitoidentityprovider in github.com/aws/aws-sdk-go-v2/service/cognitoidentityprovider v1.20.1
go: found github.com/aws/aws-sdk-go-v2/service/cognitoidentityprovider/types in github.com/aws/aws-sdk-go-v2/service/cognitoidentityprovider v1.20.1
go: found go.k6.io/k6/js/modules in go.k6.io/k6 v0.40.0
go: downloading github.com/aws/smithy-go v1.13.3
go: downloading github.com/aws/aws-sdk-go-v2/credentials v1.12.20
go: downloading github.com/google/go-cmp v0.5.8
go: downloading github.com/aws/aws-sdk-go-v2/feature/ec2/imds v1.12.17
go: downloading github.com/aws/aws-sdk-go-v2/internal/ini v1.3.24
go: downloading github.com/aws/aws-sdk-go-v2/service/sso v1.11.23
go: downloading github.com/aws/aws-sdk-go-v2/internal/configsources v1.1.23
go: downloading github.com/aws/aws-sdk-go-v2/service/ssooidc v1.13.5
go: downloading github.com/aws/aws-sdk-go-v2/service/sts v1.16.19
go: downloading gopkg.in/yaml.v2 v2.2.8
go: downloading github.com/aws/aws-sdk-go-v2/internal/endpoints/v2 v2.4.17
go: downloading github.com/aws/aws-sdk-go-v2/service/internal/presigned-url v1.9.17
go: finding module for package github.com/spf13/afero
go: finding module for package github.com/go-sourcemap/sourcemap
go: finding module for package github.com/onsi/gomega
go: finding module for package gopkg.in/guregu/null.v3
go: finding module for package github.com/davecgh/go-spew/spew
go: finding module for package github.com/oxtoacart/bpool
go: finding module for package github.com/mailru/easyjson/jwriter
go: finding module for package github.com/onsi/ginkgo
go: downloading github.com/onsi/gomega v1.20.2
go: found github.com/spf13/afero in github.com/spf13/afero v1.9.2
go: found gopkg.in/guregu/null.v3 in gopkg.in/guregu/null.v3 v3.5.0
go: found github.com/onsi/ginkgo in github.com/onsi/ginkgo v1.16.5
go: found github.com/onsi/gomega in github.com/onsi/gomega v1.20.2
go: downloading golang.org/x/sys v0.0.0-20220722155257-8c9f86f7a55f
go: downloading golang.org/x/net v0.0.0-20220722155237-a158d28d115b
go: downloading google.golang.org/protobuf v1.28.0
go: finding module for package github.com/go-sourcemap/sourcemap
go: finding module for package github.com/davecgh/go-spew/spew
go: finding module for package github.com/mailru/easyjson/jwriter
go: finding module for package github.com/oxtoacart/bpool
k6 imports
        github.com/tmieulet/xk6-cognito imports
        go.k6.io/k6/js/modules imports
        go.k6.io/k6/lib imports
        github.com/oxtoacart/bpool: module github.com/oxtoacart/bpool@latest found (v0.0.0-20190530202638-03653db5a59c), but does not contain package github.com/oxtoacart/bpool
k6 imports
        github.com/tmieulet/xk6-cognito imports
        go.k6.io/k6/js/modules imports
        github.com/dop251/goja imports
        github.com/dop251/goja/file imports
        github.com/go-sourcemap/sourcemap: package github.com/go-sourcemap/sourcemap provided by github.com/go-sourcemap/sourcemap at latest version v2.1.3+incompatible but not at required version v2.1.4-0.20211119122758-180fcef48034+incompatible
k6 imports
        github.com/tmieulet/xk6-cognito imports
        go.k6.io/k6/js/modules imports
        go.k6.io/k6/js/common imports
        go.k6.io/k6/metrics imports
        github.com/mailru/easyjson/jwriter: module github.com/mailru/easyjson@latest found (v0.7.7), but does not contain package github.com/mailru/easyjson/jwriter
k6 imports
        github.com/tmieulet/xk6-cognito imports
        go.k6.io/k6/js/modules imports
        go.k6.io/k6/js/common tested by
        go.k6.io/k6/js/common.test imports
        github.com/stretchr/testify/assert imports
        github.com/davecgh/go-spew/spew: module github.com/davecgh/go-spew@latest found (v1.1.1), but does not contain package github.com/davecgh/go-spew/spew
2022/09/28 10:08:06 [INFO] Cleaning up temporary folder: /tmp/buildenv_2022-09-28-1007.2930389991
2022/09/28 10:08:06 [FATAL] exit status 1

@mstoykov
Copy link
Contributor

Can you try to run go mod -cleancache ?

Again locally this works for me with no problems and the error sounds as some kind of corruption.

@agilob
Copy link
Author

agilob commented Sep 28, 2022

❯ go mod cleancache
go mod cleancache: unknown command
Run 'go help mod' for usage.
❯ go mod -cleancache
go mod -cleancache: unknown command
Run 'go help mod' for usage.
❯ go mod --cleancache
go mod --cleancache: unknown command
Run 'go help mod' for usage.
❯ go help mod
Go mod provides access to operations on modules.

Note that support for modules is built into all the go commands,
not just 'go mod'. For example, day-to-day adding, removing, upgrading,
and downgrading of dependencies should be done using 'go get'.
See 'go help modules' for an overview of module functionality.

Usage:

        go mod <command> [arguments]

The commands are:

        download    download modules to local cache
        edit        edit go.mod from tools or scripts
        graph       print module requirement graph
        init        initialize new module in current directory
        tidy        add missing and remove unused modules
        vendor      make vendored copy of dependencies
        verify      verify dependencies have expected content
        why         explain why packages or modules are needed

Use "go help mod <command>" for more information about a command.

So I removed all caches and started from 0:

❯ sudo rm go -fr
❯ go install go.k6.io/xk6/cmd/xk6@latest
go: downloading go.k6.io/xk6 v0.7.0
go: downloading github.com/Masterminds/semver/v3 v3.1.1
❯ cd go/bin
❯ l
total 4.3M
drwxr-xr-x 2 agilob users 4.0K Sep 28 10:56 .
drwxr-xr-x 4 agilob users 4.0K Sep 28 10:56 ..
-rwxr-xr-x 1 agilob users 4.3M Sep 28 10:56 xk6
❯ ./xk6 build v0.40.0 --with github.com/tmieulet/xk6-cognito
2022/09/28 10:56:18 [INFO] Temporary folder: /tmp/buildenv_2022-09-28-1056.697840031
2022/09/28 10:56:18 [INFO] Initializing Go module
2022/09/28 10:56:18 [INFO] exec (timeout=10s): /usr/bin/go mod init k6
go: creating new go.mod: module k6
2022/09/28 10:56:18 [INFO] Pinning versions
2022/09/28 10:56:18 [INFO] exec (timeout=0s): /usr/bin/go mod edit -require github.com/tmieulet/xk6-cognito@latest
2022/09/28 10:56:18 [INFO] exec (timeout=0s): /usr/bin/go mod tidy -compat=1.17
go: downloading github.com/tmieulet/xk6-cognito v0.0.1
go: finding module for package go.k6.io/k6/js/modules
go: finding module for package github.com/aws/aws-sdk-go-v2/aws
go: finding module for package github.com/alexrudd/cognito-srp/v4
go: finding module for package github.com/aws/aws-sdk-go-v2/service/cognitoidentityprovider
go: finding module for package github.com/aws/aws-sdk-go-v2/service/cognitoidentityprovider/types
go: finding module for package github.com/aws/aws-sdk-go-v2/config
go: downloading github.com/alexrudd/cognito-srp v0.0.0-20190402174326-7bb6280c912c
go: downloading go.k6.io/k6 v0.40.0
go: downloading github.com/aws/aws-sdk-go-v2/service/cognitoidentityprovider v1.20.1
go: downloading github.com/aws/aws-sdk-go-v2/config v1.17.7
go: downloading github.com/alexrudd/cognito-srp/v4 v4.1.0
go: downloading github.com/aws/aws-sdk-go-v2 v1.16.16
go: found github.com/alexrudd/cognito-srp/v4 in github.com/alexrudd/cognito-srp/v4 v4.1.0
go: found github.com/aws/aws-sdk-go-v2/aws in github.com/aws/aws-sdk-go-v2 v1.16.16
go: found github.com/aws/aws-sdk-go-v2/config in github.com/aws/aws-sdk-go-v2/config v1.17.7
go: found github.com/aws/aws-sdk-go-v2/service/cognitoidentityprovider in github.com/aws/aws-sdk-go-v2/service/cognitoidentityprovider v1.20.1
go: found github.com/aws/aws-sdk-go-v2/service/cognitoidentityprovider/types in github.com/aws/aws-sdk-go-v2/service/cognitoidentityprovider v1.20.1
go: found go.k6.io/k6/js/modules in go.k6.io/k6 v0.40.0
go: downloading github.com/dop251/goja v0.0.0-20220815083517-0c74f9139fd6
go: downloading github.com/aws/smithy-go v1.13.3
go: downloading github.com/aws/aws-sdk-go-v2/credentials v1.12.20
go: downloading github.com/aws/aws-sdk-go-v2/feature/ec2/imds v1.12.17
go: downloading github.com/aws/aws-sdk-go-v2/internal/ini v1.3.24
go: downloading github.com/aws/aws-sdk-go-v2/service/sso v1.11.23
go: downloading github.com/aws/aws-sdk-go-v2/service/ssooidc v1.13.5
go: downloading github.com/aws/aws-sdk-go-v2/service/sts v1.16.19
go: downloading github.com/aws/aws-sdk-go-v2/internal/configsources v1.1.23
go: downloading github.com/google/go-cmp v0.5.8
go: downloading github.com/serenize/snaker v0.0.0-20201027110005-a7ad2135616e
go: downloading github.com/sirupsen/logrus v1.8.1
go: downloading github.com/stretchr/testify v1.8.0
go: downloading github.com/spf13/afero v1.1.2
go: downloading github.com/oxtoacart/bpool v0.0.0-20190530202638-03653db5a59c
go: downloading golang.org/x/time v0.0.0-20220609170525-579cf78fd858
go: downloading gopkg.in/guregu/null.v3 v3.3.0
go: downloading github.com/mstoykov/envconfig v1.4.1-0.20220114105314-765c6d8c76f1
go: downloading github.com/aws/aws-sdk-go-v2/internal/endpoints/v2 v2.4.17
go: downloading github.com/mailru/easyjson v0.7.7
go: downloading github.com/fatih/color v1.13.0
go: downloading github.com/aws/aws-sdk-go-v2/service/internal/presigned-url v1.9.17
go: downloading github.com/dlclark/regexp2 v1.7.0
go: downloading golang.org/x/text v0.3.7
go: downloading gopkg.in/yaml.v2 v2.2.8
go: downloading github.com/andybalholm/brotli v1.0.4
go: downloading github.com/gorilla/websocket v1.5.0
go: downloading github.com/klauspost/compress v1.15.7
go: downloading github.com/mccutchen/go-httpbin v1.1.2-0.20190116014521-c5cb2f4802fa
go: downloading golang.org/x/net v0.0.0-20220630215102-69896b714898
go: downloading google.golang.org/grpc v1.47.0
go: downloading github.com/go-sourcemap/sourcemap v2.1.4-0.20211119122758-180fcef48034+incompatible
go: downloading github.com/davecgh/go-spew v1.1.1
go: downloading github.com/pmezard/go-difflib v1.0.0
go: downloading gopkg.in/yaml.v3 v3.0.1
go: downloading golang.org/x/sys v0.0.0-20220520151302-bc2c85ada10a
go: downloading github.com/mattn/go-colorable v0.1.12
go: downloading github.com/mattn/go-isatty v0.0.14
go: downloading golang.org/x/crypto v0.0.0-20220622213112-05595931fe9d
go: downloading google.golang.org/protobuf v1.27.1
go: downloading google.golang.org/genproto v0.0.0-20210604141403-392c879c8b08
go: downloading github.com/golang/protobuf v1.5.2
go: downloading gopkg.in/yaml.v2 v2.4.0
go: finding module for package gopkg.in/guregu/null.v3
go: finding module for package github.com/onsi/ginkgo
go: finding module for package github.com/spf13/afero
go: finding module for package github.com/davecgh/go-spew/spew
go: finding module for package github.com/oxtoacart/bpool
go: finding module for package github.com/go-sourcemap/sourcemap
go: finding module for package github.com/mailru/easyjson/jwriter
go: finding module for package github.com/onsi/gomega
go: downloading github.com/onsi/ginkgo v1.16.5
go: downloading github.com/onsi/gomega v1.20.2
go: downloading gopkg.in/guregu/null.v3 v3.5.0
go: downloading github.com/spf13/afero v1.9.2
go: downloading github.com/go-sourcemap/sourcemap v2.1.3+incompatible
go: found github.com/spf13/afero in github.com/spf13/afero v1.9.2
go: found gopkg.in/guregu/null.v3 in gopkg.in/guregu/null.v3 v3.5.0
go: found github.com/onsi/ginkgo in github.com/onsi/ginkgo v1.16.5
go: found github.com/onsi/gomega in github.com/onsi/gomega v1.20.2
go: downloading golang.org/x/sys v0.0.0-20220722155257-8c9f86f7a55f
go: downloading github.com/nxadm/tail v1.4.8
go: downloading golang.org/x/net v0.0.0-20220722155237-a158d28d115b
go: downloading google.golang.org/protobuf v1.28.0
go: downloading gopkg.in/tomb.v1 v1.0.0-20141024135613-dd632973f1e7
go: downloading github.com/fsnotify/fsnotify v1.4.9
go: finding module for package github.com/davecgh/go-spew/spew
go: finding module for package github.com/mailru/easyjson/jwriter
go: finding module for package github.com/oxtoacart/bpool
go: finding module for package github.com/go-sourcemap/sourcemap
k6 imports
        github.com/tmieulet/xk6-cognito imports
        go.k6.io/k6/js/modules imports
        go.k6.io/k6/lib imports
        github.com/oxtoacart/bpool: module github.com/oxtoacart/bpool@latest found (v0.0.0-20190530202638-03653db5a59c), but does not contain package github.com/oxtoacart/bpool
k6 imports
        github.com/tmieulet/xk6-cognito imports
        go.k6.io/k6/js/modules imports
        github.com/dop251/goja imports
        github.com/dop251/goja/file imports
        github.com/go-sourcemap/sourcemap: package github.com/go-sourcemap/sourcemap provided by github.com/go-sourcemap/sourcemap at latest version v2.1.3+incompatible but not at required version v2.1.4-0.20211119122758-180fcef48034+incompatible
k6 imports
        github.com/tmieulet/xk6-cognito imports
        go.k6.io/k6/js/modules imports
        go.k6.io/k6/js/common imports
        go.k6.io/k6/metrics imports
        github.com/mailru/easyjson/jwriter: module github.com/mailru/easyjson@latest found (v0.7.7), but does not contain package github.com/mailru/easyjson/jwriter
k6 imports
        github.com/tmieulet/xk6-cognito imports
        go.k6.io/k6/js/modules imports
        go.k6.io/k6/js/common tested by
        go.k6.io/k6/js/common.test imports
        github.com/stretchr/testify/assert imports
        github.com/davecgh/go-spew/spew: module github.com/davecgh/go-spew@latest found (v1.1.1), but does not contain package github.com/davecgh/go-spew/spew
2022/09/28 10:57:47 [INFO] Cleaning up temporary folder: /tmp/buildenv_2022-09-28-1056.697840031
2022/09/28 10:57:47 [FATAL] exit status 1

@mstoykov
Copy link
Contributor

🤦 I did write the commadn by hand and it was go clean -modcache not how I slapped the words 🤦

I have now spend probably over 2 hours, trying to reproduce this. Including on arch (I guess you are on it based on other threads) and I can not reproduce it this at all. I tried older version of xk6, different go versions - nothing.

I can tell you that the

go: finding module for package github.com/davecgh/go-spew/spew
go: finding module for package github.com/mailru/easyjson/jwriter
go: finding module for package github.com/oxtoacart/bpool
go: finding module for package github.com/go-sourcemap/sourcemap

Is at all not present in any of the outputs I had - the rest (up to that point) look similar apart from some lines being swapped - likely to go doing downloads in parallel.

Given that I have no way to reproduce it and that I have no other questions to try to tease this out I will have to wait for more info on how to reproduce it before I proceed.

Again this looks like some kind of go cache corruption, But what you did should've fixed that.

I guess you can try to git clone the extension and do go build . to see if that works 🤷

@agilob
Copy link
Author

agilob commented Sep 28, 2022

I compiled it fine on mac 👀 Has to be something local then. I'm closing this and will update if I fix it

@agilob agilob closed this as completed Sep 28, 2022
@agilob
Copy link
Author

agilob commented Oct 7, 2022

Magically working today...

❯ ./xk6 build v0.40.0
2022/10/07 16:10:54 [INFO] Temporary folder: /tmp/buildenv_2022-10-07-1610.1139569771
2022/10/07 16:10:54 [INFO] Initializing Go module
2022/10/07 16:10:54 [INFO] exec (timeout=10s): /usr/bin/go mod init k6
go: creating new go.mod: module k6
2022/10/07 16:10:54 [INFO] Pinning versions
2022/10/07 16:10:54 [INFO] exec (timeout=0s): /usr/bin/go mod tidy -compat=1.17
go: warning: "all" matched no packages
2022/10/07 16:10:54 [INFO] Writing main module: /tmp/buildenv_2022-10-07-1610.1139569771/main.go
2022/10/07 16:10:54 [INFO] exec (timeout=0s): /usr/bin/go mod edit -require go.k6.io/k6@v0.40.0
2022/10/07 16:10:54 [INFO] exec (timeout=0s): /usr/bin/go mod tidy -compat=1.17
2022/10/07 16:10:54 [INFO] exec (timeout=0s): /usr/bin/go mod tidy -compat=1.17
2022/10/07 16:10:54 [INFO] Build environment ready
2022/10/07 16:10:54 [INFO] Building k6
2022/10/07 16:10:54 [INFO] exec (timeout=0s): /usr/bin/go mod tidy -compat=1.17
2022/10/07 16:10:54 [INFO] exec (timeout=0s): /usr/bin/go build -o /home/agilob/go/bin/k6 -ldflags -w -s -trimpath
2022/10/07 16:11:07 [INFO] Build complete: ./k6
2022/10/07 16:11:07 [INFO] Cleaning up temporary folder: /tmp/buildenv_2022-10-07-1610.1139569771

xk6 has now produced a new k6 binary which may be different than the command on your system path!
Be sure to run './k6 run <SCRIPT_NAME>' from the '/home/agilob/go/bin' directory.

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

No branches or pull requests

2 participants