This is an archive of the discontinued LLVM Phabricator instance.

[libc++] Add a libc++ CI pipeline specific to Clang changes
ClosedPublic

Authored by ldionne on Nov 9 2022, 7:02 PM.

Details

Summary

This will ensure that Clang changes get tested against libc++.

Diff Detail

Event Timeline

ldionne created this revision.Nov 9 2022, 7:02 PM
Herald added a project: Restricted Project. · View Herald TranscriptNov 9 2022, 7:02 PM
Herald added a subscriber: arichardson. · View Herald Transcript
ldionne requested review of this revision.Nov 9 2022, 7:02 PM
Herald added a project: Restricted Project. · View Herald TranscriptNov 9 2022, 7:02 PM
Herald added a reviewer: Restricted Project. · View Herald Transcript

This is a rough draft based on a discussion I had with @erichkeane over lunch today. This should provide customized jobs for testing Clang changes against libc++.

Thank you for working on this, I think this is going to be fantastic!!

libcxx/utils/ci/buildkite-pipeline-clang.yml
18

Do we have/need something to keep this value from drifting away from the trunk version?

42

Please excuse my utter ignorance of buildkite, but... this looks identical to the previous step with the only change being to the label (same for the rest of the entries). How does the CI know which version to test against? Does it pull that out of the label automatically or something?

Thanks for working on this!

Thank you for doing this! I have no way of reviewing these, but I'm hopeful someone more knowledgeable will be able to.

Thank you for doing this! I have no way of reviewing these, but I'm hopeful someone more knowledgeable will be able to.

I'm familiar with libc++'s Buildkite configuration so I'm happy to review, but I'll wait until it's ready for review.

ldionne marked an inline comment as done.Nov 10 2022, 12:14 PM
ldionne added a subscriber: mizvekov.

Thank you for doing this! I have no way of reviewing these, but I'm hopeful someone more knowledgeable will be able to.

Yeah no problem, this was mostly for awareness because we talked about it.

libcxx/utils/ci/buildkite-pipeline-clang.yml
18

We do this manually every release when we bump the base compiler version we're using. This is a deliberate act and I think it's fine. I do agree it's a bit annoying to duplicate this here and in the other libc++ CI configuration.

42

The answer is that all the jobs do the same thing as of this version of the patch. I just wanted to get something out real quick, I was sitting in EWG and wanted to make sure I didn't forget my conversation with @erichkeane.

Actually, let's discuss which jobs you folks want. What configurations do you want to test? I would suggest:

  • A few standard modes -- what would make the most sense for clang?
  • Modules enabled

That's probably enough, but I'd like to know what you and @erichkeane think about it. Oh and let's ping @mizvekov who has been needing these facilities too.

ldionne updated this revision to Diff 474644.Nov 10 2022, 6:05 PM
ldionne marked an inline comment as done.

Try to build Clang in its own pipeline step

ldionne updated this revision to Diff 474645.Nov 10 2022, 6:17 PM

Try to fix install step

ldionne updated this revision to Diff 474646.Nov 10 2022, 6:44 PM

Try to fix CI

ldionne updated this revision to Diff 474688.Nov 11 2022, 1:43 AM

Experiment w/ CI

ldionne updated this revision to Diff 474695.Nov 11 2022, 2:04 AM

Attempt 4/N. Sorry for the spam, this is going to keep going until I finally figure this out.

ldionne updated this revision to Diff 474698.Nov 11 2022, 2:11 AM

Try again.

aaron.ballman added inline comments.Nov 11 2022, 5:43 AM
libcxx/utils/ci/buildkite-pipeline-clang.yml
18

Okie dokie, that's fine by me, but we might someday want to script that so there's less risk of missing a spot to update. (Nothing to be done for this patch though!)

42

Ah, okay, I wasn't stupid then, wahoo! :-D

In terms of what configurations to test, I think the important ones are:

  1. Modules
  2. Target OS differences (Windows vs Linux), especially where sizeof(size_t) or sizeof(long) differs
  3. C++latest

