-
Notifications
You must be signed in to change notification settings - Fork 13.6k
[lldb][test] Fix TestStdCXXDisassembly test #112357
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
The path llvm#98694 was not enough. This test is still failed on the buildbot https://lab.llvm.org/staging/#/builders/195/builds/4438 Use `USE_LIBSTDCPP := 1` instead.
@llvm/pr-subscribers-lldb Author: Dmitry Vasilyev (slydiman) ChangesThe patch #98694 was not enough. This test is still failed on the buildbot https://lab.llvm.org/staging/#/builders/195/builds/4438 Use Full diff: https://github.com/llvm/llvm-project/pull/112357.diff 1 Files Affected:
diff --git a/lldb/test/API/lang/cpp/stl/Makefile b/lldb/test/API/lang/cpp/stl/Makefile
index 8534fa9b00209e..bf8e6b8703f368 100644
--- a/lldb/test/API/lang/cpp/stl/Makefile
+++ b/lldb/test/API/lang/cpp/stl/Makefile
@@ -1,5 +1,5 @@
CXX_SOURCES := main.cpp
-USE_SYSTEM_STDLIB := 1
+USE_LIBSTDCPP := 1
include Makefile.rules
|
So the problem is that because we statically link we fail to find a Generally, why is this test trying to do disassembly on every STL function? Can't really tell if this was actually STL specific from the git history. I guess as a stress-test it seems fine, but maybe we could just skip the test if we can't locate the module? Instead of messing around with the Makefile variables to try and locate the STL. |
Can you suggest how to do that (locate the module)?
I can't test on Darwin. Maybe the following?
|
In
Do,
Yea that would be an alternative. Don't really have a preference tbh, though the former seems more robust. @labath @DavidSpickett any thoughts? |
@Michael137 |
950c209
to
bd0c917
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.
Doing both seems fine, thanks!
Can we change the Darwin case to USE_LIBCPP
though? The less reliance on the system stdlib the better i think.
Also lets check that the PR CI actually does run the test (aka doesn't trigger the skip added here)
I cannot test it on Darwin, so I would leave that to the Darwin experts.
The test TestStdCXXDisassembly seems passed in PR CI. I'm going to merge this PR. |
We are seeing test failures on
Failed bot task: https://ci.chromium.org/ui/p/fuchsia/builders/toolchain.ci/lldb-linux-x64/b8733980216892309505/overview Looking at the clang invocation, I believe the issue is that it forced the test to be build with GNU libstdc++ , and our bots don't have any GNU toolchain installed. Is there a reason why LLDB doesn't use LLVM's own libc++? |
@@ -1,5 +1,9 @@ | |||
CXX_SOURCES := main.cpp | |||
|
|||
USE_SYSTEM_STDLIB := 1 | |||
ifneq ($(OS),Darwin) | |||
USE_LIBSTDCPP := 1 |
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.
This will break every test under lldb/test/API/lang/cpp/stl
on non darwin machines if GNU libstdc++ is not installed.
I don't think it is a correct to assume the host machine has libstdc++. Plenty of bots are set up in a way to avoid accidentally (and implicitly) introducing GNU toolchains in a LLVM build by removing the entire GNU toolchain from the host machine. It appears the upstream LLDB bots are not set up in this way.
If libstdc++ is required to run this test (and it is the indended behavior), the correct way is to introduce LLVM cmake flag, e.g. LLDB_STDCPP_PATH
to explicitly specify the path to the libstdc++, and disable the tests that depends on it in the build system.
But from what I see in the patch history. I believe both tests are not bound to a specific c++ lib. It just need either libc++ or libstdc++. And specifically, if libcxx is linked statically, the test runner somehow needs the libc++ shared object, but it may be not present. If that is the case, the way this patch addresses the test failure on upstream llvm bot is wrong. The correct way it to fix the test runner 1> make sure it builds and works properly when libc++ is linked statically instead of depending on the presence of shared object 2> skip the tests if libcxx and libstd++ is not present instead of forcing using libstdc++ regardless of host environment.
Looking at logics at
for i in range(target.GetNumModules()): |
libstdc++.so
or libc++.so
in the modules. Since we don't have gcc installed, the header files for libstdc++ doesn't exist, but clang was invoked with -stdlib=libstdc++
so it is forced to look for gcc's c++ header files. They do not exist. I am not 100% sure if this logic will skip the test if both so files are absent (it looks to me the test will fail with "FAILHORRIBLYHERE"). This logic is also not present in TestSTL.py
. So it will fail consistently if none of the so files are present.
@slydiman Lets just revert the Makefile changes in this PR and let the test pick whatever's on the system. The test changes ensure we skip it in the statically linked builds anyway.
We do use a local libc++ build for libc++-specific tests. Otherwise we just use whatever is on the system. I do think the silent fallbacks in some cases could be cleaned up: #106885 (review). Though I'm a bit surprised clang lets you specify |
The patch llvm#98694 was not enough. This test is still failed on the buildbot https://lab.llvm.org/staging/#/builders/195/builds/4438 Use `USE_LIBSTDCPP := 1` instead for non Darwin OS and skip the test if libstdc++.so is missing.
This change partially reverts llvm#112357 to avoid LLDB STL test failures on machines which do not have gcc installed.
This change partially reverts #112357 to avoid test failures on machines which do not have gcc installed.
The patch #98694 was not enough. This test is still failed on the buildbot https://lab.llvm.org/staging/#/builders/195/builds/4438
Use
USE_LIBSTDCPP := 1
instead for non Darwin OS and skip the test if libstdc++.so is missing.