[libcxx-dev] Heads up: development workflow for testing header-only changes
Louis Dionne via libcxx-dev
libcxx-dev at lists.llvm.org
Wed Oct 21 05:54:03 PDT 2020
Dear libc++ folks,
I just checked in a change that will make libc++'s testing simpler and more robust. It does adds a tiny bit of complexity for the development workflow when making header-only changes in libc++, however. If you've been running `lit` manually after making header-only changes, you will now have to run `check-cxx-deps` before you do that every time you make header-only changes. This is not needed if you just run the whole test suite through `nina check-cxx`.
The reason is that we're now testing against a fake installation of the libc++ headers, which contains `__config_site` exactly the same way we ship it. Previously, we would have some logic to automatically include `__config_site` when running the tests if it exists, but that was brittle. However, since that installation root is a copy of the headers in the source tree, it needs to be updated whenever changes are made to the headers, hence the need to "rebuild" the `check-cxx-deps` target.
I've documented the workflow change in TestingLibcxx.rst. In a follow-up change, I'll also include the built library in the fake installation root, and then we'll be testing against something that looks 100% like what we ship.
The commit is:
Author: Louis Dionne <ldionne at apple.com>
Date: Fri Jun 26 12:08:59 2020 -0400
[libc++] Include <__config_site> from <__config>
Prior to this patch, we would generate a fancy <__config> header by
concatenating <__config_site> and <__config>. This complexifies the
build system and also increases the difference between what's tested
and what's actually installed.
This patch removes that complexity and instead simply installs <__config_site>
alongside the libc++ headers. <__config_site> is then included by <__config>,
which is much simpler. Doing this also opens the door to having different
<__config_site> headers depending on the target, which was impossible before.
It does change the workflow for testing header-only changes to libc++.
Previously, we would run `lit` against the headers in libcxx/include.
After this patch, we run it against a fake installation root of the
headers (containing a proper <__config_site> header). This makes use
closer to testing what we actually install, which is good, however it
does mean that we have to update that root before testing header changes.
Thus, we now need to run `ninja check-cxx-deps` before running `lit` by
Differential Revision: https://reviews.llvm.org/D89041
More information about the libcxx-dev