+++ ones past here are more questionable +++

  1. C++98? Alternatively: user-controlled standard version through some magic?
  2. Target hardware differences (ARM vs IA vs PPC)?
  3. (Someday, perhaps) Experimental constexpr interpreter vs current constexpr evaluator?

We might want to combine some of these options together as well, so you can do C++latest + modules + Windows and C++latest + no modules + Linux, but I don't know that we need to try for testing the full combinatorial matrix.

ldionne updated this revision to Diff 474804.Nov 11 2022, 10:47 AM

Fix glob patterns

ldionne updated this revision to Diff 474807.Nov 11 2022, 10:53 AM

Build clang for real now that artifacts work

ldionne added inline comments.Nov 11 2022, 11:18 AM
libcxx/utils/ci/buildkite-pipeline-clang.yml
42

Sounds good, we'll have modules, C++03 and C++2b for the time being. I am not sure how to set it up for Windows but we can add it later.

For other architectures, the problem is that our fast builders are all on Linux and using the same Docker image. Builders for other funky architectures are controlled by other folks and have less bandwidth, so I would not tackle that in this initial patch.

ldionne updated this revision to Diff 474813.Nov 11 2022, 11:19 AM

Change jobs and try to fix env var for finding clang

aaron.ballman added inline comments.Nov 11 2022, 11:53 AM
libcxx/utils/ci/buildkite-pipeline-clang.yml
42

SGTM, I think it's totally fine to roll this out incrementally.

ldionne updated this revision to Diff 474825.Nov 11 2022, 12:00 PM

Try to fix env paths

ldionne updated this revision to Diff 474830.Nov 11 2022, 12:11 PM

Another attempt

ldionne updated this revision to Diff 474836.Nov 11 2022, 12:31 PM

Use $(pwd) instead of $PWD

ldionne updated this revision to Diff 474840.Nov 11 2022, 12:58 PM

I think $PWD is set incorrectly in the build

ldionne updated this revision to Diff 474842.Nov 11 2022, 1:05 PM

Artifacts should work now

ldionne updated this revision to Diff 474869.Nov 11 2022, 3:12 PM

Make sure clang is executable.

ldionne updated this revision to Diff 474878.Nov 11 2022, 3:49 PM

Fix call to chmod

ldionne updated this revision to Diff 474890.Nov 11 2022, 4:30 PM

Remove temporary comments. This should be good to go now. I'll merge once the CI is green.

Once I merge, we can do a test Clang review to confirm that the right jobs are triggered. Also, I'd like to note that
we're using the libc++ CI resources right now. If this ends up taking too much resources away from libc++ CI, we'll have
to negotiate something because I don't want to starve our own pipeline.

ldionne accepted this revision.Nov 11 2022, 4:42 PM

Actually, CI's going to be green for sure since we are running the libc++ CI. I'll merge this.

This revision is now accepted and ready to land.Nov 11 2022, 4:42 PM
This revision was landed with ongoing or failed builds.Nov 11 2022, 4:44 PM
This revision was automatically updated to reflect the committed changes.

Nice! Some nits. But I think we need to make sure that change to both Clang and libc++ still run the Clang CI.

libcxx/utils/ci/buildkite-pipeline-clang.yml
50

Isn't it build by default?

83

To avoid confusion with C++20 modules.

libcxx/utils/ci/generate-buildkite-pipeline
17

Note when there are changes to clang and libc++ this pipeline isn't executed. This might be an issue:

  • A clang modular build change affects libc++
  • libc++ is fixed and the Clang modular build is no longer tested, so it's unclear whether the fix works

Should we instead have one build script and set environment variable which CI test should be executed?

ldionne marked an inline comment as done.Nov 15 2022, 9:20 AM
ldionne added inline comments.
libcxx/utils/ci/buildkite-pipeline-clang.yml
50

No, I don't think it is.

libcxx/utils/ci/generate-buildkite-pipeline
17

I agree. Trying something out in https://reviews.llvm.org/D138042.