circleci-cli
circleci-cli copied to clipboard
Can't install from source
Meta:
CircleCI CLI Version:
v0.1.9578
Operating System: Void Linux with Linux 5.8.11
CircleCI CLI Diagnostic: N/A
Current behavior:
After cloning the repo, the steps to install the CLI are the following:
$ pwd
/home/gbrlsnchs/dev/pub/circleci-cli
$ make pack
$ go build -ldflags "-s -w -X github.com/CircleCI-Public/circleci-cli/version.Version=0.1.9578 -X github.com/CircleCI-Public/circleci-cli/version.Commit=cf6a918 -X github.com/CircleCI-Public/circleci-cli/version.packageManager=none" -o bin/circleci
$ cd ..
$ ./circleci-cli/bin/circleci version
The output is:
panic: stat /home/gbrlsnchs/dev/_data/data.yml: no such file or directory
goroutine 1 [running]:
github.com/CircleCI-Public/circleci-cli/cmd.MakeCommands(0xc000076058)
/home/gbrlsnchs/dev/pub/circleci-cli/cmd/root.go:87 +0xe6c
github.com/CircleCI-Public/circleci-cli/cmd.Execute()
/home/gbrlsnchs/dev/pub/circleci-cli/cmd/root.go:34 +0x25
main.main()
/home/gbrlsnchs/dev/pub/circleci-cli/main.go:9 +0x25
Expected behavior:
A working CLI.
When did this begin / Was this previously working?:
N/A
Additional Information:
I basically followed the steps from the Homebrew formulae. I don't know if I'm doing something wrong, since I couldn't find detailed information for installing from source.
Hi @gbrlsnchs – thanks for opening the bug and I'm sorry that you're having issues.
It's been a while since I worked on this code, but as far as I know that error is caused when the static data isn't included in the binary correctly.
If you run make build do you get a binary that works? If not, what architecture are you using? I wonder if the code here doesn't cover your setup: https://github.com/CircleCI-Public/circleci-cli/blob/bb01183377526e2bd0b03e26c74ffb36374b123f/.circleci/pack.sh#L15-L29
Marc
Hi, thanks for the response. I just found out what the issue was: the provided packr binary wasn't working while being silent about any possible errors. Therefore I compiled packr myself and then it worked fine.
Anyway, when I run make build, make outputs run commands:
GO111MODULE=on .circleci/pack.sh
bin/linux_amd64/packr2
go build -o build/linux/amd64/circleci
Using the provided packr, it's the same result: the binary won't work, throwing the same error as before. Even calling the provided packr binary manually results in the same error. Not sure what could be missing on my machine for the binary to not work.
Hey @gbrlsnchs, this panic:
panic: stat /home/gbrlsnchs/dev/_data/data.yml: no such file or directory
...is happening because circleci is getting built without the embedded box data that is supposed to be provided by packr2.
circleci panics when attempting to reference a file that's supposed to be present in the missing box data.
You can verify by installing packr2 using the instructions here: https://github.com/gobuffalo/packr/blob/master/v2/README.md
Then cd into the circleci source, and run:
packr2 -v
If the last line says found 0 boxes, then there's the cause of the problem. If everything was working correctly, you would see found 1 boxes within the last few lines of packr2 -v output.
Unfortunately I'm not yet sure what needs to be done to fix.
Closing as there's no answer from OP