-
Notifications
You must be signed in to change notification settings - Fork 2.2k
Embed version from VERSION #4718
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
Conversation
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
LGTM. Since the output doesnt change. Works well for my use cases.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
LGTM
538b209
to
0978d71
Compare
@cyphar @thaJeztah PTAL |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
LGTM, thanks!
Instead of setting cli.App.Version in main, let's set up cli.VersionPrinter. This way, we only get various versions when needed. Note it does not change the output of runc --version. It changes the output of runc --help though, and I think it's for the better. Before this patch: > $ runc help > ... > USAGE: > runc [global options] command [command options] [arguments...] > > VERSION: > 1.3.0-rc.1+dev > commit: v1.3.0-rc.1-93-g932e8342 > spec: 1.2.1 > go: go1.24.2 > libseccomp: 2.5.5 > > COMMANDS: > checkpoint checkpoint a running container > ... After: > $ runc help > ... > USAGE: > runc [global options] command [command options] [arguments...] > > VERSION: > 1.3.0-rc.1+dev > > COMMANDS: > checkpoint checkpoint a running container > ... Signed-off-by: Kir Kolyshkin <kolyshkin@gmail.com>
This ensures that if runc is built without the provided Makefile, the version is still properly set. No change in the output. Signed-off-by: Kir Kolyshkin <kolyshkin@gmail.com>
0978d71
to
c12c99b
Compare
Let's backport it to 1.3 as well, this may help distro vendors. |
1.3 backport: #4744 |
This is a carry/rework of #3163.
See individual commits for details.
Aside from embedding VERSION file into the binary, it simplifies the output of
runc help
.Before:
After:
The full version info is still shown by
runc --version
exactly as before:The EXTRA_VERSION kludge, added by #4370, also works exactly as before: