Commit Graph

730 Commits

Author SHA1 Message Date
David Spickett 5efafc3e65 Revert "[libcxx][pretty printers] Import gdb module in gdb feature check"
This reverts commit 0c2a454845.

This was my mistake. When gdb can find its data directory it'll
import it automatically. If it can't (like when you're using a
version from a build folder) you need to give it the data
directory path.

We're safe to assume gdb is installed for testing purposes
so it'll import it for us.
2021-09-24 09:11:28 +00:00
David Spickett 0c2a454845 [libcxx][pretty printers] Import gdb module in gdb feature check
Earlier versions of GDB do not do this automatically.
(from my checks 8.3 does not and 9.2 does)
2021-09-24 09:04:44 +00:00
David Spickett 0a36c72dee [libcxx][pretty printers] Check GDB Python scripting support
I found this after upgrading from Ubuntu bionic (gdb 8.1.1) to
Focal (gdb 9.2). (where this test fails, but that's for a
different patch)

9.2 allows you to set breakpoint commands from
Python, which was added in 8.3.
(bintutils a913fffbdee21fdd50e8de0596358be425775678
"Allow breakpoint commands to be set from Python")

The reason this test never failed before was because it did so
silently. "source <python file>" doesn't fail even if that script
raises an Exception.

To fix this extend the gdb lit feature to check that:
* gdb exists
* has Python support
* allows you to set breakpoint commands

Reviewed By: #libc, ldionne

Differential Revision: https://reviews.llvm.org/D110334
2021-09-24 08:32:11 +00:00
Louis Dionne b1fb3d75c9 [libc++] Implement C++20's P0476R2: std::bit_cast
Thanks to Arthur O'Dwyer for fixing up some of the tests.

Differential Revision: https://reviews.llvm.org/D75960
2021-09-09 11:05:54 -04:00
Louis Dionne 3765d284c4 [libc++] Provide a way to trigger rebuild of Docker images in the CI 2021-09-09 09:59:44 -04:00
Louis Dionne d61ec93ff2 [libc++] Move additional build bots to the from-scratch config
Once all the bots are passing with from-scratch configs, we can attempt
to make the from-scratch config the default configuration.

Differential Revision: https://reviews.llvm.org/D103417
2021-09-09 09:14:43 -04:00
Louis Dionne 8660b89c0c [libc++] Clean up the no-unicode CI job
It was added after we changed the way the CI jobs are run, in particular
how they are pinned down to Linux instances only. As a result, the job
would sometimes run on Mac machines, which we're trying to keep only for
jobs that absolutely need it due to capacity concerns.
2021-09-09 08:39:30 -04:00
Vladimir Vereschaka 621e437e03 [libc++] Provide 'buildhost=<platform> feature for the tests.
The target platform could differ from the host platform for the cross
platform builds. Some tests are depended on the build host features and
they need to determine a proper platform environment.

This commit adds a build host platform name feature for the libc++ tests
in format `buildhost=<platform>`, such as `buildhost=linux`, `buildhost=darwin`,
`buildhost=windows`, etc.

The Windows host gets two features: one `buildhost=windows` and another based
on Windows "sub-system", such as `buildhost=win32`, `buildhost=cygwin`, etc.

Differential Revision: https://reviews.llvm.org/D102045
2021-09-07 11:49:53 -04:00
Mark de Wever df2af9936c [libc++][format] Add a CMake Unicode option.
This option is used to select between the format headers output column
width option. This option should be independent of the locale setting.
It's encouraged to default to Unicode unless the platform doesn't offer
that option.

[format.string.std]/10
```
  For the purposes of width computation, a string is assumed to be in a
  locale-independent, implementation-defined encoding. Implementations
  should use a Unicode encoding on platforms capable of displaying Unicode
```

Reviewed By: #libc, ldionne, vitaut

Differential Revision: https://reviews.llvm.org/D103379
2021-09-04 11:55:10 +02:00
Louis Dionne 87dd51983c [libc++] Remove support for CloudABI, which has been abandoned
Based on https://github.com/NuxiNL/cloudlibc, it appears that the CloudABI
project has been abandoned. This patch removes a bunch of CloudABI specific
logic that had been added to support that platform.

