Commit Graph

490 Commits

Author SHA1 Message Date
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 4109b18ee5.

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 5c150e7eeb.

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:
  57ca748435
  d06ae33ec3
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
Louis Dionne
4bd32cc445 [libc++] Remove anchors for agent queues from the BuildKite pipeline configuration (#75359)
We didn't save that much boilerplate with those anchors, but it made the
pipeline description harder to understand because the definition of the
jobs and the agents they run on were so far apart. Anchors are useful
for the other common boilerplate we truly share between all jobs, but it
seems reasonable to define agent queues in-line.
2023-12-14 09:52:42 -05:00
Louis Dionne
f0d4811690 [libc++] Add CI job for testing macOS C++03 (#75355)
It's not that I have much love for C++03, but we should ensure that it
works. Some recent changes broke this configuration because slightly
older Clang versions don't support attribute syntax in C++03 mode.
2023-12-13 18:05:36 -05:00
Mark de Wever
ed210f9f5a [libc++][CI] Tests the no RTTI configuration. (#65518)
There are a few drive-by fixes:
- Since the combination RTTI disabled and exceptions enabled do not
work, this combination is prohibited.
- A small NFC in any fixing clang-tidy.

The code in the Buildkite configuration is prepared for using the std
module. There are more fixes needed for that configuration which will be
done in a separate commit.
2023-12-12 17:11:53 +01:00
eric
1a013b61dc Allow libc++ image tag to be specified via enviroment variables.
This change is needed for changes I'm working on that allow
github workflows to build, push, and otherwise manage the container
images they use
2023-12-01 14:34:36 -05:00
Eric
9ac64abc02 [libc++] Remove linux Buildkite builders entirely (#73825)
This removes the Google hosted Linux buildkite builders. We have since
moved all of them over to github actions.

Follow up changes will be sent for android.
2023-11-29 17:34:45 -05:00
Michael Platings
8aeacebf28 [libc++] Add initial support for picolibc
Picolibc is a C Standard Library that is commonly used in embedded
environments. This patch adds initial support for this configuration
along with pre-commit CI. As of this patch, the test suite only builds
the tests and nothing is run. A follow-up patch will make the test suite
actually run the tests.

Differential Revision: https://reviews.llvm.org/D154246
2023-11-29 10:43:16 -05:00
Louis Dionne
6772c4f248 [libc++] Remove the ignore_format.txt file (#73135)
The ignore_format.txt file and the associated checks have been causing a
lot of confusion since we introduced them. Formatting becomes one of the
main hurdle for contributors (especially new contributors), and that is
not great.

The original goal of ignore_format.txt was to enforce clang-format only
in a subset of the files of the project. In practice, we have now
shifted to a model where we have a Github action that checks whether new
code surrounding edits is formatted. In that context, it probably
doesn't make sense to keep having a ignore list for formatting files.

After this patch, the clang-format job will enforce that all new code is
formatted properly, and that all edits to existing files are formatted
properly, regardless of which files the edits are in. This seems
reasonable and I believe will lead to much less confusion than our
current setup.

In the future, we could consider clang-formatting the whole code base
once and for all but this requires a bit of upfront technical work to
put in place a merge driver to help resolve merge conflicts across
formatting changes.
2023-11-22 15:21:01 -05:00
Eric
46a8479448 [libc++] Promote android to supported. (#72949)
The bots have been running smoothly for a while. Check out
https://libcxx.efcs.ca/cistats.html for more info.
2023-11-21 14:47:25 -05:00
Louis Dionne
c38ae74b48 [libc++] Stop checking for trailing whitespace in check-generated-output (#72711)
Trailing whitespace is removed by clang-format, so if someone tries to
check-in new code with trailing whitespaces, it'll be caught by the
clang-format job. Removing this duplication helps reduce the confusion
around our numerous ways of enforcing formatting rules.
2023-11-20 11:23:24 -05:00
Eric
9ed4a57e31 Add libc++ github actions workflow to replace buildkite (#71836)
This change ports almost all of the linux buildkite builders to github
actions.

I would like to have this transition occur as soon as possible.
2023-11-17 08:57:01 -05:00
Eric
f4e3fb5972 Refactor dockerfile to support Buildkite AND Github Actions (#71954)
This change adds the image used by the self-hosted Github Actions
builders.

In an attempt to make the transition simple, all of the different images
share as much of the same state as possible, including packages, users,
etc... This results in bigger images, but that shouldn't be a problem.
That said, the refactorings caused the buildkite image to shrink by 100
MB.

This change also renames all of the packages for consistency. Bots will
have to be changed to use the new package names eventually.

Again, docker-compose was used as the source of truth for defining
argument.

I have already pushed example images to ghcr.io/libcxx/<name>:testing
2023-11-16 12:52:46 -05:00
Eric
c66d5f57ce Attempt entire rewrite of buildkite pipeline using anchors. (#71624)
This uses YAML anchors to deduplicate a lot of the pipeline LOC.

This makes it a lot easier to navigate through the file and to make modifications.
2023-11-13 17:06:25 -05:00
Eric
601e8fdd28 Rehome libcxx-builder docker image & attempt gentler termination. (#71604)
There are three changes present in this PR.

1. Use github packages for libcxx-builder rather than dockerhub.

The ldionne/libcxx-builder image will now be hosted at
ghcr.io/libcxx/libcxx-builder. This has the benefit of allowing members
of the github org to push new versions.

In the future I hope to add github actions to rebuild the image as
needed.

2. Add docker-compose file

The compose file allows to to specify the package repository, so that
users can simply write 'docker compose build' and 'docker compose push'.

It also gives us a centralized place to manage version arguments which
change frequently.

3. Use non-shell CMD form.

This may help the google libcxx builders disconnect more gracefully as
the shell form of CMD may eat the shutdown signal. I'm hoping this
corrects inaccurate agent counts from the buildkite API, since when the
VM's terminate, they do so without signaling it to buildkite, which
hangs around waiting for them to reconnect. It's likely more changes
will be needed though.

---------

Co-authored-by: Mark de Wever <zar-rpg@xs4all.nl>
2023-11-10 08:24:39 -05:00
Konstantin Varlamov
64d413efdd [libc++][hardening] Rework macros for enabling the hardening mode. (#70575)
1. Instead of using individual "boolean" macros, have an "enum" macro
`_LIBCPP_HARDENING_MODE`. This avoids issues with macros being
mutually exclusive and makes overriding the hardening mode within a TU
more straightforward.

2. Rename the safe mode to debug-lite.

This brings the code in line with the RFC:
https://discourse.llvm.org/t/rfc-hardening-in-libc/73925

Fixes #65101
2023-11-08 09:10:00 -10:00
Mark de Wever
3d131f960e [libc++][CI] Adds a new CMake version in Docker. (#71582)
This allows testing the upcoming CMake 3.28 release in the CI. CMake
3.28 will have non-experimental support for C++20 modules. So this would
be a better CMake version for the modular builds.

The goal is to remove CMake 3.27 from the CI when the builder work
properly with 3.28.
2023-11-08 17:51:27 +01:00
Konstantin Varlamov
fe300f35ca [libc++][hardening] Add tests for the hardened mode with ABI breaks. (#71020)
Add a new test mode that enables the hardened mode in combination with
ABI-breaking changes (only bounded iterators currently) and reenable the
bounded iterator tests for `span` and `string_view`.
2023-11-03 09:46:19 -04:00
Eric
78dcd015b6 Improve CI output. (#70236)
There is currently a major problem with the CI output:

The information you need to see never appears in the visible log.

This is because our logs are very verbose, and list (A) every test as
they run it, and (B) every unsupported tests. This can be thousands of
lines.

(A) was introduced by me when I disabled the PTY progress bar, which
doesn't play nice with log files. That change was an improvement, but I
have now disabled the PTY on the builders, so we can go back to passing
`-s`. When `-s` is passed but no PTY is available, it prints a long
friendly progress indicator.

(B) is solved here by disabling the printing of unsupported tests at the
end of the test suite. While it can be useful on occasion to audit the
list of unsupported tests, it's far from a common operation. Instead
people want to see the log of their failure. We should upload the xml
results, so if auditing is needed, it can be done using that.

Hopefully this change will make it so that the test failures appear in
the actual log output
2023-10-25 18:10:29 -04:00
Louis Dionne
15f179e5d1 [libc++] Remove the Buildkite job that builds documentation (#69992)
Since #69828, we have a Github Action that builds the documentation for
libc++, so we don't need to do it as part of our Buildkite pipeline
anymore.
2023-10-24 14:06:21 +02:00
Ryan Prichard
dc9ed440b5 [libc++][Android] Enable Android testing in BuildKite CI (#69275)
Enable testing for two NDK configurations:
 - android-ndk-21-def-x86
 - android-ndk-33-goog-x86_64

Fixes: https://github.com/llvm/llvm-project/issues/69270
2023-10-23 14:24:33 -07:00
Ryan Prichard
07ba499817 [libc++][Android] Disable Android ABI list checking (#69666)
Issue: https://github.com/llvm/llvm-project/issues/69270
2023-10-20 13:26:28 -04:00
Ryan Prichard
a30095a1e4 [libc++][Android] Add libcxx-builder-android Docker image (#69273)
Add a Dockerfile for a new Docker image, libcxx-builder-android, that
extends libcxx-builder with support for testing Android.

The image includes these things:

 * An Android Clang compiler and sysroot.

* The Android platform-tools (e.g. adb), so that an Android buildbot can
run programs on an Android device. At container startup, copy these
platform tools to an "android-platform-tools" Docker volume to share
them with an emulator container. This copying ensures that the emulator
and libcxx-builder containers avoid mismatched adb versions.

* Docker, so that an Android buildbot can manage a sibling Docker
container that runs the Android emulator.

Add an Android-specific run-buildbot-container script for local
development. Currently using this script requires building
libcxx-build-android and an emulator image locally.

Fixes: https://github.com/llvm/llvm-project/issues/69270
Differential Revision: https://reviews.llvm.org/D155271
2023-10-19 17:15:20 -04:00
Ryan Prichard
d173ce4a67 [libc++][Android] Support libc++ testing on Android (#69274)
I could probably break this commit into more pieces.

---

This patch adds libc++ support for Android L (Android 5.0+) and up,
tested using the Android team's current compiler, a recent version of
the AOSP sysroot, and the x86[-64] Android Emulator.

CMake and Lit Configuration:

Add runtimes/cmake/android/Arch-${ARCH}.cmake files that configure CMake
to cross-compile to Android without using CMake's built-in NDK support
(which only works with an actual packaged NDK).

Add libcxx/cmake/caches/AndroidNDK.cmake that builds and tests libc++
(and libc++abi) for Android. This file configures libc++ to match what
the NDK distributes, e.g.:
- libc++_shared.so (includes libc++abi objects, there is no
libc++abi.so). libunwind is linked statically but not exported.
 - libc++_static.a (does not include libc++abi) and libc++abi.a
 - `std::__ndk1` namespace
- All the libraries are built with `__ANDROID_API__=21`, even when they
are linked to something targeting a higher API level.

(However, when the Android LLVM team builds these components, they do
not use these CMake cache files. Instead they use Python scripts to
configure the builds. See
https://android.googlesource.com/toolchain/llvm_android/.)

Add llvm-libc++[abi].android-ndk.cfg.in files that test the Android
NDK's libc++_shared.so. These files can target old or new Android
devices. The Android LLVM team uses these test files to test libc++ for
both arm/arm64 and x86/x86_64 architectures.

The Android testing mode works by setting %{executor} to adb_run.py,
which uses `adb push` and `adb shell` to run tests remotely. adb_run.py
always runs tests as the "shell" user even on an old emulator where "adb
unroot" doesn't work. The script has workarounds for old Android
devices. The script uses a Unix domain socket on the host
(--job-limit-socket) to restrict concurrent adb invocations. Compiling
the tests is a major part of libc++ testing run-time, so it's desirable
to exploit all the host cores without overburdening the test devices,
which can have far fewer cores.

BuildKite CI:

Add a builder to run-buildbot, `android-ndk-*`, that uses Android Clang
and an Android sysroot to build libc++, then starts an Android emulator
container to run tests.

Run the emulator and an adb server in a separate Docker container
(libcxx-ci-android-emulator), and create a separate Docker image for
each emulator OS system image. Set ADB_SERVER_SOCKET to connect to the
container's adb server. Running the only adb server inside the container
makes cleanup more reliable between test runs, e.g. the adb client
doesn't create a `~/.android` directory and the adb server can be
restarted along with the emulator using docker stop/run. (N.B. The
emulator insists on connecting to an adb server and will start one
itself if it can't connect to one.)

The suffix to the android-ndk-* job is a label that concisely specifies
an Android SDK emulator image. e.g.:
 - "system-images;android-21;default;x86" ==> 21-def-x86
 - "system-images;android-33;google_apis;x86_64" ==> 33-goog-x86_64

Fixes: https://github.com/llvm/llvm-project/issues/69270
Differential Revision: https://reviews.llvm.org/D139147
2023-10-19 16:58:30 -04:00
Louis Dionne
1196e6dda9 [libc++] Move the check-generated-files job to Github Actions (#68920)
This allows running these quick checks faster than in our Buildkite
pipeline, which has much more latency. This will also avoid blocking the
rest of the testing pipeline in case the generated-files checks are
failing.
2023-10-18 19:56:16 -07:00
Louis Dionne
b3a39a9bdb [libc++] Check formatting with clang-format 17 (#68928)
This updates the clang-format we use in libc++ to 17. This is necessary
to start running the generated-files checks in GitHub Actions (in
#68920). In fact this is a pre-existing issue regardless of #68920 --
right now our ignore_format.txt job disagrees with the LLVM-wide
clang-format job.
2023-10-12 14:30:33 -07:00
Louis Dionne
b56488c879 [libc++] Improve the output of the generated-output CI job (#68903)
The step that checked for ignore_format.txt being consistent with the
tree wouldn't print any explicit diagnostic when failing, which led to
confusion. After this patch, an explicit diagnostic will be printed by
the job along with the required diff to ignore_format.txt.
2023-10-12 10:53:33 -07:00
Louis Dionne
580d26ae46 [libc++] Remove the CI job testing Clang 15 (#66406)
Since LLVM 17 has been branched and is on the verge of being released,
we can drop the CI job that tests against Clang 15. I think the number
of cherry-picks to `release/17.x` will be a lot smaller now, so keeping
a Clang 15 job around for that purpose seems unnecessary.

As a fly-by, this patch also removes some Clang 15 workarounds and test
suite annotations as we usually do. It also removes some slightly older
gcc test suite annotations that were missed.
2023-09-25 17:55:59 -04:00
Louis Dionne
4ca00a5686 [libc++] Remove the libc++ specific clang-format job (#67344)
Now that we have a LLVM-wide GitHub action, it doesn't make sense to
have a custom job for libc++ in our BuildKite CI pipeline. This only creates
confusion as to which CI job should be acted upon.
2023-09-25 17:24:01 -04:00