Commit Graph

520 Commits

Author SHA1 Message Date
Louis Dionne 7ad8e19958 [libc++] Move the GDB pretty printer tests to the DSL
Also, enable them whenever we detect that gdb is available. Previously,
these tests would basically never run because they relied on a CMake
configuration option that defaulted to OFF.

Differential Revision: https://reviews.llvm.org/D91434
2020-11-16 16:16:39 -05:00
Louis Dionne e56eea26ca [libc++] Install GDB in the Docker images
This will allow running the GDB pretty printer tests.
2020-11-13 11:57:54 -05:00
Ruslan Arutyunyan e5ec94a1a0 [libc++] Implement P0919R3: heterogenous lookup for unordered containers
Implement heterogenous lookup for unordered containers, including the
refinement from P1690R1.

Differential Revision: https://reviews.llvm.org/D87171
2020-11-11 17:44:42 -05:00
Louis Dionne c1887e3f15 Revert "Allow running back-deployment testing against libc++abi"
This reverts commit 4d79ef814a, which broke a few build bots.
I'm reverting until I have time to investigate.
2020-11-06 17:26:42 -05:00
Louis Dionne 1d53b55e18 [libc++] Try fixing the oss-fuzz build
See https://github.com/google/oss-fuzz/issues/4586.
2020-11-06 10:06:44 -05:00
Louis Dionne 4d79ef814a Allow running back-deployment testing against libc++abi
Summary:
Before this patch, we could only link against the back-deployment libc++abi
dylib. This patch allows linking against the just-built libc++abi, but
running against the back-deployment one -- just like we do for libc++.

Also, add XFAIL markup to flag expected errors.
2020-11-06 08:12:46 -05:00
Louis Dionne 75b6726b57 [libc++] Also allow customizing the build directory when running CI 2020-11-05 19:10:08 -05:00
Louis Dionne 3790e17f46 [libc++] Allow customizing a few paths when running build bots
This allows reusing run-buildbot for downstream testing as well.
2020-11-05 19:02:32 -05:00
Louis Dionne bb43a0cd4a [libc++] Add a Buildkite job that tests back-deployment on Apple
The current way we test this is pretty cheap, i.e. we download previously
released macOS dylibs and run against that. Ideally, we would require a
full host running the appropriate version of macOS, and we'd execute the
tests using SSH on that host. But since we don't have such hosts available
easily for now, this is better than nothing.

At the same time, also fix some tests that were failing when back
deploying.

Differential Revision: https://reviews.llvm.org/D90869
2020-11-05 18:26:08 -05:00
Louis Dionne f7e4f041d6 [libc++] Add a CI job to build the documentation
At the same time, fix an issue that broke the documentation since 2eadbc8614.
2020-11-05 15:33:09 -05:00
Louis Dionne 738d981eb6 [libc++] Update the CI Dockerfile
Remove Phabricator, which isn't needed anymore since we don't report
the job results ourselves. Also, install python3-sphinx instead of
sphinx-doc, since the latter doesn't provide the sphinx-build binary.
2020-11-05 15:33:09 -05:00
Louis Dionne 2eadbc8614 [libc++] Rework the whole availability markup implementation
Currently, vendor-specific availability markup is enabled by default.
This means that even when building against trunk libc++, the headers
will by default prevent you from using some features that were not
released in the dylib on your target platform. This is a source of
frustration since people building libc++ from sources are usually not
trying to use some vendor's released dylib.

For that reason, I've been thinking for a long time that availability
annotations should be off by default, which is the primary change that
this commit enables.

In addition, it reworks the implementation to make it easier for new
vendors to add availability annotations for their platform, and it
refreshes the documentation to reflect the current state of the codebase.

Finally, a CMake configuration option is added to control whether
availability annotations should be turned on for the flavor of libc++
being created. The intent is for vendors like Apple to turn it on, and
for the upstream libc++ to leave it off (the default).

Differential Revision: https://reviews.llvm.org/D90843
2020-11-05 12:28:52 -05:00
Louis Dionne 8e01749bb1 [libc++] Remove stray setting of use_system_cxx_lib left behind 2020-11-04 15:01:59 -05:00
Louis Dionne 70eb30cc81 [libc++] Move availability-related Lit configuration to the DSL
The implementation is not really satisfactory, but it's better than
being in the legacy config, which causes other issues.
2020-11-04 14:56:08 -05:00
Steven Wan 09f2c92e5b Add info about the cherry-picked commit and contributor 2020-11-04 14:23:27 -05:00
Steven Wan 296c2f31f0 [PowerPC] Rename mftbl to mftb
`mftb` and `mftbl` are equivalent, there is no need to have two names for doing the same thing, rename `mftbl` to only have `mftb`.

Differential Revision: https://reviews.llvm.org/D89506
2020-11-04 14:23:27 -05:00
Louis Dionne f1a96de1bc [libc++] Don't run tests in a shell in the default executor 2020-11-04 08:29:05 -05:00
Louis Dionne 5369d8cca7 [libc++] Remove support for .run.fail.cpp tests
Unfortunately, executing these tests correctly on platforms that do not
support a shell is very challenging. Since the executor can't just negate
the result of the command, we'd have to ship a portable program capable
of running the actual test executable, and negating its result.

