Skip to content

Add build option "GODEBUG=1"#2647

Merged
crosbymichael merged 1 commit intocontainerd:masterfrom
teawater:gdb
Jan 29, 2019
Merged

Add build option "GODEBUG=1"#2647
crosbymichael merged 1 commit intocontainerd:masterfrom
teawater:gdb

Conversation

@teawater
Copy link
Copy Markdown
Contributor

Make will generate GDB friendly binary with this build option.

Signed-off-by: Hui Zhu [email protected]

Comment thread Makefile Outdated
Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

how about removing the -s -w from the GO_LDFLAGS and SHIM_GO_LDFLAGS and reusing the env EXTRA_LDFLAGS, since it has provided the ability to pass the gcflags?

Copy link
Copy Markdown
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

@fuweid Make a new version that put -s -w to EXTRA_LDFLAGS.

Make will generate GDB friendly binary with this build option.

Signed-off-by: Hui Zhu <[email protected]>
@codecov-io
Copy link
Copy Markdown

Codecov Report

Merging #2647 into master will decrease coverage by 3.67%.
The diff coverage is n/a.

Impacted file tree graph

@@            Coverage Diff             @@
##           master    #2647      +/-   ##
==========================================
- Coverage   47.54%   43.87%   -3.68%     
==========================================
  Files          87       94       +7     
  Lines        8211    10310    +2099     
==========================================
+ Hits         3904     4523     +619     
- Misses       3590     5070    +1480     
  Partials      717      717
Flag Coverage Δ
#linux 47.54% <ø> (ø) ⬆️
#windows 40.54% <ø> (?)
Impacted Files Coverage Δ
snapshots/native/native.go 43.3% <0%> (-10%) ⬇️
metadata/snapshot.go 45.8% <0%> (-8.96%) ⬇️
archive/compression/compression.go 42.64% <0%> (-8.27%) ⬇️
archive/tar.go 43.13% <0%> (-6.87%) ⬇️
metadata/containers.go 47.97% <0%> (-6.62%) ⬇️
content/local/writer.go 56.25% <0%> (-6.42%) ⬇️
content/local/store.go 48.76% <0%> (-4.77%) ⬇️
archive/tar_opts.go 28.57% <0%> (-4.77%) ⬇️
metadata/images.go 58.46% <0%> (-4.7%) ⬇️
metadata/buckets.go 56.33% <0%> (-4.6%) ⬇️
... and 54 more

Continue to review full report at Codecov.

Legend - Click here to learn more
Δ = absolute <relative> (impact), ø = not affected, ? = missing data
Powered by Codecov. Last update 3c2668d...c5a0c7f. Read the comment docs.

Comment thread Makefile
GO_LDFLAGS=-ldflags '-s -w -X $(PKG)/version.Version=$(VERSION) -X $(PKG)/version.Revision=$(REVISION) -X $(PKG)/version.Package=$(PKG) $(EXTRA_LDFLAGS)'
SHIM_GO_LDFLAGS=-ldflags '-s -w -X $(PKG)/version.Version=$(VERSION) -X $(PKG)/version.Revision=$(REVISION) -X $(PKG)/version.Package=$(PKG) -extldflags "-static"'
GO_BUILDTAGS ?= seccomp apparmor
GO_BUILDTAGS += ${DEBUG_TAGS}
Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I think that part of your change is good to build binary with debug info, like

make GO_BUILDTAGS="seccomp apparmor static_build" \
     EXTRA_LDFLAGS="" \
     EXTRA_FLAGS='-gcflags=all="-N -l"'

I'm not sure that it is good to add the specific debug info in the common Makefile.
ping @AkihiroSuda and @crosbymichael

Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

would a separate make debug work better or no?

Copy link
Copy Markdown
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

@crosbymichael I think let debug as an option is better than set it as a special target.
Because the option can work with each target.

@crosbymichael
Copy link
Copy Markdown
Member

LGTM

1 similar comment
@ehazlett
Copy link
Copy Markdown
Member

LGTM

@crosbymichael crosbymichael merged commit 5abeeff into containerd:master Jan 29, 2019
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

5 participants