fix: piped plugins display correct version information#6308
Closed
GuruOrGoru wants to merge 2 commits into
Closed
Conversation
Add version ldflags to plugin build process to inject version, git commit, and build date information during compilation. This fixes the issue where plugin binaries showed 'unspecified' for all version fields. The build/plugin target now includes the same version ldflags as the build/go target, ensuring consistency across all PipeCD binaries. Fixes pipe-cd#6305 Signed-off-by: GuruOrGoru <siddharthadhakall3722@gmail.com>
4ca8559 to
8a3c2fc
Compare
Update the plugin_release workflow to pass BUILD_VERSION, BUILD_COMMIT, and BUILD_DATE to the make build/plugin command for all platforms. This ensures that plugins built in CI also display correct version information instead of 'unspecified'. The Makefile already supports overriding these variables with ?= syntax, so both local and CI builds now work consistently. Signed-off-by: GuruOrGoru <siddharthadhakall3722@gmail.com>
Author
|
I noticed this PR is almost identical to #6307. I’m happy to close mine if you prefer, or collaborate on a single PR. |
Member
|
Thanks @GuruOrGoru , let's keep #6307 since it came first. Thank you! |
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.
What this PR does
This PR fixes an issue where piped plugins were showing "unspecified" for version, git commit, and build date information when running the
versioncommand.Problem
Currently, when downloading and running a plugin binary, the version command shows:
This happened because the plugin build process in the Makefile was not setting the necessary ldflags to inject version information during compilation.
Solution
Modified the build/plugin target in the Makefile to include version ldflags similar to how the main build/go target works. The changes add:
->
BUILD_VERSION,BUILD_COMMIT,BUILD_DATEvariables->
BUILD_LDFLAGS_PREFIXfor the version package-> Updated
BUILD_OPTSto include ldflags that inject version informationAfter the fix
Now plugin binaries will correctly display version information:
Testing
-> Built the wait plugin locally and verified the version command now shows proper information.
-> The fix maintains consistency with how main PipeCD binaries are built.
Related Issues
Fixes #6306
Changes Made
ldflagsto thebuild/plugintarget to inject version, git commit, and build date information during plugin compilation.Note: Existing plugin binaries remain unaffected; only new builds include version info.