This is an archive of the discontinued LLVM Phabricator instance.

[libc++] Fix incorrect definition of TEST_HAS_C11_FEATURES
ClosedPublic

Authored by ldionne on Aug 14 2018, 9:36 AM.

Diff Detail

Repository
rCXX libc++

Event Timeline

ldionne created this revision.Aug 14 2018, 9:36 AM

The goal of this commit is to fix build bot failures here: http://lab.llvm.org:8011/builders/libcxx-libcxxabi-libunwind-armv7-linux-noexceptions/builds/286/steps/test.libcxx/logs/stdio. This failure was introduced when I fixed some unit tests that were no-ops in https://reviews.llvm.org/D50674 -- I didn't test that change on Linux so I didn't catch the failure before the bots notified me.

To test this change, I bootstrapped a Docker image with a configuration similar to the build bot, and was able to reproduce the issue. Applying this patch fixed the issue.

Side note: we should probably strive to have docker containers for as many libc++ build bots as possible -- this makes it possible to reproduce failures locally, which is otherwise a guessing game. Even better -- we could run better tests before submitting a change and avoid breaking the build altogether!

jfb accepted this revision.Aug 14 2018, 10:41 AM
jfb added a subscriber: jfb.

From __ISO_C_VISIBLE >= 2011 it looks like this tries to test C11 features regardless of the C++ version. That's probably fine, but we're walking this line where only C++17 really guarantees C11 support, so this entire thing is weird and brittle to me. You're not changing the brittle-ness, just removing one kink, so from that perspective this change LGTM.

libcxx/test/support/test_macros.h
127 ↗(On Diff #160616)

Should this be TEST_STD_VER >= 11?

This revision is now accepted and ready to land.Aug 14 2018, 10:41 AM

I have pissed in this area, too - See https://bugs.llvm.org/show_bug.cgi?id=38495 and the proposed resolution here: https://bugs.llvm.org/attachment.cgi?id=20692
How about I just make this change as part of that fix?

dexonsmith accepted this revision.Aug 14 2018, 11:02 AM

I have pissed in this area, too - See https://bugs.llvm.org/show_bug.cgi?id=38495 and the proposed resolution here: https://bugs.llvm.org/attachment.cgi?id=20692
How about I just make this change as part of that fix?

If the bots are red from a previous commit I think it would be better for Louis to commit this separately.

I have pissed in this area, too - See https://bugs.llvm.org/show_bug.cgi?id=38495 and the proposed resolution here: https://bugs.llvm.org/attachment.cgi?id=20692
How about I just make this change as part of that fix?

Yes, that would be great.

If the bots are red from a previous commit I think it would be better for Louis to commit this separately.

I'm ok with that.

ldionne marked an inline comment as done.Aug 14 2018, 11:13 AM

Ok, I'm pushing with JF's suggested change (use TEST_STD_VER >= 11 instead of __cplusplus >= 201103L). Let's cross fingers that this is going to unbreak the testers -- like I said it fixed my Docker container.

This revision was automatically updated to reflect the committed changes.

thinking about this more, I think this the wrong long-term direction.

The presence/absence of C11 features in the underlying C library does not depend on what version of the C++ language we're compiling with.
The tests that use TEXT_HAS_C11_XXX should be updated to check TEST_STD_VER instead.

However, I'm fine with this as a short-term fix.