This is an archive of the discontinued LLVM Phabricator instance.

[Sanitizer] Bump macOS deployment target for sanitizer unit test binary to support C++17 requirements.
ClosedPublic

Authored by thetruestblue on Sep 16 2022, 3:55 PM.

Details

Summary

This patch fixes a test failure on Apple caused by changing standard to c++17.
sanitizer_allocator_test.cpp requires language features introducied in 10.13 for c++17.
After initial investigation, it was not clear how to add this flag to a single file:
https://reviews.llvm.org/D133878

Becuase of this, we have upped the min version of this test suite to 10.13, the min version necessary to support necessary language features.

We felt this was a better option than upping the min version of the product to support a single test.
We are raising deployment target for a single test suite, rather than the product.

Diff Detail

Event Timeline

thetruestblue created this revision.Sep 16 2022, 3:55 PM
Herald added a project: Restricted Project. · View Herald TranscriptSep 16 2022, 3:55 PM
Herald added subscribers: Enna1, mgorny. · View Herald Transcript
thetruestblue requested review of this revision.Sep 16 2022, 3:55 PM
Herald added a project: Restricted Project. · View Herald TranscriptSep 16 2022, 3:55 PM
Herald added a subscriber: Restricted Project. · View Herald Transcript
wrotki accepted this revision.Sep 16 2022, 5:32 PM

I mean, I'm good accepting it too

This revision is now accepted and ready to land.Sep 16 2022, 5:32 PM
rsundahl accepted this revision.Sep 19 2022, 8:37 AM

This looks like the best way to stay with c++17 so LGTM.

yln accepted this revision.Sep 19 2022, 10:07 AM

LGTM, with nits:

[Apple][Sanitizer] Up min version of macos to support necessary language features for c++17

Please update the commit message so it mentions that we raising the deployment target for the test suite, not the the product, e.g.:

"[Sanitizer] Bump macOS deployment target for sanitizer unit test binary to support C++17 requirements"

compiler-rt/lib/sanitizer_common/tests/CMakeLists.txt
106

Is the if ever not true after the bump to C++17? Is there risk to doing this unconditionally? If not, I would prefer to do it unconditionally.

C++ standard can be manually overwritten and manually defined. As the codebase stands, without this overwrite, no this is never not true. And in the case of someone running Apple tests, I'm not sure *why* this would happen. But because the the mechanism exists, I added a conditional. I agree that guarding tests against every potential case might be unnecessary.

removed conditionalw

thetruestblue marked an inline comment as done.Sep 19 2022, 12:15 PM
thetruestblue retitled this revision from [Apple][Sanitizer] Up min version of macos to support necessary language features for c++17 to [Sanitizer] Bump macOS deployment target for sanitizer unit test binary to support C++17 requirements..
thetruestblue edited the summary of this revision. (Show Details)

Updating commit message

wrotki accepted this revision.Sep 19 2022, 12:50 PM

Reapproving commit message change

thakis added a subscriber: thakis.Sep 20 2022, 3:50 AM

Out of interest, what's the problem without this? Sanitizer tests were passing on our bots before this change too as far as I can tell.