Note that some knobs like LIBCXX_ENABLE_STDIN and LIBCXX_ENABLE_STDOUT
coud be useful in their own right, however those are currently broken.
If we want to re-add such knobs in the future, we can do it like we've
done it for localization & friends so that we can officially support
that configuration.

Differential Revision: https://reviews.llvm.org/D108637
2021-08-24 14:11:32 -04:00
Louis Dionne 0166690401 [libc++] Remove workarounds for the lack of deduction guides in C++17
All supported compilers have supported deduction guides in C++17 for a
while, so this isn't necessary anymore.

Differential Revision: https://reviews.llvm.org/D108213
2021-08-18 08:57:25 -04:00
Dan Albert d42be2d63c Remove unused imports. 2021-08-17 13:04:02 -07:00
Louis Dionne dc0d4b97a2 [libc++] Update the version of CMake in the Docker image 2021-08-17 13:35:57 -04:00
Louis Dionne b408bbbf5b [libc++] Avoid conflating stderr and stdout in the DSL
This is a workaround until https://reviews.llvm.org/D81892 is merged
and the internal Lit shell stops conflating error output with normal
output. Without this, any program that writes to stderr will trip up
the programOutput function, because it will pick up the '# command stderr:'
string and think it's part of the command's stdout.

rdar://81056048

Differential Revision: https://reviews.llvm.org/D107912
2021-08-11 17:06:56 -04:00
Louis Dionne 7c81024a06 [libc++] Remove workarounds for missing __builtin_addressof
All supported compilers implement __builtin_addressof. Even MSVC implements
addressof as a simple call to __builtin_addressof, so it would work if we
were to port libc++ to that compiler.

Differential Revision: https://reviews.llvm.org/D107905
2021-08-11 17:05:12 -04:00
Louis Dionne 15071d2945 [libc++] Remove _LIBCPP_HAS_UNIQUE_OBJECT_REPRESENTATIONS
All supported compilers have implemented __has_unique_object_representations
for a while, so it's reasonable to remove the workaround.

Differential Revision: https://reviews.llvm.org/D107834
2021-08-11 10:11:40 -04:00
Louis Dionne 7be03cc782 [libc++] Remove _LIBCPP_HAS_NO_IS_AGGREGATE
All supported compilers have been supporting __is_aggregate for a long
time now, so it's reasonable to remove this workaround.

Differential Revision: https://reviews.llvm.org/D107833
2021-08-11 10:10:53 -04:00
Mark de Wever 1123100a16 [libcxx] Remove _LIBCPP_HAS_NO_BUILTIN_IS_CONSTANT_EVALUATED
All supported compilers should support
_LIBCPP_HAS_NO_BUILTIN_IS_CONSTANT_EVALUATED so this can be removed.

Reviewed By: ldionne, #libc, Quuxplusone

Differential Revision: https://reviews.llvm.org/D107239
2021-08-10 18:59:55 +02:00
Louis Dionne d232ec3c2a [libc++] Add timeout to BuildKite jobs
We just had a case where a build bot stalled in an infinite loop during
testing, and the whole pipeline got stuck. To avoid that from happening
in the future, use a timeout on BuildKite jobs.

Differential Revision: https://reviews.llvm.org/D107765
2021-08-09 15:31:04 -04:00
David Spickett e517a2405f Revert "[libcxx][CI] Work around Arm buildkite failures"
This reverts commit f8bef47348.

Buildkite agent 3.32.0 includes a fix for the PATH issue.
https://github.com/buildkite/agent/releases/tag/v3.32.0

Differential Revision: https://reviews.llvm.org/D107172
2021-08-02 09:32:08 +01:00
Louis Dionne 9efffe8278 [libc++][NFC] Make private header generation CMake comment more consistent 2021-07-29 14:17:04 -04:00
Arthur O'Dwyer 20c6ddc5bc [libc++] Remove unused variables in generate_private_header_tests.py. NFCI. 2021-07-28 22:28:25 -04:00
Mark de Wever 71909de374 [libc++] Disable incomplete library features.
Adds a new CMake option to disable the usage of incomplete headers.
These incomplete headers are not guaranteed to be ABI stable. This
option is intended to be used by vendors so they can avoid their users
from code that's not ready for production usage.

