-
Notifications
You must be signed in to change notification settings - Fork 1.9k
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
missing DWARF symbol table #3717
Conversation
Ah ok now I remember why we removed DWARF symbol table: https://github.com/docker/cli/runs/7479620604?check_suite_focus=true#step:4:2067
By default on Darwin the linker will invoke I think our osxsdk used for cross comp darwin binaries might be too old: Line 62 in f1615fa
I will take a look |
Codecov Report
@@ Coverage Diff @@
## master #3717 +/- ##
==========================================
- Coverage 59.06% 59.06% -0.01%
==========================================
Files 289 289
Lines 24673 24665 -8
==========================================
- Hits 14573 14568 -5
+ Misses 9226 9224 -2
+ Partials 874 873 -1 |
c9fb04c
to
56767fd
Compare
Ok so we have to install the I took a look at https://apt.llvm.org/ but does not seem to include FROM --platform=$BUILDPLATFORM golang:${GO_VERSION}-bullseye AS build-base-bullseye
COPY --from=xx / /
RUN apt-get update && apt-get install --no-install-recommends -y bash clang lld file lsb-release software-properties-common
RUN wget https://apt.llvm.org/llvm.sh && chmod +x llvm.sh && ./llvm.sh 12 all && rm -f llvm.sh
WORKDIR /go/src/github.com/docker/cli
So I think we have to use the @tonistiigi Maybe instead of the debian variant we could switch to |
Dockerfile
Outdated
if [ "$BASE_VARIANT" != "alpine" ] && [ "$(xx-info os)" = "darwin" ]; then | ||
# on debian, use osxcross toolchain that includes the llvm-dsymutil tool | ||
# and right minimal llvm version required | ||
# more info: https://github.com/docker/cli/pull/3717 | ||
export PATH="/osxcross/bin:$PATH" | ||
export LD_LIBRARY_PATH="/osxcross/lib:$LD_LIBRARY_PATH" | ||
export CC="o64-clang" | ||
export CXX="o64-clang++" | ||
fi |
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.
@tonistiigi If you're ok with osxcross
we could add a detection folder like /xx-sdk
on xx so it could set itself the required env vars to use osxcross
and we could remove this part in the Dockerfile? Maybe also the ability to support macports
like https://github.com/crazy-max/goxx/blob/main/rootfs/usr/local/bin/goxx-macports. WDYT?
1edf995
to
75dabed
Compare
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.
By default on Darwin the linker will invoke dsymutil to put the debug info directly into the executable. This invocation of dsymutil is disabled by the linker's -w or -s option
Is this something that could be fixed in Go?
@tonistiigi Can't repro everytime but we currently have this issue with BuildKit: https://github.com/docker/cli/runs/7496406536?check_suite_focus=true#step:4:389
But
I wonder is this is not linked to the infamous empty layer issue we had in the past or moby/buildkit#2973. |
Signed-off-by: CrazyMax <crazy-max@users.noreply.github.com>
093023f
to
963e446
Compare
Looking at https://github.com/docker/cli/runs/7497061435?check_suite_focus=true#step:4:330:
It seems some instructions are cached even if no cache exporters are in place and the builder is a new one with a fresh BuildKit state in the GHA workflow. With cache disabled everything looks good: https://github.com/docker/cli/actions/runs/2731390831 |
963e446
to
fd1d521
Compare
Ok so after bisect we actually strip DWARF symbol table in 20.10. So not a regression but this is needed for docker-archive/compose-cli#2151. Needs to noop |
fd1d521
to
6fb3e77
Compare
6fb3e77
to
2854529
Compare
@thaJeztah Comment added. We also discussed with @tonistiigi about this and we could fallback to strip from cctools for dawrin if llvm upstream doesn't work. this could be bundled in xx with ld64 so we could remove this hack. |
Signed-off-by: CrazyMax <crazy-max@users.noreply.github.com>
2854529
to
6f799c1
Compare
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
@tonistiigi this LGTY? |
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.
We should look more deeply into what that darwin issue is. Is it something broken in old LLVM etc. Is it Debian weirdness? If needed we can get the Apple strip
from https://github.com/tpoechtrager/cctools-port/blob/master/cctools/misc/strip.c with ld64
in xx
.
Regression from #3320 which always strips DWARF symbol table.
I encounter this issue while trying to debug #3621 but also to improve our shell out operations with
debug/buildinfo
pkg (available since Go 1.18) for plugins discovery.Signed-off-by: CrazyMax crazy-max@users.noreply.github.com