-
Notifications
You must be signed in to change notification settings - Fork 40
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
'govvv -flags -pkg' not working properly? #19
Comments
This is odd. What if you build govvv with go1.12 and use the one you built? I can't really imagine what in Go 1.11 or 1.12 would be breaking this, so any help debugging is appreciated. |
I've basically wiped govvv out and re-fetched it. Everything seems okay? I'm going to close this out but maybe it'll help someone else who encounters a similar issue.. $ rm $(which govvv)
$ which govvv
govvv not found
$ go install github.com/ahmetb/govvv
$ govvv -flags -pkg $(govvv list ./cmd)
-X github.com/stgarf/paperless-cli/cmd.BuildDate=2019-03-14T05:00:08Z -X github.com/stgarf/paperless-cli/cmd.GitCommit=1efbc57 -X github.com/stgarf/paperless-cli/cmd.GitBranch=master -X github.com/stgarf/paperless-cli/cmd.GitState=clean -X github.com/stgarf/paperless-cli/cmd.GitSummary=1efbc57 -X github.com/stgarf/paperless-cli/cmd.Version=0.6.0%
$ govvv build -pkg $(govvv list ./cmd) -print
go build \
-ldflags \
"-X github.com/stgarf/paperless-cli/cmd.Version=0.6.0 -X github.com/stgarf/paperless-cli/cmd.BuildDate=2019-03-14T05:00:13Z -X github.com/stgarf/paperless-cli/cmd.GitCommit=1efbc57 -X github.com/stgarf/paperless-cli/cmd.GitBranch=master -X github.com/stgarf/paperless-cli/cmd.GitState=clean -X github.com/stgarf/paperless-cli/cmd.GitSummary=1efbc57"
$ ./paperless-cli version
paperless-cli v0.6.0 built on 2019-03-14T05:02:54Z from git:1efbc57-clean (master) by user@host |
I think the problem happened when tried to install with GO111MODULE=on |
This is very possible in my case as well 👍 |
Ditto -- ran into this myself, just now. Update: confirmed; removed the local updates to |
It's weird. So what should we do here? Are people not downloading the binary release and doing go-get of this repo instead to use the tool or what? |
@ahmetb: Not sure what to do -- I'm new to Go :-) If it helps, here are the VERSION=0.2.0-alpha1
VERSION_PACKAGE=$(shell go list ./util)
BUILD_FLAGS=$(shell govvv -flags -version $(VERSION) -pkg $(VERSION_PACKAGE))
build: bin
GO111MODULE=on go build -o $(BINARY) -ldflags="$(BUILD_FLAGS)"
dev-deps:
@go get github.com/ahmetb/govvv All of my other |
As a bit of sugar on top, I should mention: I love the utility and cleanliness provided by In summary: thanks! |
@ahmetb while there's a workaround it's still an annoying issue ( |
I tested this, and it happens with project that have go modules enabled. But when you set GO111MODULE=off just for this command, it seems to work. When running with GO111MODULE=on, it breaks with the |
I think that |
I had a problem where the compiler was optimizing references to |
I think this is similarly related to #17 and #18.
Anyways, some info on my environment (want to know anything else?):
Go version: 1.12
govvv version: 0.2.0
os/version: ubuntu bionic_18.04-like
🔢
Am I maybe using the tool incorrectly? I'm able to pass the "proper"
-ldflags
and the resulting binary works as I'd expect it to...and the tests are even working correctly...
(notsure)
The text was updated successfully, but these errors were encountered: