Conversation
Contributor
Author
|
Output looks like: Why 3 things?
That last one is really handy. It basically is the best description that git can give you. It will include the lastest tag (when we have one), the number of commits since the tag (when we have one) as well as whether the repo was clean or dirty when the build took place (really useful for detecting a mistake or someone using a dev build when they thought it was a release). |
Contributor
|
Nice! This is going to help QA and bug tracking a lot. |
rynowak
commented
Apr 14, 2021
| BINS_OUT_DIR := $(OUT_DIR)/$(GOOS)_$(GOARCH)/$(BUILDTYPE_DIR) | ||
| LDFLAGS := "-s -w -X main.version=$(REL_VERSION)" | ||
| BASE_PACKAGE_NAME := github.com/Azure/radius | ||
| LDFLAGS := "-s -w -X $(BASE_PACKAGE_NAME)/pkg/version.release=$(REL_VERSION) -X $(BASE_PACKAGE_NAME)/pkg/version.commit=$(GIT_COMMIT) -X $(BASE_PACKAGE_NAME)/pkg/version.version=$(GIT_VERSION)" |
Contributor
Author
There was a problem hiding this comment.
-X allows the linker to set the value of a package-level variable so that it can be read later inside the app.
kachawla
approved these changes
Apr 15, 2021
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.
Fixes: #37
Part of: #231
This change adds version info to our binary builds and our RP image.