Embed version from VERSION#4718
Merged
kolyshkin merged 2 commits intoopencontainers:mainfrom Apr 23, 2025
Merged
Conversation
akhilerm
approved these changes
Apr 9, 2025
Contributor
akhilerm
left a comment
There was a problem hiding this comment.
LGTM. Since the output doesnt change. Works well for my use cases.
538b209 to
0978d71
Compare
Contributor
Author
|
@cyphar @thaJeztah PTAL |
AkihiroSuda
approved these changes
Apr 22, 2025
cyphar
approved these changes
Apr 22, 2025
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 <[email protected]>
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 <[email protected]>
0978d71 to
c12c99b
Compare
Contributor
Author
|
Let's backport it to 1.3 as well, this may help distro vendors. |
Contributor
Author
|
1.3 backport: #4744 |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
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 --versionexactly as before:The EXTRA_VERSION kludge, added by #4370, also works exactly as before: