This is an archive of the discontinued LLVM Phabricator instance.

[runtimes] Add tests for vendor-specific properties
ClosedPublic

Authored by ldionne on Sep 29 2021, 10:35 AM.

Details

Summary

Vendors take libc++ and ship it in various ways. Some vendors might
ship it differently from what upstream LLVM does, i.e. the install
location might be different, some ABI properties might differ, etc.

In the past few years, I've come across several instances where
having a place to test some of these properties would have been
incredibly useful. I also just got bitten by the lack of tests
of that kind, so I'm adding some now.

The tests added by this commit for Apple platforms have numerous
TODOs that capture discrepancies between the upstream LLVM CMake
and the slightly-modified build we perform internally to produce
Apple's system libc++. In the future, the goal would be to upstream
all those differences so that it's possible to build a faithful
Apple system libc++ with the upstream LLVM sources only.

But this isn't only useful for Apple - this lays out the path for
any vendor being able to add their own checks (either upstream or
downstream) to libc++.

This is a re-application of 9892d1644f, which was reverted in 138dc27186be
because it broke the build. The issue was that we didn't apply the required
changes to libunwind and our CI didn't notice it because we were not
running the libunwind tests. This has been fixed now, and we're running
the libunwind tests in CI now too.

Diff Detail

Event Timeline

ldionne created this revision.Sep 29 2021, 10:35 AM
ldionne requested review of this revision.Sep 29 2021, 10:35 AM
Herald added projects: Restricted Project, Restricted Project. · View Herald TranscriptSep 29 2021, 10:35 AM
Herald added a reviewer: Restricted Project. · View Herald Transcript
Herald added a reviewer: Restricted Project. · View Herald Transcript
ldionne accepted this revision.Sep 29 2021, 2:21 PM
This revision is now accepted and ready to land.Sep 29 2021, 2:21 PM

Hi. I think this patch may be what's causing the errors we're seeing on our builders (https://luci-milo.appspot.com/p/fuchsia/builders/toolchain.ci/clang-linux-x64/b8834719104333485313):

llvm-lit: /b/s/w/ir/x/w/llvm-project/llvm/utils/lit/lit/TestingConfig.py:102: fatal: unable to parse config file '/b/s/w/ir/x/w/staging/llvm_build/runtimes/runtimes-x86_64-unknown-linux-gnu-bins/libunwind/test/lit.site.cfg', traceback: Traceback (most recent call last):
  File "/b/s/w/ir/x/w/llvm-project/llvm/utils/lit/lit/TestingConfig.py", line 91, in load_from_path
    exec(compile(data, path, 'exec'), cfg_globals, None)
  File "/b/s/w/ir/x/w/staging/llvm_build/runtimes/runtimes-x86_64-unknown-linux-gnu-bins/libunwind/test/lit.site.cfg", line 60, in <module>
    configuration.configure()
  File "/b/s/w/ir/x/w/llvm-project/libcxx/utils/libcxx/test/config.py", line 135, in configure
    self.configure_substitutions()
  File "/b/s/w/ir/x/w/llvm-project/libcxx/utils/libcxx/test/config.py", line 470, in configure_substitutions
    sub.append(('%{install}',       self.quote(self.config.install_root)))
AttributeError: 'TestingConfig' object has no attribute 'install_root'

Would you be able to send out a fix or revert? Thanks.

uabelho added a comment.EditedSep 30 2021, 12:24 AM

We're seeing the same problem as reported above on current trunk, 455b60ccfbf.

Reverting 9892d1644f locally seems to work without conflicts and at least makes my build pass lit tests without problems.

phosek added a subscriber: phosek.Sep 30 2021, 10:25 AM

@ldionne This broke all of our builders. Can you look into this issue or revert the change if it cannot be addressed quickly?

haowei added a subscriber: haowei.Sep 30 2021, 11:07 AM

Changed reverted in 138dc27186bed4565584387fc49d88b235a1e2ed as author did not respond.
This change broke all of our builders for more than 12hrs.

ldionne reopened this revision.Sep 30 2021, 11:29 AM

Changed reverted in 138dc27186bed4565584387fc49d88b235a1e2ed as author did not respond.
This change broke all of our builders for more than 12hrs.

Thanks for reverting, and sorry for not noticing earlier, but for my defence the first ping happened way after I was off work yesterday. Also, in the future, folks can try to reach out on the #libcxx Discord channel, it's usually the fastest way to get a hold of me (there's a lot of Phabricator emails and this got lost in the noise all morning).

Our CI was green (https://buildkite.com/llvm-project/libcxx-ci/builds/5628). I'm going to look into what happened, I think we are not properly testing libunwind anywhere and that's why the issue went unnoticed.

This revision is now accepted and ready to land.Sep 30 2021, 11:29 AM

Patch to enable libunwind in our CI testing: D110872
Patch to split up part of this patch so it's smaller to land: D110870

ldionne updated this revision to Diff 377709.Oct 6 2021, 3:19 PM
ldionne retitled this revision from [libc++][libc++abi] Add tests for vendor-specific properties to [runtimes] Add tests for vendor-specific properties.
ldionne edited the summary of this revision. (Show Details)

Rebase onto main and fix issues with libunwind

Herald added a project: Restricted Project. · View Herald TranscriptOct 6 2021, 3:19 PM
Herald added a reviewer: Restricted Project. · View Herald Transcript
This revision now requires review to proceed.Oct 6 2021, 3:19 PM
This revision was not accepted when it landed; it landed in state Needs Review.Oct 7 2021, 12:46 PM
This revision was automatically updated to reflect the committed changes.