Skip to content
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

[LLDB] DebugInfoD tests: attempt to fix Fuchsia build #96802

Merged
merged 13 commits into from
Jul 8, 2024

Conversation

kevinfrei
Copy link
Contributor

@kevinfrei kevinfrei commented Jun 26, 2024

This is the same diff I've put up at many times before. I've been trying to add some brand new functionality to the LLDB test infrastucture (create split-dwarf files!), and we all know that no good deed goes unpunished. The last attempt was reverted because it didn't work on the Fuchsia build.

There are no code differences between this and the previous four diffs landed & reverted (due to testing infra failures). The only change in this one is the way dwp is being identified in Makefile.rules.

Thanks to @petrhosek for helping me figure out how the fuchsia builders are configured. I now prefer to use llvm-dwp and fall back to gnu's dwp if the former isn't found. Hopefully this will work everywhere it needs to.

@Jlalond
Copy link
Contributor

Jlalond commented Jun 26, 2024

@petrhosek Is there a way you can help @kevinfrei validate this on Fuchsia

@kevinfrei
Copy link
Contributor Author

kevinfrei commented Jun 26, 2024

@petrhosek Is there a way you can help @kevinfrei validate this on Fuchsia

Specifically, I'm adding tests that require dwp/llvm-dwp laying around somewhere, and it looks like Fuchsia doesn't put it in the 'normal' location, and I have no idea how to simply disable an LLDB test for Fuchsia, because it lies to the infra and says it's linux (which is probably the right lie to tell, but I can't find any mechanism to see that it's a flower-flavored variant of Linux...)

Here's the build failure, where you can see it can't find the 'dwp' tool: https://luci-milo.appspot.com/ui/p/fuchsia/builders/toolchain.ci/clang-linux-x64/b8747217173107569041/test-results?sortby=&groupby=

@petrhosek
Copy link
Member

@petrhosek Is there a way you can help @kevinfrei validate this on Fuchsia

Specifically, I'm adding tests that require dwp/llvm-dwp laying around somewhere, and it looks like Fuchsia doesn't put it in the 'normal' location, and I have no idea how to simply disable an LLDB test for Fuchsia, because it lies to the infra and says it's linux (which is probably the right lie to tell, but I can't find any mechanism to see that it's a flower-flavored variant of Linux...)

Here's the build failure, where you can see it can't find the 'dwp' tool: https://luci-milo.appspot.com/ui/p/fuchsia/builders/toolchain.ci/clang-linux-x64/b8747217173107569041/test-results?sortby=&groupby=

What do you mean by "normal" location? Our toolchain has llvm-dwp as bin/llvm-dwp which is the default location.

The builder description is correct, it's a Linux distribution (Debian) but we don't install GNU toolchains, we're strict about using Clang/LLVM toolchain which is why there's no dwp, just llvm-dwp. It's not just dwp though, we don't install any GNU tools and instead include the LLVM counterparts, for example llvm-readelf instead of readelf, llvm-objcopy instead of objcopy, etc.

It looks like lldb/packages/Python/lldbsuite/test/make/Makefile.rules assumes GNU toolchain, which seems a bit odd given that it's a part of LLVM. Would it be possible to make it compatible with both GNU and Clang/LLVM toolchains?

@kevinfrei
Copy link
Contributor Author

What do you mean by "normal" location?

"normal" as defined by whoever wrote Makefile.rules originally and thought that was the correct place to file tools like ar and objcopy, I guess? So, on your build machine, do you know where the llvm-dwp file might be installed? Because honestly, I'd rather just use that thing instead of assuming the GNU dwp tool is around.

@petrhosek
Copy link
Member

What do you mean by "normal" location?

"normal" as defined by whoever wrote Makefile.rules originally and thought that was the correct place to file tools like ar and objcopy, I guess? So, on your build machine, do you know where the llvm-dwp file might be installed? Because honestly, I'd rather just use that thing instead of assuming the GNU dwp tool is around.

It'd be right next to clang in the same directory.

@kevinfrei kevinfrei force-pushed the debuginfo-tests-fuchsia-attempt branch from 02c5d66 to 5414fd5 Compare June 27, 2024 15:39
@kevinfrei kevinfrei marked this pull request as ready for review June 27, 2024 15:53
@kevinfrei kevinfrei force-pushed the debuginfo-tests-fuchsia-attempt branch 4 times, most recently from 883ba67 to 8c304f9 Compare July 2, 2024 21:00
@kevinfrei kevinfrei force-pushed the debuginfo-tests-fuchsia-attempt branch from 8c304f9 to 2ee5bd2 Compare July 2, 2024 21:08
@kevinfrei
Copy link
Contributor Author