The option is enabled by default.

Differential Revision: https://reviews.llvm.org/D106763
2021-07-27 22:37:35 +02:00
Louis Dionne 45478619e3 [libc++] CI: Run -std=c++03 on Clang ToT
Differential Revision: https://reviews.llvm.org/D106104
2021-07-27 14:13:28 -04:00
Louis Dionne 496a3815f4 [libc++] NFC: Try to trigger Docker image rebuild on CI nodes 2021-07-27 10:02:00 -04:00
Louis Dionne 069428b6f7 [libc++] Set the target triple by default in the standalone build
Even though the standalone build is deprecated, some people are still
relying on it (including libc++ itself for some configurations). Setting
the target triple will ensure that the build and the test suite behaves
consistently in the standalone and normal builds.

Differential Revision: https://reviews.llvm.org/D106800
2021-07-26 15:04:45 -04:00
Mark de Wever 1139fd4270 [libc++][ci] Detect not committed generated files.
The Generated output CI job only tests for modified files. This job
should also fail the generated output contains new files.

It would be possible to test modified and untracked files in one
execution of `git ls-files`. However the diff is stored as an artifact
so the execution of `git diff` would still be required.

Discussion: Would it be better to do `git ls-files -om` and remove the
excution of
`! grep -q '^--- a' ${BUILD_DIR}/generated_output.patch || false` ?
(Obviously then the name `generated_output.untracked` should change to
something like `generated_output.status`)

Reviewed By: #libc, ldionne

Differential Revision: https://reviews.llvm.org/D106534
2021-07-26 16:41:57 +02:00
Louis Dionne 9333d34b8a [libc++] Disable #pragma system_header in the new testing configuration
The new testing configuration did not turn off #pragma system_header,
which means we were not seeing warnings in system headers.

