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

nctl --version just shows dev #160

Closed
rnestler opened this issue Sep 16, 2024 · 10 comments
Closed

nctl --version just shows dev #160

rnestler opened this issue Sep 16, 2024 · 10 comments

Comments

@rnestler
Copy link

Since 1.7.4 nctl --version just shows dev:

% nctl --version
dev

I guess the reason is the change in 587c14b which changes the version from var to const and thus it's not overridable at link time anymore.

@thirdeyenick
Copy link
Contributor

This issue should be fixed in #162. So with the next released version this issue should not come up again.

@thirdeyenick
Copy link
Contributor

We just released nctl v1.7.5 which fixed this issue.

@rnestler
Copy link
Author

It now shows 1.7.5-arch (commit: 11465dedde74d0764d2962f5716f31b5d68bbf82, date: 2024-09-16T15:06:16Z) on my system which is the wrong commit, since I build from the source tar ball inside a git repository, so it picks up that git commit from there.

@thde
Copy link
Member

thde commented Sep 23, 2024

Yes, that should be fixed by #165

@thirdeyenick
Copy link
Contributor

Might this issue be caused by some specific Arch Linux build steps? I can't find the commit 11465dedde74d0764d2962f5716f31b5d68bbf82 in the repository. Go does VCS stamping by default when building. That is where the output information comes from.

@thirdeyenick
Copy link
Contributor

When executing the build steps contained in the repository aur.archlinux.org/nctl.git I end up with:

$> ./nctl --version
v1.7.5-arch (commit: , date: )

I am not sure where the commit from the initial description comes from, but we should maybe not show empty commits/dates in the version output.

@thirdeyenick
Copy link
Contributor

Sorry, I now read your comment and understand that you build in a git repository. I think you could just use go build -buildvcs=false ... when building for Arch Linux to disable VCS stamping. On the other hand, we need to remove the empty commit and date output.

@rnestler
Copy link
Author

Sorry, I now read your #160 (comment) and understand that you build in a git repository.

Yes, AUR packages are just git repositories, so it picks up the git commit from the AUR package locally.

I think you could just use go build -buildvcs=false ... when building for Arch Linux to disable VCS stamping. On the other hand, we need to remove the empty commit and date output.

If I pass that flag I end up with the same output: 1.7.5-arch (commit: , date: )

@thirdeyenick
Copy link
Contributor

We just merged a commit which fixes this. So the next release of nctl should provide correct versioning information on Arch Linux (given that -buildvcs=false was used).

@rnestler
Copy link
Author

For future reference: It works correctly with the 1.8.0 release:

$ nctl --version
1.8.0-arch

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

No branches or pull requests

3 participants