517 Commits

Author SHA1 Message Date
Robin Caloudis
8965795ed8
[libc++][CI] Upgrade LLVM HEAD version in Docker image (#108774)
Before changing the compiler version in
https://github.com/llvm/llvm-project/pull/108761, we first of all need
to upgrade the HEAD version to `Clang-20` in the Docker files and push
new builder images to the CI.
2024-09-15 20:12:16 +02:00
Martin Storsjö
5024dff6ee
[libc++][ci] Add a test configuration with an incomplete sysroot (#107089)
When bringing up a new cross compiler from scratch, we build
libunwind/libcxx in a setup where the toolchain is incomplete and unable
to perform the normal linker checks; this requires a few special cases
in the CMake files.

We simulate that scenario by removing the libc++ headers, libunwind and
libc++ libraries from the installed toolchain.

We need to set CMAKE_CXX_COMPILER_WORKS since CMake fails to probe the
compiler. We need to set CMAKE_CXX_COMPILER_TARGET, since LLVM's
heuristics fail when CMake hasn't been able to probe the environment
properly. (This is normal; one has to set those options when setting up
such a toolchain from scratch.)

This adds CI coverage for these build scenarios, which otherwise seldom
are tested by some build flow (but are essential when setting up a cross
compiler from scratch).
2024-09-05 10:25:41 -04:00
Louis Dionne
52dc4918ca [libc++][NFC] Use consistent layout for license in Python files
Most Python files were using `# === [...]` instead of `#=== [...]`
so I went with what was the most common in the codebase.
2024-09-04 16:48:41 -04:00
Louis Dionne
0e8208eca1
[libc++] Run the Lit test suite against an installed version of the library (#96910)
We always strive to test libc++ as close as possible to the way we are
actually shipping it. This was approximated reasonably well by setting
up the minimal driver flags when running the test suite, however we were
running the test suite against the library located in the build
directory.

This patch improves the situation by installing the library (the
headers, the built library, modules, etc) into a fake location and then
running the test suite against that fake "installation root".

This should open the door to getting rid of the temporary copy of the
headers we make during the build process, however this is left for a
future improvement.

Note that this adds quite a bit of verbosity whenever running the test
suite because we install the headers beforehand every time. We should be
able to override this to silence it, however CMake doesn't currently
give us a way to do that, see https://gitlab.kitware.com/cmake/cmake/-/issues/26085.
2024-08-28 09:23:00 -04:00
Louis Dionne
e19c3a7e8d
[libc++] Move some macOS CI jobs to Github actions (#89083)
This patch decouples macOS CI testing from BuildKite, which makes the
maintenance of macOS CI easier and more accessible to all contributors.
Right now, the macOS CI is running entirely on machines owned by the
LLVM Foundation with only a small set of contributors having direct
access to them. In particular, updating these machines is currently
a very time-consuming manual process that requires taking the machines
offline, and using Github-provided instances makes that an order of
magnitude easier.

The story for performing back-deployment testing still needs to be
figured out, so for now we are retaining some jobs under BuildKite.
2024-08-27 17:28:12 -04:00
Louis Dionne
8e3aa7e922
[libc++] Fix CMake cache for the hardening with ABI breaks CI (#105864)
We were incorrectly only enabling _LIBCPP_ABI_BOUNDED_ITERATORS, without
enabling bounded iterators in string and vector.
2024-08-26 17:16:37 -04:00
Joseph Huber
7ad7f8f7a3
[libcxx] Add LIBCXX_HAS_TERMINAL_AVAILABLE CMake option to disable print terminal checks (#99259)
Adds a new CMake option called `LIBCXX_HAS_TERMINAL_AVAILABLE` that
prevents us from checking for `isatty`.
2024-08-21 08:48:53 -05:00
David Spickett
f87e9d42c7
[libcxx][test] Update picolibc version (#100348)
This is the latest as of today, and it fixes one of the xfails.

Since
5e4d0c80f4,
TIME_UTC is defined.
2024-07-25 10:24:51 +01:00
Ryan Prichard
d0c8e268c1
[libc++][Android] Fix Android bugs in the CI Dockerfile (#99623)
The base of android-buildkite-builder is buildkite-builder, not
android-build-base. android-build-base is only used for its /opt/android
directory, so move the Docker installation step into
android-buildkite-builder.

Install bzip2 for extracting ndk_platform.tar.bz2.

Add "set -e" to RUN heredocs to catch failing commands.
2024-07-23 13:28:36 -07:00
Ryan Prichard
a1359f5ed4
[libc++][Android] Pass -no-metrics to emulator (#99627)
The Android Emulator has started printing this message, so pass the
`-no-metrics` option:

```
##############################################################################
##                        WARNING - ACTION REQUIRED                         ##
##  Consider using the '-metrics-collection' flag to help improve the       ##
##  emulator by sending anonymized usage data. Or use the '-no-metrics'     ##
##  flag to bypass this warning and turn off the metrics collection.        ##
##  In a future release this warning will turn into a one-time blocking     ##
##  prompt to ask for explicit user input regarding metrics collection.     ##
##                                                                          ##
##  Please see '-help-metrics-collection' for more details. You can use     ##
##  '-metrics-to-file' or '-metrics-to-console' flags to see what type of   ##
##  data is being collected by emulator as part of usage statistics.        ##
##############################################################################
```
2024-07-22 15:30:31 -07:00
Louis Dionne
2f8c786846
[libc++] Refactor buildkite-pipeline.yml (#99483)
This patch removes unused stuff from the Buildkite pipeline definition.
2024-07-19 11:47:34 -04:00
Louis Dionne
50b5bb717c [libc++] Add comment about matching standard version in apple-install-libcxx
This was forgotten when I landed #99086
2024-07-18 16:49:53 -04:00
Louis Dionne
719b2ac42e
[libc++] Allow testing Apple's system library as it is installed (#99086)
In order to test libc++ under the "Apple System Library" configuration,
we need to run the tests using DYLD_LIBRARY_PATH. This is required
because libc++ gets an install_name of /usr/lib when built as a system
library, which means that we must override the copy of libc++ used by
the whole process. This effectively reverts 2cf2f1b, which was the wrong
solution for the problem I was having.

Of course, this assumes that the just-built libc++ is sufficient to
replace the system library, which is not actually the case
out-of-the-box. Indeed, the system library contains a few symbols that
are not provided by the upstream library, leading to undefined symbols
when replacing the system library by the just-built one.

To solve this problem, we separately build shims that provide those
missing symbols and we manually link against them when we build
executables in the tests. While this is somewhat brittle, it provides a
localized and unintrusive way to allow testing the Apple system
configuration in an upstream environment, which has been a frequent
request.
2024-07-18 16:49:07 -04:00
Nikolas Klauser
9ce895c1ae
[libc++] Use GCC compilers from compiler explorer (#97219)
This avoids the very recent system requirements for new GCC versions,
making it a lot easier to update GCC in a timely manner.
2024-07-03 16:29:58 +02:00
Nikolas Klauser
7782de8a1f [libc++] Don't use a ppa for GCC
Ubuntu noble provides all the required compilers, but the ppa doesn't
yet. Simply don't use the ppa to make it possible to update to GCC 14.
2024-06-30 13:37:16 +02:00
Nikolas Klauser
f190343155
[libc++] Upgrade to GCC 14 in the CI (#95212) 2024-06-30 12:14:37 +02:00
Louis Dionne
db8c7e004a
[libc++] Fix deployment target Lit features (#94791)
We were not making any distinction between e.g. the "Apple-flavored"
libc++ built from trunk and the system-provided standard library on
Apple platforms. For example, any test that would be XFAILed on a
back-deployment target would unexpectedly pass when run on that
deployment target against the tip of trunk Apple-flavored libc++. In
reality, that test would be expected to pass because we're running
against the latest libc++, even if it is Apple-flavored.

To solve this issue, we introduce a new feature that describes whether
the Standard Library in use is the one provided by the system by
default, and that notion is different from the underlying standard
library flavor. We also refactor the existing Lit features to make a
distinction between availability markup and the library we're running
against at runtime, which otherwise limit the flexibility of what we can
express in the test suite. Finally, we refactor some of the
back-deployment versions that were incorrect (such as thinking that LLVM
10 was introduced in macOS 11, when in reality macOS 11 was synced with
LLVM 11).

Fixes #82107
2024-06-21 10:31:22 -04:00
Louis Dionne
881dc132a2
[libc++] Install Python packaging to resolve LLDB data formatter issues (#95971)
This should fix the failures that started happening after #93712 landed.
2024-06-19 11:19:55 -04:00
Louis Dionne
2cf2f1b2b6
[libc++] Test suite adjustments on macOS (#95835)
This patch makes a few adjustments to the way we run the tests in the
Apple configuration on macOS:

First, we stop using DYLD_LIBRARY_PATH. Using that environment variable
leads to libc++.dylib being replaced by the just-built one for the whole
process, and that assumes compatibility between the system-provided
dylib and the just-built one. Unfortunately, that is not the case
anymore due to typed allocation, which is only available in the system
one. Instead, we want to layer the just-built libc++ on top of the
system-provided one, which seems to be what happens when we set a rpath
instead.

Second, add a missing XFAIL for a std::print test that didn't work as
expected when building with availability annotations enabled. When we
enable these annotations, std::print falls back to a non-unicode and
non-terminal output, which breaks the test.
2024-06-17 20:36:14 -04:00
Martin Storsjö
67285feffd
[libcxx] [ci] Simplify the mingw x86_64 configs (#95609)
Since switching the Windows CI environment over to GitHub Actions
runners, the mingw tests run in a setup where the default compiler
binary is a mingw-targeting compiler, so we don't need to specify a
custom executable name.

For the i686 tests, we still specify a custom compiler name, in order to
target i686 instead of x86_64.
2024-06-16 23:21:51 +03:00
Eric Fiselier
2c6f4864d1 Update actions-runner version for libc++ builder images 2024-06-12 16:54:23 -04:00
Eric Fiselier
e34f9567c4 Remove act from builder image. It never turned out to be useful 2024-06-04 21:12:31 -04:00
Eric Fiselier
0c2a508f4d Bump actions runner image used for libc++'s builders.
The builders are not producing warnings about the runner version being
out of date. This is an attempt to fix that.
2024-05-02 17:46:28 -04:00
David Spickett
167b50669c
[libcxx][ci] In picolib build, ask clang for the normalised triple (#90722)
This is needed for a workaround to make sure the link later succeeds. I
don't know the reason for that but it is definitely needed.

https://github.com/llvm/llvm-project/pull/89234 will/wants to correct
the triple normalisation for -none- and this means that clang prior to
19, and clang 19 and above will have different answers and therefore
different library paths.

I don't want to bootstrap a clang just for libcxx CI, or require that
anyone building for Arm do the same, so ask the compiler what the triple
should be.

This will be compatible with 17 and 19 when we do update to that
version.

I'm assuming $CC is what anyone locally would set to override the
compiler, and `cc` is the binary name in our CI containers. It's not
perfect but it should cover most use cases.
2024-05-01 15:10:01 +01:00
YunQiang Su
d3925e65a7
CompilerRT: Normalize COMPILER_RT_DEFAULT_TARGET_TRIPLE (#89234)
If LLVM is configured with -DLLVM_DEFAULT_TARGET_TRIPLE, or compiler_rt
is configured with -DCOMPILER_RT_DEFAULT_TARGET_TRIPLE, while the
argument is not normalized, such as Debian-style vendor-less triple,
clang will try to find libclang_rt in lib/<normalized_triple>, while
libclang_rt is placed into lib/<triple_arg>.

Let's also place libclang_rt into lib/<normalized_triple>.
`libcxx/utils/ci/run-buildbot` is also updated to use
`armv7m-none-unknown-eabi` as normalized triple instead of
current `armv7m-none-eabi`.

ChangeLog of this PR:
This patch has been applied and revert twice:
1. The first try is https://github.com/llvm/llvm-project/pull/88407, and
then it is found that it causes some CI failures.
    https://lab.llvm.org/buildbot/#/builders/98/builds/36366
It is then resolved by another commit:
1693009679

    https://lab.llvm.org/buildbot/#/builders/77/builds/36372
It is caused that `COMPILER_RT_DEFAULT_TARGET_TRIPLE` is overwrite
without taking care about `CACHE`.

2. The second try https://github.com/llvm/llvm-project/pull/88835,
     resolves https://lab.llvm.org/buildbot/#/builders/77/builds/36372
     and in fact only one `execute_process` is needed.

Then we find some other CI failures. 
https://github.com/mstorsjo/llvm-mingw/actions/runs/8730621159

https://buildkite.com/llvm-project/libcxx-ci/builds/34897#018eec06-612c-47f1-9931-d3bd88bf7ced

It is due to misunderstanding `-print-effective-triple`: which will
output `thumbv7-w64-windows-gnu` for `armv7-w64-windows-gnu` or some
other thumb-enabled arm triples.
In fact we should use `-print-target-triple`.

For armv7m-picolibc, `armv7m-none-eabi` is hardcoded in
libcxx/utils/ci/run-buildbot, while in fact `armv7m-none-unknown-eabi`
is the real normalized triple.
2024-04-19 11:19:36 +08:00
Mark de Wever
b4776b8d8e
[libc++][CI] Tests LLDB libc++ data formatters. (#88312)
This enables testing of the LLDB libc++ specific data formatters.
This is enabled in the bootstrap build since building LLDB requires
Clang and this
is quite expensive. Adding this test changes the build time from 31 to
34 minutes.
2024-04-15 17:58:37 +02:00
Mark de Wever
6775285e76
[libc++][CMake] Removes LIBCXX_ENABLE_CLANG_TIDY. (#85794)
The clang-tidy selection in CMake was refactored in
https://github.com/llvm/llvm-project/pull/81362. During review it was
suggested to remove this CMake option.
2024-04-13 12:32:46 +02:00
Mark de Wever
749620ea2c
[lib++][CI] Changes bootstrap build type. (#88175)
The RelWithDebInfo generates a few GB of debug info that is not used.
Instead use the normal Release build for testing.
2024-04-10 08:02:13 +02:00
Mark de Wever
c174d8f465
[libc++][CI] Updates Docker LLDB dependencies. (#88174)
In order to test the LLDB data formatters make is required and SWIG
needs to be updated to version 4.

As drive-by, this patch sorts the entries and removes some duplicates.
2024-04-10 07:55:45 +02:00
Mark de Wever
eb3819073e
[libc++][oss-fuzz] Updates C++ version used. (#87531)
This version update allows testing of `std::format` and the chrono
timezone parsing in oss-fuzz.
2024-04-04 17:25:44 +02:00
Ed Maste
ffed554f2d
[libc++] Switch FreeBSD to C++26 (#86658) 2024-03-28 10:52:50 -04:00
Ed Maste
4fc8df9c6a
[libc++] Switch FreeBSD CI job to Clang 17 (#86320)
libc++ will drop support for Clang 16 before long.
2024-03-25 19:17:30 -04:00
Eric
1880e41a4c
Fix the OSS fuzz build. (#86562)
The OSS fuzz build has been broken for a while because of changes
to the cmake configuration. This patch fixes the issues by defaulting to
libunwind as the default runtime
2024-03-25 17:34:43 -04:00
Mark de Wever
3cf169ca16
[libc++][CI] Updates the documentation. (#85264)
The documentation mentions manually pushing Docker images to the CI. The
preferred way is to use the proper GitHub action. This updates the
documentation.

---------

Co-authored-by: Will Hawkins <whh8b@obs.cr>
2024-03-25 18:53:55 +01:00
Mark de Wever
f804217155 Revert "[libc++][CMake] Removes LIBCXX_ENABLE_CLANG_TIDY. (#85262)"
This reverts commit 4109b18ee5de1346c2b89a5c89b86bae5c8631d3.

It looks like the automatic detection has false positives. This broke
the following build https://github.com/llvm/llvm-project/pull/85262
2024-03-18 17:13:56 +01:00
Mark de Wever
4109b18ee5
[libc++][CMake] Removes LIBCXX_ENABLE_CLANG_TIDY. (#85262)
The clang-tidy selection in CMake was refactored in
https://github.com/llvm/llvm-project/pull/81362. During review it was
suggested to remove this CMake option.
2024-03-18 14:32:30 +01:00
Mark de Wever
2e8417680a
[libc++] Fixes run-buildbot-container. (#84644)
Pulls the proper docker image instead of a non-existing image.
2024-03-15 17:28:12 +01:00
Mark de Wever
4005185268 [libc++][CI] Updates the version number of the latest release. 2024-03-14 17:46:14 +01:00
Mark de Wever
af21659c8c
[libc++][CI] Installs tzdata package in Docker. (#84643)
This allows testing the time zone information in the CI. This is needed
to let https://github.com/llvm/llvm-project/pull/82108 pass the CI.
2024-03-12 17:28:15 +01:00
eric
a8dd99eb36 Bump the github actions runner base version.
Yesterday, one of the issues the libc++ builders encountered was that
they were using a client that was too old; too old to even update
automatically.

To get things working, i had to push a testing image with this change.
The testing image has been working for 12 hours now, so it's time to
commit to it :-)
2024-03-06 08:59:19 -05:00
Louis Dionne
5e6f50eaa9
[libc++] Remove LIBCXX_EXECUTOR and LIBCXXABI_EXECUTOR (#79886)
Those were deprecated in LLVM 18 and their removal was planned for LLVM 19.
2024-02-26 14:46:15 -05:00
Nikolas Klauser
82afd9b19a
[libc++] Use GitHub-provided runners for the windows CI (#79326)
Co-authored-by: Martin Storsjö <martin@martin.st>
2024-01-26 21:53:11 +01:00
Mark de Wever
1d6b6132ff [libc++] Reland CI module improvements.
Revert "Revert #76246 and #76083"

This reverts commit 5c150e7eeba9db13cc65b329b3c3537b613ae61d.

Adds a small fix that should properly disable the tests on Windows.
Unfortunately the original poster has not provided feedback and the
original patch did not fail in the LLVM CI infrastructure.

Modules are known to fail on Windows due to non compliance of the
C library. Currently not having this patch prevents testing on other
platforms.
2024-01-21 12:10:36 +01:00
Daniel Thornburgh
5c150e7eeb Revert #76246 and #76083
These cause test build failures on Windows.

This reverts the following commits:
  57ca74843586c9a93c425036c5538aae0a2cfa60
  d06ae33ec32122bb526fb35025c1f0cf979f1090
2024-01-18 15:07:33 -08:00
Mark de Wever
d06ae33ec3
[libc++][modules] Removes module testing. (#76083)
This removes the entire modules testing infrastructure.

The current infrastructure uses CMake to generate the std and std.compat
module. This requires quite a bit of plumbing and uses CMake. Since
CMake introduced module support in CMake 3.26, modules have a higher
CMake requirement than the rest of the LLVM project. (The LLVM project
requires 3.20.) The main motivation for this approach was how libc++
generated its modules. Every header had its own module partition. This
was changed to improve performance and now only two modules remain. The
code to build these can be manually crafted.

A followup patch will reenable testing modules, using a different
approach.
2024-01-17 08:11:25 +01:00
Dominik Wójt
2b2310484f
[libc++] tests with picolibc: update picolibc (#77908)
The updated picolibc version has "isblank" function with external
linkage. This is required for C++ modules support.

This should solve all the problems reported in #76980, but
we'll wait to validate this with the modules build without
closing that issue.
2024-01-12 17:32:04 -05:00
Ryan Prichard
4c41449edd
[libc++][Android] Add NDK ABI lists for i686 and x86_64 (#69272)
This commit adds ABI lists for the Android NDK.

Fixes: https://github.com/llvm/llvm-project/issues/69270
Differential Revision: https://reviews.llvm.org/D155341
2024-01-12 13:00:16 -08:00
Louis Dionne
8f90e6937a
[runtimes] Use LLVM libunwind from libc++abi by default (#77687)
I recently came across LIBCXXABI_USE_LLVM_UNWINDER and was surprised to
notice it was disabled by default. Since we build libunwind by default
and ship it in the LLVM toolchain, it would seem to make sense that
libc++ and libc++abi rely on libunwind for unwinding instead of using
the system-provided unwinding library (if any).

Most importantly, using the system unwinder implies that libc++abi is
ABI compatible with that system unwinder, which is not necessarily the
case. Hence, it makes a lot more sense to instead default to using the
known-to-be-compatible LLVM unwinder, and let vendors manually select a
different unwinder if desired.

As a follow-up change, we should probably apply the same default to
compiler-rt.

Differential Revision: https://reviews.llvm.org/D150897
Fixes #77662
rdar://120801778
2024-01-11 10:13:21 -05:00
Louis Dionne
ca06c330fd
[libc++] Allow running the test suite with optimizations (#68753)
This patch adds a configuration of the libc++ test suite that enables
optimizations when building the tests. It also adds a new CI
configuration to exercise this on a regular basis. This is added in the
context of [1], which requires building with optimizations in order to
hit the bug.

[1]: https://github.com/llvm/llvm-project/issues/68552
2024-01-09 10:39:14 -05:00
Dominik Wójt
e60167927b
[libc++] Add a picolibc test configuration with exceptions enabled (#75462) 2023-12-18 10:25:50 -05:00