This is an archive of the discontinued LLVM Phabricator instance.

Add buildbot with C++20 configuration
ClosedPublic

Authored by ilya-biryukov on Dec 19 2022, 9:41 AM.

Details

Summary

The worker runs inside GCE alongside other Google buildbots.
Actual build uses Clang 15. The Dockerfiles are tested locally.

Prior discussion on Discourse:
https://discourse.llvm.org/t/adding-a-c-20-buildbot/67156

Diff Detail

Event Timeline

ilya-biryukov created this revision.Dec 19 2022, 9:41 AM
Herald added a project: Restricted Project. · View Herald Transcript
ilya-biryukov requested review of this revision.Dec 19 2022, 9:41 AM

Sending this out early to have it reviewed by the time I get the required credentials.
This will also require the corresponding configuration changes in our GCP changes before being submitted.

buildbot/google/terraform/main.tf
345 ↗(On Diff #483991)

This will require extra configuration in our GCP project after I recieve a password for the new worker.

kadircet added inline comments.Dec 19 2022, 11:22 PM
buildbot/google/docker/buildbot-cpp20/run.sh
29

you probably want to run $CC and $LD here instead?

buildbot/google/terraform/main.tf
318 ↗(On Diff #483991)

i think 2 cs are enough here

buildbot/osuosl/master/config/builders.py
2470

do we really aim to detect any runtime regressions by running tests ? otherwise i'd just leave them out.

2471

we're only building clangd here, but running check-clang-tools.

2476

if we end up not running tests, i guess we can also get rid of assertions

ilya-biryukov marked 5 inline comments as done.
  • fix a typo in /vol/ccache
  • use password from clangd worker (approved by Galina in our email exchange)
  • leave out the targets and checks, use defaults that build and test everything
  • Use $CC and $LD instead of the wrong compilers in run.sh
ilya-biryukov added inline comments.Dec 20 2022, 5:11 AM
buildbot/google/docker/buildbot-cpp20/run.sh
29

Nice catch, thanks! I was copy-pasting without giving too much thought to it.

buildbot/google/terraform/main.tf
318 ↗(On Diff #483991)

Wow, nice catch. I'll send a patch for clangd worker to update this (this code is a copy-paste).
We probably don't persist the cache among runs because of this, not sure how severe this is for the running time (assuming that the worker runs continuously and does not spawn per build)

buildbot/osuosl/master/config/builders.py
2470

Sure, running the tests also seems useful to catch any discrepancies in runtime behavior between C++20 and C++17.
There are some cases where the code may silently change behavior.

2471

Yeah, good point. I would like to default to building as much as possible to start with. I have removed the targets and checks completely, it seems the code can just build and run all tests by default. I do not have a good of the build latency trade-offs there. Please let me know if there is some good subset of targets that would provide good coverage and yet reduce the build times significantly.

PS also initially leaving out compiler-rt, lld and other subprojects that I am less familiar with. But that's something that we may add in the future.

2476

I think we should still keep assertions on. If we enable assertions, we build more code that could potentially not compile in C++20 mode and catch more potential issues.

ilya-biryukov added inline comments.Dec 20 2022, 5:18 AM
buildbot/osuosl/master/config/builders.py
2471

typo: I do not have a good understanding of the build latency trade-offs there

gkistanova accepted this revision.Dec 20 2022, 10:01 PM

LGTM.

Thanks for the patch, Ilya!
And thanks for helping with the review, Kadir! All good comments.

Having "llvm", "clang", "clang-tools-extra" is a good staring point. You can always add more later if the allocated hardware will handle more with a reasonable response time.
Building with assertion is a good default. UnifiedTreeBuilder will run check-all, so assertions will be handy.

This revision is now accepted and ready to land.Dec 20 2022, 10:01 PM
  • Use kubernetes resource YAML for deployment instead of terraform config. I had problems updating our terraform deployment, it seems broken. I will follow up by moving existing clangd buildbot out of terrafrom too, the kubectl-based workflow seems prefereable.
  • Set version of the new docker image to 0 (script updates it on build).
This revision was automatically updated to reflect the committed changes.