@JDevlieghere could you stamp this so I can see if I've managed to make the tests work on the Fuchsia build (which I can't reproduce locally)

@kevinfrei
Copy link
Contributor Author

Friendly ping @JDevlieghere

@clayborg clayborg merged commit 2a7abb0 into llvm:main Jul 8, 2024
6 checks passed
@llvm-ci
Copy link
Collaborator

llvm-ci commented Jul 8, 2024

LLVM Buildbot has detected a new failure on builder lldb-aarch64-ubuntu running on linaro-lldb-aarch64-ubuntu while building lldb at step 6 "test".

Full details are available at: https://lab.llvm.org/buildbot/#/builders/59/builds/1213

Here is the relevant piece of the build log for the reference:

Step 6 (test) failure: build (failure)
...
UNSUPPORTED: lldb-api :: commands/watchpoints/watchpoint_set_command/TestWatchLocationWithWatchSet.py (262 of 1991)
PASS: lldb-api :: commands/watchpoints/watchpoint_on_vectors/TestValueOfVectorVariable.py (263 of 1991)
PASS: lldb-api :: commands/watchpoints/watchpoint_events/TestWatchpointEvents.py (264 of 1991)
PASS: lldb-api :: commands/watchpoints/watchpoint_disable/TestWatchpointDisable.py (265 of 1991)
PASS: lldb-api :: commands/watchpoints/multiple_threads/TestWatchpointMultipleThreads.py (266 of 1991)
UNSUPPORTED: lldb-api :: driver/batch_mode/TestBatchMode.py (267 of 1991)
UNSUPPORTED: lldb-api :: driver/job_control/TestJobControl.py (268 of 1991)
PASS: lldb-api :: debuginfod/Normal/TestDebuginfod.py (269 of 1991)
PASS: lldb-api :: functionalities/abbreviation/TestAbbreviations.py (270 of 1991)
UNRESOLVED: lldb-api :: debuginfod/SplitDWARF/TestDebuginfodDWP.py (271 of 1991)
******************** TEST 'lldb-api :: debuginfod/SplitDWARF/TestDebuginfodDWP.py' FAILED ********************
Script:
--
/usr/bin/python3.8 /home/tcwg-buildbot/worker/lldb-aarch64-ubuntu/llvm-project/lldb/test/API/dotest.py -u CXXFLAGS -u CFLAGS --env ARCHIVER=/usr/local/bin/llvm-ar --env OBJCOPY=/usr/bin/llvm-objcopy --env LLVM_LIBS_DIR=/home/tcwg-buildbot/worker/lldb-aarch64-ubuntu/build/./lib --env LLVM_INCLUDE_DIR=/home/tcwg-buildbot/worker/lldb-aarch64-ubuntu/build/include --env LLVM_TOOLS_DIR=/home/tcwg-buildbot/worker/lldb-aarch64-ubuntu/build/./bin --arch aarch64 --build-dir /home/tcwg-buildbot/worker/lldb-aarch64-ubuntu/build/lldb-test-build.noindex --lldb-module-cache-dir /home/tcwg-buildbot/worker/lldb-aarch64-ubuntu/build/lldb-test-build.noindex/module-cache-lldb/lldb-api --clang-module-cache-dir /home/tcwg-buildbot/worker/lldb-aarch64-ubuntu/build/lldb-test-build.noindex/module-cache-clang/lldb-api --executable /home/tcwg-buildbot/worker/lldb-aarch64-ubuntu/build/./bin/lldb --compiler /home/tcwg-buildbot/worker/lldb-aarch64-ubuntu/build/./bin/clang --dsymutil /home/tcwg-buildbot/worker/lldb-aarch64-ubuntu/build/./bin/dsymutil --llvm-tools-dir /home/tcwg-buildbot/worker/lldb-aarch64-ubuntu/build/./bin --lldb-obj-root /home/tcwg-buildbot/worker/lldb-aarch64-ubuntu/build/tools/lldb --lldb-libs-dir /home/tcwg-buildbot/worker/lldb-aarch64-ubuntu/build/./lib /home/tcwg-buildbot/worker/lldb-aarch64-ubuntu/llvm-project/lldb/test/API/debuginfod/SplitDWARF -p TestDebuginfodDWP.py
--
Exit Code: 1

