This is an archive of the discontinued LLVM Phabricator instance.

[test-suite] Add a decorator for the lack of libstdcxx on the system.
AbandonedPublic

Authored by davide on Jul 6 2018, 9:47 AM.

Details

Summary

commit 9fed17ef5633194ba7d444451cce70fe5711c84e (HEAD -> master)
Author: Davide Italiano <ditaliano@apple.com>
Date: Fri Jul 6 09:41:29 2018 -0700

This generalizes a bunch of target-specific tests. MacOS has no
libstdcxx anymore, and neither does FreeBSD (or Windows).

<rdar://problem/41896105>

Diff Detail

Event Timeline

davide created this revision.Jul 6 2018, 9:47 AM
davide added a comment.Jul 6 2018, 1:46 PM

I went ahead and committed this because it was breaking a downstream bot:

rL336463: [test-suite] Add a decorator for the lack of libstdcxx on the system..

Post-review commit appreciated of course.

Is this going to work with non-clang compilers? ('$CXX -x c++ -stdlib=libstdc++ ') I can imagine gcc supporting these same flags, but will this work on windows?

Is this going to work with non-clang compilers? ('$CXX -x c++ -stdlib=libstdc++ ') I can imagine gcc supporting these same flags, but will this work on windows?

I checked and gcc supports the flags.
I'm not sure about Windows (cc: @stella.stamenova) and I don't have a machine to check I'm afraid.
FWIW, there are a bunch of other decorators with do this (pass a random flag) so we might consider fixing them all at once (if there's any need to).

Thanks!

labath added a comment.Jul 9 2018, 6:12 AM

Besides the problems I mention in inline comments, the other issue I have with this patch is that it does things completely different than how we implement the check for libc++, which is an identical problem. (libc++ detection is done by marking all libc++ tests as with a special category, and then deciding in dotest.py (checkLibcxxSupport) whether to run the category as a whole).

So, I think this should be reverted and replaced by a solution mirroring the libc++ approach. I'm not saying that one is perfect, but it is in many ways better than this one (e.g., if the default skipping logic gets things wrong, you can override it by manually skipping the corresponding category), and most importantly, it makes things consistent.

lldb/packages/Python/lldbsuite/test/decorators.py
696

This won't work in several scenarios:

  • gcc: I'm not sure how you tested on gcc, but my gcc(-7.3.0) gives me an "unrecognised command line option" on the -stdlib argument.
  • cross-compilation: just because the default target has/hasn't libstdc++ headers+libs available, it does not mean the target we selected for cross compilation will be the same.

On top of all of that you have a mismatched ' inside the executed command...

cl (the visual studio compiler) does not support all of the flags:

cl : Command line warning D9002 : ignoring unknown option '-x'
cl : Command line warning D9002 : ignoring unknown option '-stdlib=libstdc++'
cl : Command line warning D9002 : ignoring unknown option '-'

Besides the problems I mention in inline comments, the other issue I have with this patch is that it does things completely different than how we implement the check for libc++, which is an identical problem. (libc++ detection is done by marking all libc++ tests as with a special category, and then deciding in dotest.py (checkLibcxxSupport) whether to run the category as a whole).

So, I think this should be reverted and replaced by a solution mirroring the libc++ approach. I'm not saying that one is perfect, but it is in many ways better than this one (e.g., if the default skipping logic gets things wrong, you can override it by manually skipping the corresponding category), and most importantly, it makes things consistent.

OK, I'm going to revert this and work on a better solution today.

davide added a comment.Jul 9 2018, 3:01 PM

This was reverted at:

Davides-Mac-Pro:lldb davide$ git llvm push
Pushing 1 commit:
  116b1ec8e32 Rollback [test-suite] Add a decorator for the lack of libstdcxx on the system.
Sending        lldb/trunk/packages/Python/lldbsuite/test/decorators.py
Sending        lldb/trunk/packages/Python/lldbsuite/test/functionalities/data-formatter/data-formatter-stl/libstdcpp/iterator/TestDataFormatterStdIterator.py
Sending        lldb/trunk/packages/Python/lldbsuite/test/functionalities/data-formatter/data-formatter-stl/libstdcpp/list/TestDataFormatterStdList.py
Sending        lldb/trunk/packages/Python/lldbsuite/test/functionalities/data-formatter/data-formatter-stl/libstdcpp/map/TestDataFormatterStdMap.py
Sending        lldb/trunk/packages/Python/lldbsuite/test/functionalities/data-formatter/data-formatter-stl/libstdcpp/smart_ptr/TestDataFormatterStdSmartPtr.py
Sending        lldb/trunk/packages/Python/lldbsuite/test/functionalities/data-formatter/data-formatter-stl/libstdcpp/string/TestDataFormatterStdString.py
Sending        lldb/trunk/packages/Python/lldbsuite/test/functionalities/data-formatter/data-formatter-stl/libstdcpp/tuple/TestDataFormatterStdTuple.py
Sending        lldb/trunk/packages/Python/lldbsuite/test/functionalities/data-formatter/data-formatter-stl/libstdcpp/unique_ptr/TestDataFormatterStdUniquePtr.py
Sending        lldb/trunk/packages/Python/lldbsuite/test/functionalities/data-formatter/data-formatter-stl/libstdcpp/vbool/TestDataFormatterStdVBool.py
Sending        lldb/trunk/packages/Python/lldbsuite/test/functionalities/data-formatter/data-formatter-stl/libstdcpp/vector/TestDataFormatterStdVector.py
Transmitting file data ..........done
Committing transaction...
Committed revision 336608.
Committed 116b1ec8e32 to svn.

@labath I'll send another review with the approach you proposed soon.

davide abandoned this revision.Jul 10 2018, 5:47 PM

Was implemented differently. Closing.