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

Make k6 builds portable by default #545

Closed
na-- opened this issue Mar 18, 2018 · 1 comment · Fixed by #658
Closed

Make k6 builds portable by default #545

na-- opened this issue Mar 18, 2018 · 1 comment · Fixed by #658

Comments

@na--
Copy link
Member

na-- commented Mar 18, 2018

Builds of k6 created manually via go get -u github.com/loadimpact/k6 or go build -a github.com/loadimpact/k6 refuse to run on other machines that don't have the k6 code checked out exactly where it was on the build machine. That's the error:

panic: could not locate box "lib"

goroutine 1 [running]:
github.com/loadimpact/k6/vendor/github.com/GeertJohan/go%2erice.MustFindBox(0xc331c9, 0x3, 0x8deabf)
	/go/path/on/system/src/github.com/loadimpact/k6/vendor/github.com/GeertJohan/go.rice/box.go:110 +0x97

Even the following is enough to reproduce the issue:

go get -u github.com/loadimpact/k6
"$GOPATH/bin/k6" # this runs without issues
mv "$GOPATH/src/github.com/loadimpact/k6" "$GOPATH/src/github.com/loadimpact/k6-moved"
"$GOPATH/bin/k6" # this fails

Looks like some of the static resources are not properly embedded...
Reported by vtanakas on slack

@na-- na-- changed the title Manual k6 build refuses to run without source Make k6 builds portable by default Mar 19, 2018
@na-- na-- added this to the v0.21.0 milestone Mar 19, 2018
@na--
Copy link
Member Author

na-- commented Mar 19, 2018

Turns out that this is working as intended at the moment, but we'll still try and "fix" (i.e. improve) it in the next release.

At the moment k6 works when directly built from source with go get/build/install only when executed on the same machine, since it tries to load the JavaScript libraries it uses from their folders in the git repo. Building fully portable binaries is currently done with the build-release.sh script, which first builds the executable files and then uses go.rice to bundle the static resources in them.

This mostly works, but it's far from optimal. For sure it breaks Go developers' expectations how Go applications should be built. Therefore for the next release we'll shift the burden of bundling the JS libraries to the maintainers (probably via go generate, the other go.rice mode and CI checks) and make the simple go get/build/install builds fully portable by default.

@robingustafsson robingustafsson modified the milestones: v0.21.0, v1.0.0 May 23, 2018
luizbafilho added a commit that referenced this issue Jun 4, 2018
@na-- na-- removed this from the v1.0.0 milestone Jul 13, 2020
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

Successfully merging a pull request may close this issue.

2 participants