-
Notifications
You must be signed in to change notification settings - Fork 122
Add makefile flag to create debug build #5009
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, pls fix hyphen
long-shot concern -- is GCFLAGS defined on the github runner to something that will cause problems? guessing not
@@ -9,7 +9,12 @@ PATH_WITH_TOOLS="`pwd`/$(TOOL_BIN):`pwd`/node_modules/.bin:${PATH}" | |||
GIT_REVISION = $(shell git rev-parse HEAD | tr -d '\n') | |||
TAG_VERSION?=$(shell ./etc/dev-version.sh | sed 's/^v//') | |||
DATE_COMPILED?=$(shell date +'%Y-%m-%d') | |||
COMMON_LDFLAGS = -s -w -X 'go.viam.com/rdk/config.Version=${TAG_VERSION}' -X 'go.viam.com/rdk/config.GitRevision=${GIT_REVISION}' -X 'go.viam.com/rdk/config.DateCompiled=${DATE_COMPILED}' | |||
COMMON_LDFLAGS = -X 'go.viam.com/rdk/config.Version=${TAG_VERSION}' -X 'go.viam.com/rdk/config.GitRevision=${GIT_REVISION}' -X 'go.viam.com/rdk/config.DateCompiled=${DATE_COMPILED}' | |||
ifdef BUILD_DEBUG |
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.
BUILD_DEBUG=0
puts this in the first case, not the second, but shrug, I think fine as-is and not worth changing / retesting
Makefile
Outdated
|
||
windows: | ||
mkdir -p bin/windows | ||
GOOS=windows go build -tags no_cgo -ldflags="-extldflags=-static $(COMMON_LDFLAGS)" -o bin/windows/viam-server-$(shell go env GOARCH).exe ./web/cmd/server | ||
GOOS=windows go build -tags no_cgo -$(GCFLAGS) ldflags="-extldflags=-static $(COMMON_LDFLAGS)" -o bin/windows/viam-server-$(shell go env GOARCH).exe ./web/cmd/server |
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.
misplaced hyphen here
As far as I can tell it's not. Nothing in the workflow definitions sets it and the workflows run on Github's provided |
During a recent incident I had to create a build of the server I could usefully debug with delve. This PR just adds a flag to the makefile to make creating such a build easier in the future.
GCFLAGS:
LDFLAGS: