This is an archive of the discontinued LLVM Phabricator instance.

[libcxx][libcxxabi][libunwind] Honor CMAKE_SYSROOT in tests
Needs RevisionPublic

Authored by abrachet on May 21 2023, 9:15 PM.

Details

Reviewers
phosek
ldionne
Group Reviewers
Restricted Project
Restricted Project
Restricted Project

Diff Detail

Event Timeline

abrachet created this revision.May 21 2023, 9:15 PM
Herald added a project: Restricted Project. · View Herald TranscriptMay 21 2023, 9:15 PM
Herald added a subscriber: arichardson. · View Herald Transcript
abrachet requested review of this revision.May 21 2023, 9:15 PM
phosek accepted this revision.May 22 2023, 1:15 AM

LGTM

This revision is now accepted and ready to land.May 22 2023, 1:15 AM
abrachet updated this revision to Diff 534551.Jun 26 2023, 7:21 AM

Rebase + use new formatting of py file

@ldionne do you have any objections, or would we be safe to land this?

abrachet updated this revision to Diff 539114.Jul 11 2023, 8:14 AM
abrachet added a reviewer: Restricted Project.
abrachet added a project: Restricted Project.
philnik set the repository for this revision to rG LLVM Github Monorepo.Jul 11 2023, 10:05 AM
Herald added 1 blocking reviewer(s): Restricted Project. · View Herald TranscriptJul 11 2023, 10:05 AM
Herald added projects: Restricted Project, Restricted Project. · View Herald Transcript
Herald added a reviewer: Restricted Project. · View Herald Transcript
Herald added a reviewer: Restricted Project. · View Herald Transcript
This revision now requires review to proceed.Jul 11 2023, 10:05 AM

I don't think this is the path we want to take. We shouldn't be setting -isysroot manually in these configs, I've always seen it as technical debt that we did. What's your motivation for doing this?

ldionne requested changes to this revision.Sep 13 2023, 10:27 AM
This revision now requires changes to proceed.Sep 13 2023, 10:27 AM

I just did some digging and the reason for setting -isysroot manually in these config files is basically that CMake will resolve clang++ to the result of xcrun --find clang++ when it sets CMAKE_CXX_COMPILER: https://gitlab.kitware.com/cmake/cmake/-/issues/19180. Without this issue, we wouldn't be setting -isysroot manually at all.

We always use the just built Clang (built using the bootstrap build) even on Darwin, which is not recognized by xcrun --find clang, so we need to manually pass -isysroot.

I believe the latest incarnation of https://github.com/llvm/llvm-project/pull/66265 fixes your issues with the bootstrapping build as well. The reason why I want to go down that route instead of doing this patch is that we should aim to *simplify* how the compiler is invoked and make it closer to what end users will do, instead of adding more and more flags to make it do what we want. This is important because we strive to test-as-we-ship as much as we can, to avoid issues where our test suite doesn't really reflect the reality of how users use the library. If you agree that https://github.com/llvm/llvm-project/pull/66265 solves your problem, let's abandon this.