Doing this portably is challenging. Since we do not currently have strong
use cases for tests that fail at runtime (we effectively have no tests
using that capability right now), it is difficult to justify making them
work portably. Instead, it makes more sense to remove this feature until
we can implement it properly (i.e. without requiring shell support).
2020-11-03 15:40:24 -05:00
Louis Dionne d1217be43f [libc++] NFC: Simplify how we run config tests
We can use the convenience substitutions provided by the format instead
of bootstrapping our own.
2020-11-03 14:59:41 -05:00
Louis Dionne d6e2bac195 [libc++] Migrate warning flags to the DSL
This makes us closer to running the test suite on platforms where the
legacy test suite configuration doesn't work.

One notable change after this commit is that the tests will be run with
warnings enabled on GCC too, which wasn't the case before. However,
previous commits should have tweaked the test suite to make sure it
passes with warnings enabled on GCC.

Note that warnings can still be disabled with `--param enable_warnings=False`,
as before.

Differential Revision: https://reviews.llvm.org/D90432
2020-11-02 12:25:05 -05:00
Louis Dionne 6b2de7c53a [libc++][CI] Allow retries in case an agent is lost
We see this fairly often on our Linux bots, which appear to be killed
by GCE from time to time.
2020-11-02 11:58:45 -05:00
Louis Dionne b128373eb8 [libc++] Make it easier to re-generate the ABI lists
Instead of having to remember the command-line to use every time, this
commit adds a CMake target to generate the ABI list in the current
configuration, if it is supported.

As a fly-by change, remove scripts that are now unused (sym_match.py
and sym_extract.py).
2020-11-02 11:36:35 -05:00
Louis Dionne 1b2fa6e46e [libc++/libc++abi] Use Python3_EXECUTABLE consistently to run utilities 2020-11-02 11:07:31 -05:00
Louis Dionne 4dfe014a12 [libc++] Add -Wno-sized-deallocation to avoid spurious GCC warnings
GCC tries to be nice and tell us that we probably want to also implement
sized deallocation functions when we override the normal ones. However,
we know what we're doing in the test suite and don't want to override
them.
2020-10-30 12:51:07 -04:00
Louis Dionne d085697013 [libc++] Add a new concept of ConfigAction, and use it in the DSL
This will allow adding bare compiler flags through the new
configuration DSL. Previously, this would have required adding
a Lit feature for each such flag.

Differential Revision: https://reviews.llvm.org/D90429
2020-10-30 09:27:15 -04:00
Daniel Kiss fd1c064845 [libcxx] Add targets to available features.
This patch add the target-* (x86_64-*) as used elsewhere in llvm.

Reviewed By: #libc, #libc_abi, ldionne

Differential Revision: https://reviews.llvm.org/D88027
2020-10-29 14:04:11 +01:00
Louis Dionne c56bbb3961 [libc++] Make sure we include a header when checking compiler macros
Otherwise, it's possible for some __config_site macros not to be
picked up.
2020-10-27 15:58:43 -04:00
Louis Dionne 88ffc72717 [libc++] Add a libc++ configuration that does not support localization
When porting libc++ to embedded systems, it can be useful to drop support
for localization, which these systems don't implement or care about.

Differential Revision: https://reviews.llvm.org/D90072
2020-10-27 14:56:30 -04:00
Louis Dionne 87d3a5365e [libc++] Remove references to CONDUIT_TOKEN
It's not required anymore, since we rely on another job to report
the results back to Phabricator.
2020-10-27 12:26:44 -04:00
Louis Dionne 8cd7786e48 [libc++] NFC: Consistent indentation for buildkite-pipeline.yml 2020-10-26 14:54:13 -04:00
Louis Dionne b888463f8d [libc++abi] Make sure we can run the tests in Standalone mode
The tests would previously fail if the `python` executable wasn't found,
because we were missing the mandatory find_package.
2020-10-26 14:26:44 -04:00
Louis Dionne 88374f76ee [libc++] Fix indentation of buildkite-pipeline.yml 2020-10-26 12:58:37 -04:00
Louis Dionne d3024a074b [libc++] Add a CI jobs to test the Standalone builds 2020-10-26 12:13:19 -04:00
Louis Dionne cb9f6c4c8c [libc++] Clean up unused CI files
Those were useful during CI experimentation, but are not used anymore.
2020-10-23 15:21:04 -04:00
Louis Dionne 2f8dd2687f [libc++] Refactor the run-buildbot script to make it more modular, and run the benchmarks
As a fly-by fix, unbreak the benchmarks on Apple platforms.

Differential Revision: https://reviews.llvm.org/D90043
2020-10-23 15:11:41 -04:00
Louis Dionne 48e4b0fd3a [runtimes] Revert the libc++ __config_site change
This is a massive revert of the following commits (from most revent to oldest):

	2b9b7b5775.
	529ac33197
	28270234f1
	69c2087283
	b5aa67446e
	5d796645d6