Command Output (stdout):
--
lldb version 19.0.0git (https://github.com/llvm/llvm-project.git revision 2a7abb04e258542679476fa6527418c34412283c)
  clang revision 2a7abb04e258542679476fa6527418c34412283c
  llvm revision 2a7abb04e258542679476fa6527418c34412283c
Skipping the following test categories: ['libc++', 'dsym', 'gmodules', 'debugserver', 'objc']

--
Command Output (stderr):
--
UNSUPPORTED: LLDB (/home/tcwg-buildbot/worker/lldb-aarch64-ubuntu/build/bin/clang-aarch64) :: test_debuginfod_both_okd_symfiles_from_service (TestDebuginfodDWP.DebugInfodDWPTests) (requires curl) 
UNSUPPORTED: LLDB (/home/tcwg-buildbot/worker/lldb-aarch64-ubuntu/build/bin/clang-aarch64) :: test_debuginfod_both_symfiles_from_service (TestDebuginfodDWP.DebugInfodDWPTests) (requires curl) 
UNSUPPORTED: LLDB (/home/tcwg-buildbot/worker/lldb-aarch64-ubuntu/build/bin/clang-aarch64) :: test_debuginfod_dwp_from_service (TestDebuginfodDWP.DebugInfodDWPTests) (requires curl) 
FAIL: LLDB (/home/tcwg-buildbot/worker/lldb-aarch64-ubuntu/build/bin/clang-aarch64) :: test_normal_stripped (TestDebuginfodDWP.DebugInfodDWPTests)
FAIL: LLDB (/home/tcwg-buildbot/worker/lldb-aarch64-ubuntu/build/bin/clang-aarch64) :: test_normal_stripped_only_dwp (TestDebuginfodDWP.DebugInfodDWPTests)
FAIL: LLDB (/home/tcwg-buildbot/worker/lldb-aarch64-ubuntu/build/bin/clang-aarch64) :: test_normal_stripped_split_with_dwp (TestDebuginfodDWP.DebugInfodDWPTests)
======================================================================
ERROR: test_normal_stripped (TestDebuginfodDWP.DebugInfodDWPTests)
   Validate behavior with a stripped binary, no symbols or symbol locator.
----------------------------------------------------------------------
Error when building test subject.

Build Command:
make VPATH=/home/tcwg-buildbot/worker/lldb-aarch64-ubuntu/llvm-project/lldb/test/API/debuginfod/SplitDWARF -C /home/tcwg-buildbot/worker/lldb-aarch64-ubuntu/build/lldb-test-build.noindex/debuginfod/SplitDWARF/TestDebuginfodDWP.test_normal_stripped -I /home/tcwg-buildbot/worker/lldb-aarch64-ubuntu/llvm-project/lldb/test/API/debuginfod/SplitDWARF -I /home/tcwg-buildbot/worker/lldb-aarch64-ubuntu/llvm-project/lldb/packages/Python/lldbsuite/test/make -f /home/tcwg-buildbot/worker/lldb-aarch64-ubuntu/llvm-project/lldb/test/API/debuginfod/SplitDWARF/Makefile all ARCH=aarch64 'CC="/home/tcwg-buildbot/worker/lldb-aarch64-ubuntu/build/bin/clang"' CLANG_MODULE_CACHE_DIR=/home/tcwg-buildbot/worker/lldb-aarch64-ubuntu/build/lldb-test-build.noindex/module-cache-clang/lldb-api LLDB_OBJ_ROOT=/home/tcwg-buildbot/worker/lldb-aarch64-ubuntu/build/tools/lldb

Build Command Output:
make: Entering directory '/home/tcwg-buildbot/worker/lldb-aarch64-ubuntu/build/lldb-test-build.noindex/debuginfod/SplitDWARF/TestDebuginfodDWP.test_normal_stripped'
"/home/tcwg-buildbot/worker/lldb-aarch64-ubuntu/build/bin/clang" -g -O0  -I/home/tcwg-buildbot/worker/lldb-aarch64-ubuntu/llvm-project/lldb/packages/Python/lldbsuite/test/make/../../../../../include -I/home/tcwg-buildbot/worker/lldb-aarch64-ubuntu/build/tools/lldb/include -I/home/tcwg-buildbot/worker/lldb-aarch64-ubuntu/llvm-project/lldb/test/API/debuginfod/SplitDWARF -I/home/tcwg-buildbot/worker/lldb-aarch64-ubuntu/llvm-project/lldb/packages/Python/lldbsuite/test/make -include /home/tcwg-buildbot/worker/lldb-aarch64-ubuntu/llvm-project/lldb/packages/Python/lldbsuite/test/make/test_common.h  -fno-limit-debug-info  -gsplit-dwarf  -MT main.o -MD -MP -MF main.d -c -o main.o /home/tcwg-buildbot/worker/lldb-aarch64-ubuntu/llvm-project/lldb/test/API/debuginfod/SplitDWARF/main.c
"/home/tcwg-buildbot/worker/lldb-aarch64-ubuntu/build/bin/clang"  main.o -g -O0  -I/home/tcwg-buildbot/worker/lldb-aarch64-ubuntu/llvm-project/lldb/packages/Python/lldbsuite/test/make/../../../../../include -I/home/tcwg-buildbot/worker/lldb-aarch64-ubuntu/build/tools/lldb/include -I/home/tcwg-buildbot/worker/lldb-aarch64-ubuntu/llvm-project/lldb/test/API/debuginfod/SplitDWARF -I/home/tcwg-buildbot/worker/lldb-aarch64-ubuntu/llvm-project/lldb/packages/Python/lldbsuite/test/make -include /home/tcwg-buildbot/worker/lldb-aarch64-ubuntu/llvm-project/lldb/packages/Python/lldbsuite/test/make/test_common.h  -fno-limit-debug-info  -gsplit-dwarf    --driver-mode=g++ -Wl,--build-id -o "a.out"
cp "a.out" "a.out.unstripped"
/usr/bin/llvm-objcopy --only-keep-debug "a.out" "a.out.debug"
/usr/bin/llvm-objcopy --strip-debug --add-gnu-debuglink="a.out.debug" "a.out" "a.out"

kevinfrei added a commit to kevinfrei/llvm that referenced this pull request Jul 9, 2024
clayborg pushed a commit that referenced this pull request Jul 9, 2024
Reverts #96802

Attempt #5 fails. It's been 6 months. I despise Makefile.rules and have
no ability to even *detect* these failures without _landing_ a diff. In
the mean time, we have no testing for DWP files at all (and a regression
that was introduced, that I fix with this diff) so I'm going to just
remove some of the tests and try to land it again, but with less testing
I guess.
JDevlieghere pushed a commit that referenced this pull request Jul 10, 2024
This is all the tests and fixes I've had percolating since my first
attempt at this in January. After 6 months of trying, I've given up on
adding the ability to test DWP files in LLDB API tests. I've left both
the tests (disabled) and the changes to Makefile.rules in place, in the
hopes that someone who can configure the build bots will be able to
enable the tests once a non-borked dwp tool is widely available.

Other than disabling the DWP tests, this continues to be the same diff
that I've tried to land and
[not](#90622)
[revert](#87676)
[five](#86812)
[times](#85693)
[before](#96802). There are a
couple of fixes that the testing exposed, and I've abandoned the DWP
tests because I want to get those fixes finally upstreamed, as without
them DebugInfoD is less useful.
aaryanshukla pushed a commit to aaryanshukla/llvm-project that referenced this pull request Jul 14, 2024
This is the same diff I've put up at many times before. I've been trying
to add some brand new functionality to the LLDB test infrastucture
(create split-dwarf files!), and we all know that no good deed goes
unpunished. The last attempt was reverted because it didn't work on the
Fuchsia build.

There are no code differences between this and
[the](llvm#90622)
[previous](llvm#87676)
[four](llvm#86812)
[diffs](llvm#85693) landed &
reverted (due to testing infra failures). The only change in this one is
the way `dwp` is being identified in `Makefile.rules`.

Thanks to @petrhosek for helping me figure out how the fuchsia builders
are configured. I now prefer to use llvm-dwp and fall back to gnu's dwp
if the former isn't found. Hopefully this will work everywhere it needs
to.
aaryanshukla pushed a commit to aaryanshukla/llvm-project that referenced this pull request Jul 14, 2024
…98101)

Reverts llvm#96802

Attempt llvm#5 fails. It's been 6 months. I despise Makefile.rules and have
no ability to even *detect* these failures without _landing_ a diff. In
the mean time, we have no testing for DWP files at all (and a regression
that was introduced, that I fix with this diff) so I'm going to just
remove some of the tests and try to land it again, but with less testing
I guess.
aaryanshukla pushed a commit to aaryanshukla/llvm-project that referenced this pull request Jul 14, 2024
…#98344)

This is all the tests and fixes I've had percolating since my first
attempt at this in January. After 6 months of trying, I've given up on
adding the ability to test DWP files in LLDB API tests. I've left both
the tests (disabled) and the changes to Makefile.rules in place, in the
hopes that someone who can configure the build bots will be able to
enable the tests once a non-borked dwp tool is widely available.

Other than disabling the DWP tests, this continues to be the same diff
that I've tried to land and
[not](llvm#90622)
[revert](llvm#87676)
[five](llvm#86812)
[times](llvm#85693)
[before](llvm#96802). There are a
couple of fixes that the testing exposed, and I've abandoned the DWP
tests because I want to get those fixes finally upstreamed, as without
them DebugInfoD is less useful.
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.

6 participants