Differential Revision: https://reviews.llvm.org/D106187
2021-07-19 14:38:24 -04:00
Christopher Di Bella e37bbfe59c [libcxx][modules] protects users from relying on libc++ detail headers (1/n)
libc++ has started splicing standard library headers into much more
fine-grained content for maintainability. It's very likely that outdated
and naive tooling (some of which is outside of LLVM's scope) will
suggest users include things such as `<__algorithm/find.h>` instead of
`<algorithm>`, and Hyrum's law suggests that users will eventually begin
to rely on this without the help of tooling. As such, this commit
intends to protect users from themselves, by making it a hard error for
anyone outside of the standard library to include libc++ detail headers.

This is the first of four patches. Patch #2 will solve the problem for
pre-processor `#include`s; patches #3 and #4 will solve the problem for
`<__tree>` and `<__hash_table>` (since I've never touched the test cases
that are failing for these two, I want to split them out into their own
commits to be extra careful). Patch #5 will concern itself with
`<__threading_support>`, which intersects with libcxxabi (which I know
even less about).

Differential Revision: https://reviews.llvm.org/D105932
2021-07-16 22:39:18 +00:00
Louis Dionne fbc3e69f58 [libc++] ci: Create ~/Library/LaunchAgents if it does not exist yet 2021-07-16 11:48:10 -04:00
Louis Dionne 18e21e6832 [libc++] CI: Setup BuildKite agents through launchd
This makes sure that even if a node goes down, the BuildKite agent will
be started again when it goes back up.
2021-07-16 11:40:08 -04:00
Louis Dionne 851a335b1e [libc++] Add a job running GCC with C++11
This configuration is interesting because GCC has a different level of
strictness for some C++ rules. In particular, it implements the older
standards more stringently than Clang, which can help find places where
we are non-conforming (especially in the test suite).

Differential Revision: https://reviews.llvm.org/D105936
2021-07-15 22:13:03 -04:00
Louis Dionne 8fb47456a3 [libc++/abi] Fix broken Lit feature no-noexcept-function-type
The feature was always defined, which means that the two test cases
guarded by it were never run.

Differential Revision: https://reviews.llvm.org/D106062
2021-07-15 14:42:07 -04:00
Louis Dionne 4628ff4c31 [libc++] NFC: Reindent the run-buildbot script 2021-07-15 13:29:58 -04:00
Louis Dionne 1f8e286cdc [libc++] Add a CMake target to re-generate files and revamp CONTRIBUTING.rst
As we automate more and more things in the library, it becomes useful for
contributors to have a single target for running all the automation as
part of their workflow. This commit adds a new `libcxx-generate-files`
target that should re-generate all the auto-generated files in the library.

As a fly-by, I also revamped the documentation on Contributing to account
for this new target and present it as a bullet list of things to check
before committing. I also added a few things that are often overlooked
to that list, such as updating the synopsis and the status files.

Differential Revision: https://reviews.llvm.org/D106067
2021-07-15 12:07:26 -04:00
Louis Dionne 2a399e60b6 [libc++] Add a CI job for macOS on arm64 hardware 🥳
Differential Revision: https://reviews.llvm.org/D105848
2021-07-13 13:49:05 -04:00
Louis Dionne 04942a7ffc [libc++] NFC: Add comment for running macOS CI setup script remotely 2021-07-13 13:35:29 -04:00
Louis Dionne c5ad8bb8d4 [libc++] Target x86_64 only for the backdeployment jobs
Differential Revision: https://reviews.llvm.org/D105846
2021-07-13 10:29:08 -04:00
Louis Dionne e47444e216 [libc++] ci: Properly target macOS nodes per-os 2021-07-12 17:26:16 -04:00
Louis Dionne cb30d597c4 [libc++] Add the 'os=macos' tag to macOS nodes to workaround lack of wildcard matching 2021-07-12 17:22:34 -04:00
Louis Dionne 15df9c9881 [libc++][ci] Clean up the Docker image
- Remove symlinks that are not used anymore
- Stop installing GCC 10, which isn't tested anymore
2021-07-12 17:04:25 -04:00
Louis Dionne 877e97a954 [libc++] Use 'os' tags to target Linux libc++ builders 2021-07-12 17:01:54 -04:00
Louis Dionne 0a9afaf736 [libc++] Encode the arch and OS in buildkite agent tags 2021-07-12 16:01:38 -04:00
Louis Dionne 1ca748608d [libc++] Exit from macos-ci-setup upon error 2021-07-12 15:44:35 -04:00
Louis Dionne 87bfc49db5 [libc++][ci] Add arch and os tags to the macOS CI builders 2021-07-12 15:34:57 -04:00
Louis Dionne 5208ec5c66 [libc++] Update Google benchmark to v 1.5.5 2021-07-12 13:59:03 -04:00
Louis Dionne 85cce4d485 [libc++] Test on Clang ToT by default
This is what ffccf96e90 should have enabled, however the symlink
in the Docker image was not pointing to the right compiler, so we were
testing with Clang 12 instead of ToT.
2021-07-12 11:13:43 -04:00
David Spickett f8bef47348 [libcxx][CI] Work around Arm buildkite failures
For reasons unknown, the build is now using compilers
from /usr/bin instead of /usr/local/bin which is where
we have our clang-12 aliases placed.

Reviewed By: #libc, ldionne

Differential Revision: https://reviews.llvm.org/D105704
2021-07-09 15:29:49 -04:00
Louis Dionne 7a372c4ce1 [libc++][ci] Keep the C++03 build job on Clang 12
Because of https://reviews.llvm.org/D104500, libc++ is broken with
recent Clangs in C++03 mode.
2021-07-09 12:22:48 -04:00
Louis Dionne ffccf96e90 [libc++][ci] Test Clang ToT by default, and add jobs on Clang 11 and 12
It makes the most sense to test with Clang ToT by default since that's
exactly what we're trying to QA: that libc++ works with whatever compiler
we're going to release next.
2021-07-09 10:17:12 -04:00