After checking-in the __config_site change, a lot of things started breaking
due to widespread reliance on various aspects of libc++'s build, notably the
fact that we can include the headers from the source tree, but also reliance
on various "internal" CMake variables used by the runtimes build and compiler-rt.

These were unintended consequences of the change, and after two days, we
still haven't restored all the bots to being green. Instead, now that I
understand what specific areas this will blow up in, I should be able to
chop up the patch into smaller ones that are easier to digest.

See https://reviews.llvm.org/D89041 for more details on this adventure.
2020-10-23 09:41:48 -04:00
Louis Dionne d098bb39aa [libc++] Allow running the tests in the experimental runtimes-only build 2020-10-22 17:04:22 -04:00
Mikhail Goncharov 40f360c2e9 [libc++] Update continous integration scripts
Now libc++ pipeline will be triggered from the "premerge-checks" and the
combined result are going to be returned to Harbormaster.

Reviewed-by: ldionne

Differential Revision: https://reviews.llvm.org/D89113
2020-10-22 10:49:40 +02:00
Louis Dionne 1913bb622c [libc++][ci] Also install the library in the CI scripts
It's good to run the installation step to make sure it works properly,
as build system changes can break that.
2020-10-21 17:34:58 -04:00
Louis Dionne 5d796645d6 [take 2] [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
hand.

This commit was originally applied in 1e46d1aa3 and reverted in eb60c487
because it broke the libc++abi and libunwind test suites. This has now
been fixed.

Differential Revision: https://reviews.llvm.org/D89041
2020-10-21 10:40:33 -04:00
Louis Dionne eb60c48744 [libc++] Revert "Include <__config_site> from <__config>"
This temporarily reverts commit 1e46d1aa until I find a solution to fix
the libc++abi and libunwind test suites with that change.
2020-10-21 09:18:29 -04:00
Louis Dionne 1e46d1aa3f [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
hand.

Differential Revision: https://reviews.llvm.org/D89041
2020-10-21 08:46:57 -04:00
Louis Dionne c2279b262f [libc++] Make it easier to add new restrictions for feature-test macro tests 2020-10-20 15:52:57 -04:00
Martin Storsjö b30e42922a [libcxx] [test] Avoid conflicting definitions of _CRT_SECURE_NO_WARNINGS
This is defined both by libcxx/utils/libcxx/test/config.py (for
any windows target) and msvc_stdlib_force_include.h (when testing
specifically the MSVC C++ library).

The command line define (-D_CRT_SECURE_NO_WARNINGS) defines it to the
value 1; change the header define to match that.

Keeping both instances, to keep the fix for cases when not building
in cases that don't use config.py.

Also remove a comment about whether this can be removed; it can't at
least be removed altogether - doing that breaks a number of tests that
otherwise succeed.

Differential Revision: https://reviews.llvm.org/D89588
2020-10-20 19:44:21 +03:00
Martin Storsjö 5c39eebc12 [libcxx] [test] Fix filesystem_test_helper.h to compile for windows
Use .string() instead of .native() in places where we want to combine
paths with std::string.

Convert some methods to take a fs::path as parameter instead of
std::string, for cases where they are called with paths as
parameters (which can't be implicitly converted to std::string if
the path's string_type is wstring).

Differential Revision: https://reviews.llvm.org/D89530
2020-10-20 00:07:02 +03:00
Louis Dionne b4bd194378 [libc++] Refactor the fuzzing tests
Define all the fuzzing tests in libcxx/test/libcxx/fuzzing, and get
rid of the ad-hoc libcxx/fuzzing directory, which wasn't properly
integrated with the build system or test suite.

As a fly-by change, this also reduces the dependencies of fuzzing tests
on large library components like <iostream>, to make them work on more
platforms.
2020-10-19 12:11:50 -04:00
Alex Richardson 7928d40c6b [libc++][dsl] Run checks for locale names aliases using a single %exec
This changes the checking for available locales to use one program that
iterates over argv to test multiple locale names instead of checking each
name with a separate executable.

This massively speeds up running individual tests using an SSH executor
(it can take up to 10 seconds to compile and run a single test in some
emulated environments) in case no locales are installed since then all
fallback names are tested idividually. But even on a native machine
this reduces the libc++ lit startup time by ~1-2 second for me on a machine
that does not have locale data installed.

Reviewed By: #libc, ldionne
Differential Revision: https://reviews.llvm.org/D88884
2020-10-18 18:17:50 +01:00
Louis Dionne 2408fc2a1e [libc++] Avoid relying on `realpath` being installed on the system
It doesn't appear to be a standard utility.
2020-10-16 13:07:18 -04:00
Louis Dionne 880fc4d581 [libc++] Move the oss-fuzz script to libcxx/utils/ci 2020-10-16 12:40:43 -04:00
Louis Dionne e0d01294bc [libc++] Allow building libc++ on platforms without a random device
Some platforms, like several embedded platforms, do not provide a source
of randomness through a random device. This commit makes it possible to
build and test libc++ for such platforms, i.e. without std::random_device.

Surprisingly, the only functionality that doesn't work on such platforms
is std::random_device itself -- everything else in <random> still works,
one just has to find alternative ways to seed the PRNGs.
2020-10-15 12:20:29 -04:00