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

konstraint -v is blank #559

Open
zephyrdb opened this issue Dec 10, 2024 · 2 comments
Open

konstraint -v is blank #559

zephyrdb opened this issue Dec 10, 2024 · 2 comments
Labels
enhancement New feature or request

Comments

@zephyrdb
Copy link
Contributor

When built as recommended in the README ('go install github.com/plexsystems/konstraint@latest'), konstraint -v has a blank version string. For it to work correctly, I need to do something like this (based on the Makefile):

go install
-ldflags="-s -w -X 'github.com/plexsystems/konstraint/internal/commands.version=${KONSTRAINT_VERSION}'"
"github.com/plexsystems/konstraint@${KONSTRAINT_VERSION}"

Could this be made to work as described in the README?

@zephyrdb
Copy link
Contributor Author

Hm, perhaps this is relevant golang/go#50603

@jalseth
Copy link
Collaborator

jalseth commented Jan 26, 2025

Yes, that's a limitation of the current approach. An alternative approach would be to have the version baked into the source, which could optionally be overridden with the linker flags.

I'd welcome a PR.

@jalseth jalseth added the enhancement New feature or request label Jan 26, 2025
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
enhancement New feature or request
Projects
None yet
Development

No branches or pull requests

2 participants