-
Notifications
You must be signed in to change notification settings - Fork 2.2k
[1.3] Embed version from VERSION file #4744
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
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> (cherry picked from commit d54eaaf) 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> (cherry picked from commit c12c99b) Signed-off-by: Kir Kolyshkin <kolyshkin@gmail.com>
What is the reason to apply this in 1.3? I understand we consider it not so risky, I'm not completely against this (although being so close to the release date, I think the risk is much higher), but why do we want this in 1.3? |
Some builders (I've seen it once in moby if I'm not mistaken) don't use runc Makefile to build runc, and they use With this change, version will always be available, so I consider it is an improvement worth having in v1.3, and the risk is low. |
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 EXTRA_VERSION
continues to work, I'm okay with this in 1.3.
@opencontainers/runc-maintainers Once we make a decision on this PR, I'll prepare the 1.3.0 release. |
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
This is a backport of #4718 to release-1.3 branch. Original description follows.
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: