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

[Dexter] Replace clang with clang++ in various cross project tests #65987

Open
wants to merge 1 commit into
base: main
Choose a base branch
from

Conversation

SLTozer
Copy link
Contributor

@SLTozer SLTozer commented Sep 11, 2023

This patch attempts to fixup a set of tests in the cross-project-tests directory by replacing invocations of clang with clang++ for a set of c++ files.

As a small additional change, this patch removes -lstdc++ from a test that did not appear to require it.

@adrian-prantl
Copy link
Collaborator

This change looks good by itself, but we may need to additionally sneak in -isysroot if any system headers are needed by the tests.

@SLTozer
Copy link
Contributor Author

SLTozer commented Sep 12, 2023

This change looks good by itself, but we may need to additionally sneak in -isysroot if any system headers are needed by the tests.

That sounds like a good candidate for some kind of system-dependent substitution; though I don't think any of the cross-project-tests right now (including the system-darwin-specific ones) are using -isysroot, so it might not be a necessary addition.

I also see that some of the tests that were XFAILed before due to greendragon test failures don't make use of -lstdc++ and are using the correct versions of clang, so this patch likely won't fix them - will continue to investigate those cases, and add a new PR for any further fixes that fall out.

@rastogishubham
Copy link
Contributor

I tried to add -isysroot to the clang invocation by modifying lit.local.cfg, that takes care of error I saw in the clang invocation, but the tests don't pass.

FAIL: cross-project-tests :: debuginfo-tests/dexter-tests/ctor.cpp (2 of 2)
******************** TEST 'cross-project-tests :: debuginfo-tests/dexter-tests/ctor.cpp' FAILED ********************
Script:
--
: 'RUN: at line 4';   /Users/shubham/Development/llvm-project/build_ninja/bin/clang -isysroot /Users/shubham/apple-internal/Xcode-Rainbow/Xcode.app/Contents/Developer/Platforms/MacOSX.platform/Developer/SDKs/MacOSX14.0.sdk  -std=gnu++11 -O0 -glldb /Users/shubham/Development/llvm-project/cross-project-tests/debuginfo-tests/dexter-tests/ctor.cpp -o /Users/shubham/Development/llvm-project/build_ninja/projects/cross-project-tests/debuginfo-tests/dexter-tests/Output/ctor.cpp.tmp
: 'RUN: at line 5';   "/opt/homebrew/opt/python@3.11/bin/python3.11" "/Users/shubham/Development/llvm-project/cross-project-tests/debuginfo-tests/dexter/dexter.py" test --lldb-executable "/Users/shubham/Development/llvm-project/build_ninja/bin/lldb" --fail-lt 1.0 -w      --binary /Users/shubham/Development/llvm-project/build_ninja/projects/cross-project-tests/debuginfo-tests/dexter-tests/Output/ctor.cpp.tmp --debugger 'lldb' -- /Users/shubham/Development/llvm-project/cross-project-tests/debuginfo-tests/dexter-tests/ctor.cpp
--
Exit Code: 2

Command Output (stdout):
--
ctor.cpp: (0.0000)


--

Weirdly enough, when I run the same command line locally, it seems to work without an issue:

shubham@Mac-3004D6-2 cross-project-tests % /Users/shubham/Development/llvm-project/build_ninja/bin/clang -isysroot /Users/shubham/apple-internal/Xcode-Rainbow/Xcode.app/Contents/Developer/Platforms/MacOSX.platform/Developer/SDKs/MacOSX14.0.sdk  -std=gnu++11 -O0 -glldb /Users/shubham/Development/llvm-project/cross-project-tests/debuginfo-tests/dexter-tests/ctor.cpp -o /Users/shubham/Development/llvm-project/build_ninja/projects/cross-project-tests/debuginfo-tests/dexter-tests/Output/ctor.cpp.tmp
shubham@Mac-3004D6-2 cross-project-tests % "/opt/homebrew/opt/python@3.11/bin/python3.11" "/Users/shubham/Development/llvm-project/cross-project-tests/debuginfo-tests/dexter/dexter.py" test --lldb-executable "/Users/shubham/Development/llvm-project/build_ninja/bin/lldb" --fail-lt 1.0 -w      --binary /Users/shubham/Development/llvm-project/build_ninja/projects/cross-project-tests/debuginfo-tests/dexter-tests/Output/ctor.cpp.tmp --debugger 'lldb' -- /Users/shubham/Development/llvm-project/cross-project-tests/debuginfo-tests/dexter-tests/ctor.cpp
ctor.cpp: (1.0000)

shubham@Mac-3004D6-2 cross-project-tests % echo $?
0

So I am not sure of what is going on

@rastogishubham
Copy link
Contributor

@SLTozer We managed to track down the real issue and the change is in #66299

@@ -2,7 +2,7 @@
// UNSUPPORTED: system-windows
// XFAIL: system-darwin
//
// RUN: %clang -std=gnu++11 -O0 -g -lstdc++ %s -o %t
// RUN: %clang++ -std=gnu++11 -O0 -g -lstdc++ %s -o %t
Copy link
Member

Choose a reason for hiding this comment

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

Remove -lstdc++

@rastogishubham
Copy link
Contributor

Since the issue had nothing to do with clang++, is this change needed? @SLTozer @adrian-prantl

This patch attempts to fixup a set of tests in the cross-project-tests
directory by replacing invocations of clang with clang++ for a set of c++
files.

As a small additional change, this patch removes -lstdc++ from a test that
did not appear to require it.
@SLTozer
Copy link
Contributor Author

SLTozer commented Sep 15, 2023

Since the issue had nothing to do with clang++, is this change needed? @SLTozer @adrian-prantl

It's not needed to make the tests pass, but we should probably be invoking the right driver for tests where reasonable, so I think it's still worth landing now that it's done.

@TiborGY
Copy link
Contributor

TiborGY commented Mar 18, 2025

@SLTozer Was there a reason why this PR never got merged?

@SLTozer
Copy link
Contributor Author

SLTozer commented Mar 18, 2025

Fell off my radar - it's not needed to fix any actual problems, it's just slightly better practice. I can't monitor the buildbots right now, but I'll merge it when I'm next able.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

Successfully merging this pull request may close these issues.

5 participants