Commit Graph
139 Commits
Author SHA1 Message Date
Jon Ross-Perkins da99b940f5 Fix clangd-tidy to avoid blocking merges while testing (#5782)
What I'm trying to fix is visible at:

- PR: https://github.com/carbon-language/carbon-lang/pull/5779
- clangd-tidy run on merge:
https://github.com/carbon-language/carbon-lang/actions/runs/16155546033/job/45597095935
- Merge attempt:
https://github.com/carbon-language/carbon-lang/pull/5779#event-18534768919

That PR deletes block_value_store, so excluding deleted files here
(`added|modified`). But also, I think this is blocking merge just
because it's set for merge_group. Or it may be because of the clang-tidy
job name overlap -- I'm just going to address both.

Also trying to remove the base commit; I think dorny/paths-filter should
actually be calculating this reasonably well, and it was holdover from
where we set the commit explicitly elsewhere. There's a warning about it
being ignored in pull_request, visible
[here](https://github.com/carbon-language/carbon-lang/actions/runs/16155814211/job/45597903684).
2025-07-09 01:11:28 +00:00
Jon Ross-Perkins 6db13532ca Try using clangd-tidy (#5763)
Run clangd-tidy in parallel with clang-tidy, to experimentally see
whether it works reasonably well. These may produce slightly different
results, and it's not clear that clangd-tidy will be better, so being
cautious about switching.

A real possibility here is this is slower in some cases (building
compile commands takes ~6m below), but faster in the extremely slow
cases (when clang-tidy takes >10m).

For contrast:

- clang-tidy:
https://github.com/carbon-language/carbon-lang/actions/runs/16038096026/job/45254162180?pr=5763
- clangd-tidy:
https://github.com/carbon-language/carbon-lang/actions/runs/16038096427/job/45254164217?pr=5763
2025-07-08 14:00:15 +00:00
Chandler Carruth ad8d01d35c Replicate the fix in #5669 to the proposal workflow (#5671) 2025-06-13 23:07:06 +00:00
Jon Ross-Perkins 3b7dc79796 Add repo flag to gh (#5669)
Different workaround for https://github.com/cli/cli/issues/11055
2025-06-13 18:12:20 +00:00
Dana Jansens f967bf0b85 Manually update gh to fix PR labeling for now (#5665)
Issue https://github.com/cli/cli/issues/11055 suggests updating the `gh`
tool explicitly until the update gets applied to the github worker
images.
2025-06-13 17:35:32 +00:00
Dana Jansens dfc04b1488 Rename the workflow step that sets labels to a more appropriate name (#5646)
Currently it's called `assign_reviewers` as it was copied from the
workflow that does said task. But this workflow is setting labels, so
call it `set_labels`.
2025-06-11 16:13:57 +00:00
Dana Jansens 9d5575c920 Revert to Ubuntu 22 builders (#5479)
The Ubuntu 24 builders have a newer GLIBC than is present on the
compiler-explorer machines:
https://github.com/compiler-explorer/compiler-explorer/issues/7636#issuecomment-2880962252.
This results in the following error when running Carbon nightly:
```
/opt/compiler-explorer/carbon-trunk/bin/carbon: /lib/x86_64-linux-gnu/libc.so.6: version `GLIBC_2.38' not found (required by /opt/compiler-explorer/carbon-trunk/bin/carbon)
```

To resolve this, we need to build Carbon in a sysroot with a compatible
glibc version, and the most straightforward way to do that is to bump
our builders back down to Ubuntu 22.

To do that, we can't use apt.llvm.org again, since Ubuntu 22 is no
longer supported there. So we revert back to pulling a Linux X64 tarball
from the LLVM GitHub Releases page. Instead of getting an
ubuntu-specific tarball (which does not exist), we grab the generic
Linux one, which seems to work fine.

Note that the binaries in the LLVM release package appear to depend on
glibc version 2.34, as determined by `objdump -T bin/clang|grep GLIBC_|
sed 's/.*GLIBC_\([.0-9]*\).*/\1/g' | sort -Vu`, so these binaries should
hopefully be okay to package with the Carbon toolchain for the
compiler-explorer machines as well.
2025-05-14 20:41:07 +00:00
Dana JansensandJon Ross-Perkins f5e69734d9 Bump clang version to 19 (#5440)
The version of clangd/clang-tidy on developer machines has slowly
diverged from the one on the CI builders, which is causing a slowly
increasing amount of pain as clang-tidy CI runs fail (incorrectly) over
things that a newer clangd/clang-tidy was perfectly fine with locally.
This bumps the Clang version used in the ubuntu builders to 19, which is
the most recent in Debian stable.

We use https://apt.llvm.org instead of LLVM's GitHub releases
(https://github.com/llvm/llvm-project/releases) as the former more
reliably has packages for newer Clang/LLVM versions on x64. The
community-build releases binaries on LLVM's GitHub have stopped
including Ubuntu packages that match the GitHub x64 Ubuntu workers for
some time (for at least the 18 and 19 releases).

By moving to apt.llvm.org packages we only download and install the
headers and libraries needed for development, rather than every output
of building llvm, which is much faster and saves lots of disk space. We
also remove the system installations of other versions of clang/llvm so
we should end up using negative disk space. We can no longer easily
cache the installation but apt.llvm.org is a reliable end point.

We bump the ubuntu image version for the github workers to 24.04, as
apt.llvm.org has stopped building images for 22.10 in 2022 at its end of
life.

The `pre_commit` workflow disabled sudo unlike the other workflows that
install Clang/LLVM, including the `clang-tidy` workflow (which is also
run on `pull_request`). We bring it into alignment with the other
workflows so that we can install the llvm packages. And we lock its
ubuntu image to 24.04 so that it can be moved in lockstep with the other
workflows that depend on Clang/LLVM.

---------

Co-authored-by: Jon Ross-Perkins <jperkins@google.com>
2025-05-12 15:12:53 +00:00
Jon Ross-PerkinsandRichard Smith a94136d477 Remove references to explorer (#5287)
I'm doing this separately from removing the explorer/ and installers/
directories so that it's easier to review the side-effects.

Note for the main README, I didn't think it was worth keeping a mention
of "used to have a prototype interpreter, now archived" versus focusing
on the existing toolchain (for "Currently, we have fleshed out").

---------

Co-authored-by: Richard Smith <richard@metafoo.co.uk>
2025-04-10 22:05:45 +00:00
Jon Ross-Perkins 24c173b10f Try using same_pkg_direct_rdeps for clang-tidy action (#5144)
This is trying to reduce how much we run tidy over due to poor
performance of tidy.

It's opening the door for issues where a header file is modified in a
way that introduces tidy issues in a different target. However, that's
not the typical tidy issue we see.

There may also be a risk where a source file indirectly becomes a source
file for a target in a way that `same_pkg_direct_rdeps` doesn't return,
but I'm not sure that's applicable for how we use targets.

An example of this locating a diagnostic error can be found in the "Add
tidy issue" commit's run (which I cancelled before it finished running,
but note the error):

https://github.com/carbon-language/carbon-lang/actions/runs/13932649182/job/38993348130?pr=5144
2025-03-18 21:04:29 +00:00
Jon Ross-Perkins 9fc40f86f9 Rename 'long term' to 'long term issue' (#5023)
We were discussing this, `long term` only applies to issues and not PRs
(per past discussion, we don't really expect PRs should be inactive for
months). Renaming to `long term issue` to be more specific and hopefully
reduce confusion.
2025-02-26 22:03:58 +00:00
Jon Ross-Perkins 2ea2166cf8 Update pre-commit (#4995)
`pre-commit autoupdate --freeze && pre-commit run -a`
2025-02-21 00:27:15 +00:00
Jon Ross-Perkins 95fd890698 Allow pre-commit to talk to googleapis (#4966)
Example:
-
https://app.stepsecurity.io/github/carbon-language/carbon-lang/actions/runs/13320074606
-
https://github.com/carbon-language/carbon-lang/actions/runs/13320074606/job/37247235705

I'm not sure what it's being used for (even blocked, nothing unexpected
failed) but if bazel or similar is trying to talk to this it should be
fine.
2025-02-14 20:21:20 +00:00
Jon Ross-Perkins 6572da7314 Add dwblaikie as a toolchain reviewer (#4820) 2025-01-17 16:51:53 +00:00
Chandler Carruth f52ae6afa7 Fix clang-tidy to run on the merge queue (#4773)
Without this, the merge queue blocks on results but they never get
triggered and show up. This will need to merge before we re-enable
`clang-tidy` enforcement on the trunk branch.
2025-01-08 16:44:53 +00:00
Jon Ross-Perkins aaef516600 Fix job name for clang tidy (#4760)
I think this will affect the name GH shows in some action UIs; this will
more clearly disambiguate from tests.yaml actions.
2025-01-08 00:08:41 +00:00
Jon Ross-Perkins 05b272703e Add danakj to autoassign (#4765)
I'm glad to see you're grabbing PRs to review. Have some automagically.
:-P
2025-01-07 20:15:18 +00:00
Dana Jansens f8e60a8ec1 Fix path to carbon binary in nightly builder (#4737)
The path moved from ./bazel-bin/toolchain/install/run_carbon to
./bazel-bin/toolchain/carbon in 13502b7c89.

Part of issue https://github.com/carbon-language/carbon-lang/issues/4734
2024-12-23 22:54:30 +00:00
Jon Ross-Perkins 7977a9cddc Fix the command used for nightly release versions. (#4498) 2024-11-06 21:04:30 +00:00
Jon Ross-PerkinsandChandler Carruth 9af06cc988 Adjust some build troubleshooting notes (#4471)
Came up due to [libc++ install
issues](https://discord.com/channels/655572317891461132/655577725347561492/1302023663155023905)

We've discussed clang version verification, and adding that as long as
I'm in here. The more significant bit is the libc++ check, which if it's
not installed should fail like:

```
(tons of output)
ignoring nonexistent directory "/include"
#include "..." search starts here:
#include <...> search starts here:
 /usr/lib/llvm-16/lib/clang/16/include
 /usr/local/include
 /usr/include/x86_64-linux-gnu
 /usr/include
End of search list.
/usr/local/google/home/jperkins/.cache/bazel/_bazel_jperkins/85deb7d9d96f7e0e80b42618a55969d7/external/_main~clang_toolchain_extension~bazel_cc_toolchain/_temp:6:2: error: "No libc++ install found!"
#error "No libc++ install found!"
 ^
1 error generated.
ERROR: Analysis of target '//toolchain:toolchain' failed; build aborted: Analysis failed
INFO: Elapsed time: 0.265s, Critical Path: 0.08s
INFO: 1 process: 1 internal.
ERROR: Build did NOT complete successfully
```

pre-commit runs bazel, and GitHub runners have an old clang by default
(caught by the new check), so I'm installing here for a consistent
version.

---------

Co-authored-by: Chandler Carruth <chandlerc@gmail.com>
2024-11-04 16:03:09 +00:00
Jon Ross-Perkins 145c44b66c Move the language server into toolchain's busybox. (#4469)
Removes the separate language server binary; I'm not sure we need to
provide it. Instead, `carbon language-server` is added as a subcommand.

Moves //language_server to //toolchain/language_server. Splits into a
trivial language_server.h, and a substantive server.h. I wasn't sure
about a better name, but wanted the split similar to check/check.h,
lex/lex.h, etc. At the same time, the class is probably going to be a
little big so not a good fit to through into just a cpp file.

This fixes some style issues with the language server class, but
generally I'm trying to not address things here in order to keep it
simpler.
2024-11-01 19:49:39 +00:00
Jon Ross-Perkins 249709cb49 Split out clang-tidy to not run in merge (#4428)
Because clang-tidy is slow (and I'm not sure we can make it really
fast), trying to run it slightly less. Also, I noticed we can shave a
few minutes by disabling apt removal without losing too much free space.

Note that since this removes the old clang-tidy, I'll need to change the
branch protections before merging.
2024-10-21 19:59:40 +00:00
Jon Ross-Perkins a5ba0eed6a Drop macos-12 runners due to shutdown (#4412)
macos-12 is being shut down; it will have outages in November, and will
be fully removed in December:
https://github.com/actions/runner-images/issues/10721
2024-10-16 21:52:28 +00:00
Jon Ross-PerkinsandChandler Carruth b6396e97f8 Build a website. (#4189)
Demo site: https://jonmeow.carbon-lang.dev/

I'm trying to keep work under the `/website` subdirectory so that the
misc files don't interfere with unrelated views of the repository. The
`prebuild.py` script does some work to move things around and add
frontmatter, helping the jekyll generation.

I'm using the "just-the-docs" theme because I think it's a decent match
for what we want, and getting jekyll up and running with it wasn't too
difficult. Note #1526 proposed using Docusaurus; I started out there,
but was having trouble getting it working with newer versions. The
plugins in particular I got stuck trying to make work, which sent me
looking for options that we could have working with less customization.
I do lean towards jekyll though, because it's what GH uses so hopefully
we can get a more consistent experience.

Having a website has been approved for a while under #1492, but hasn't
been a priority. I'm mainly doing this because I want to just be able to
point people to carbon-lang.dev and have easy links that way.

---------

Co-authored-by: Chandler Carruth <chandlerc@gmail.com>
2024-08-20 17:53:06 +00:00
Jon Ross-Perkins 17abaa2bca Fix stray quote in action (#4193) 2024-08-06 23:31:44 +00:00
Jon Ross-Perkins b73387fc84 Update workflows for security hardening. (#4192)
Also a small pass on workflow names.

Note, I'm a little concerned that the test/nightly release/pre-commit
endpoints may be fragile. At the same time, it's also where it may be
most useful, to prevent network access by arbitrary test code. I think
this is imperfect, but maybe we can try it out and see if it's much of
an issue.

Note, the discord wiki action is currently broken, this should fix it.
2024-08-06 23:14:23 +00:00
Chandler Carruth f4b20fc186 Fix PR labeling and generate nightly build notes from them. (#4077)
This configures the nightly build to generate release notes and provides
a template for organizing them. The organization is done through
labeling of PRs and categorizing them based on those labels. I've tried
to provide a rough categorization that seems reasonable for folks.

While doing this I looked at our PR labeling and found a few bugs that
were preventing many labels form being attached. I've fixed those and
significantly expanded the coverage of file-based labeling. I've also
added code to do author-based labeling for automated PRs so those can be
separated out from human PRs.
2024-06-24 23:30:34 +00:00
Chandler Carruth 774ada28a2 Fix the installable archive build. (#4064)
There was a file that got into the testing filegroups but not the actual
built tarball. The result was that the installation failed to locate
itself correctly.

We also didn't have any testing to catch this. I'd like to add a bit
more end-to-end testing long-term, but for now just add a Python test
that validates the same set of files are in both.

Sadly, building and testing the compressed release is really slow and
not likely worthwhile outside of the actual release, but it would be
good to catch this stuff earlier. I tried switching from `bz2` to `gz`,
which made very little file size difference (so we should do it
anyways), and it is still too slow to do routinely. Instead, I've added
a Starlark macro that builds both the `pkg_tar` and the `py_test` to
validate it for both uncompressed `tar` and compressed `tar.gz`. This
lets us continuously test the `tar` version, and just test the `tar.gz`
in the nightly release run.

Updates the nightly release workflow to both test, run this specific
test, and use `gz`.

Last but not least, removes the `pkg_zip` as I don't think we have a use
case for this yet and some TODOs that should have been removed when the
version got added.
2024-06-19 15:48:12 +00:00
Chandler Carruth 5332b71eec Add automated nightly builds, uploaded as pre-releases. (#4055)
There is still a lot more we should try to do here, but this gets us
a decent start and should be enough for some of the developers working
on Carbon to use for simple cases, or tools like Compiler Explorer.

This first factors most of the complex setup for our CI workflow into
local actions that we can reuse in other workflows. It's actually
a fairly nice cleanup I think even without the specific use case of
a nightly release process. These use "composite" actions which is the
cleanest model for factoring out a subsequence of steps from a workflow.
I've tried to keep the inputs fairly minimal and easy to spot.

Next, it adds a cron-scheduled action that builds and creates a nightly
release. It also supports explicitly running the workflow, which can be
useful if the nightly release is broken in some way: a fix can be landed
and then a force run used.

Tested the `tests` workflow using our `action-test` branch:
https://github.com/carbon-language/carbon-lang/actions/runs/9545546278

Also tested the nightly release action by hacking in a `push` trigger
and using *draft* release. If you have admin rights, you can see an
example draft nightly build here:

https://github.com/carbon-language/carbon-lang/releases/tag/untagged-6a85cdce7b3a784a2e6b

Note that the GitHub releases are easily deleted, and even the tags
created in the repository can be cleaned up as needed so it should be
fairly harmless to fix this forward if needed.
2024-06-18 21:29:58 +00:00
Chandler CarruthandJon Ross-Perkins b51dc7f8e2 Introduce version and build info stamping. (#4054)
This adds a defined Carbon version to the Bazel build and codebase that
can be used both to implement features like version checks and to report
a meaningful version on the command line. This replaces a hard-coded
string and a TODO in the driver.

As part of this, it adds support for defining the version in Bazel, and
special build flags for overriding relevant parts such as the
pre-release marker used. The exact structure and meaning of our version
string, including the pre-release parts, is implemented here in line
with the draft proposal:

https://docs.google.com/document/d/11S5VAPe5Pm_BZPlajWrqDDVr9qc7-7tS2VshqO0wWkk/edit?resourcekey=0-2YFC9Uvl4puuDnWlr2MmYw

This also introduces a workspace status command to the repository to
extract the git commit SHA and other information when building, and the
logic to stamp that into binaries as part of the version string when
useful. The technique used leverages weak symbols with whole archive
linking to allow a link-time override of unstamped data with stamped
data in the leaf executable. This makes building with `--stamp` a
reasonable default, especially for development builds. The CI system is
explicitly opted out of this as there it has no benefit.

Last but not least, all of these are wired into the install rules so
that we build installable packages with the version number in a
conventional place in the directory and filename.

---------

Co-authored-by: Jon Ross-Perkins <jperkins@google.com>
2024-06-18 00:33:05 +00:00
Jon Ross-Perkins fd97834624 Remove the resolve stale suggestions action. (#3999)
Still failing. The action doesn't correctly handle the `push` action.
e.g.:
https://github.com/carbon-language/carbon-lang/actions/runs/9272842686

Lacking a clear solution here, I suggest removing this.
2024-05-28 19:18:27 +00:00
Jon Ross-Perkins 52bf4e618c Switch the resolve action to push (#3998)
https://github.com/Ardiannn08/resolve-outdated-comment documents this as
using push. My guess is that's the root of
https://github.com/carbon-language/carbon-lang/actions/runs/9259644459/job/25471949664;
if this doesn't fix it, we'll probably just need to remove it.
2024-05-28 16:09:25 +00:00
Jon Ross-PerkinsandChandler Carruth 4d38c7b1e4 Expand bazel retries in tests. (#3983)
Trying to better address ephemeral issues such as:

https://github.com/carbon-language/carbon-lang/actions/runs/9226025647/job/25384877352

`bazelisk test` currently has some retries, and this migrates those to a
script and copies it to other places that we invoke bazelisk.

---------

Co-authored-by: Chandler Carruth <chandlerc@gmail.com>
2024-05-24 18:10:53 +00:00
Richard Smith d01a80b7cc Delete CarbonInfraBot comments with no replies when they become outdated. (#3982) 2024-05-24 14:57:59 +00:00
Jon Ross-Perkins 97816a3598 Use https://app.stepsecurity.io/secureworkflow to improve workflow security. (#3879)
This is coming out of advice from
https://securityscorecards.dev/viewer/?uri=github.com/carbon-language/carbon-lang

Updates action versions and pins by checksum. This is something we
already do in other places, and doing it with actions just seems
consistent.

Trying to add token permissions at the same time.

step-security/harden-runner is being set up to monitor network traffic
for actions, with the idea that we'd set it to block unexpected traffic
in the future.

Note, https://app.stepsecurity.io/secureworkflow generates the pinned
checksums and adds the harden-runner. In some cases it added token
permissions, but we have a couple it doesn't recognize (`gh` executions,
other custom commands, jlumbroso/free-disk-space, reviewdog/action-setup
as examples) so I'm trying to guess my best.

Because these are workflows, testing is limited.
2024-04-15 14:40:38 +00:00
Jon Ross-Perkins 36c05bd573 Opt out of pre-commit suggestions (#3858)
Due to my workflow, I prefer to run `pre-commit` locally when I forget
to after an amend. While reviewdog can be helpful in the UI, it's mostly
making me mark comments as resolved as part of re-pushing. Rather than
continuing with this, maybe opting out is best?
2024-04-04 18:31:36 +00:00
Jon Ross-Perkins 0405fff68c Update to checkout v4 (#3759)
Noticed due to
https://github.com/carbon-language/carbon-lang/actions/runs/8207272518

```
Node.js 16 actions are deprecated. Please update the following actions to use Node.js 20: actions/checkout@v3. For more information see: https://github.blog/changelog/2023-09-22-github-actions-transitioning-from-node-16-to-node-20/.
```

I'm expecting we can just update the version number on these.
2024-03-08 20:25:04 +00:00
Jon Ross-Perkins 1d2b7db482 Switch reviewdog to a bespoke secret. (#3757)
This uses a token from the low-privilege CarbonInfraBot, which should
allow us to separate out permission for Google's CLA bot.
2024-03-08 16:41:36 +00:00
Richard Smith 56d70dc3a2 Provide a git checkout for reviewdog. (#3754)
It shouldn't actually need or use this, but it fails if there's no
`.git` directory at all.
2024-03-08 00:18:29 +00:00
Richard Smith b0dc6d2996 Pass the event path to reviewdog, not to cat. (#3753)
Should hopefully cause suggestions to be successfully created.
2024-03-07 23:28:06 +00:00
Richard Smith 2424ea16ea Use reviewdog rather than suggestion-bot to create suggestions. (#3752) 2024-03-07 22:57:18 +00:00
Richard Smith 43bfbbe6d5 Explicitly pass in github token to download action. (#3751) 2024-03-07 22:00:24 +00:00
Richard Smith 648f0ccd78 Unify pre-commit actions and attempt to fix suggestion-bot (#3750) 2024-03-07 21:44:49 +00:00
Richard Smith 61ea4f8344 Use suggestion-bot to convert pre-commit errors in PRs with fixes into code review suggestions. (#3746)
This can't be done directly from a `pull_request` action, because that's
run without write privileges. This is done for security reasons, because
it runs in the context of the pull request branch. So instead, we
perform this in two steps:

- The `pull_request` action runs `pre-commit` and uploads an artifact
containing the diffs and the event information (which is only used to
extract the pull request number).
- A separate `workflow_run` action is triggered when the `pre-commit`
action finishes. This action is privileged, and should be able to
download the artifact and create corresponding suggestions.

Unfortunately, due to the permissions model in play here, the second
half of this appears to only be testable live in production.

For now, we're splitting the pre-commit action into two actions -- one
to run on PRs and one to run when actually merging commits -- so that
the suggestions are only triggered in the former case. It might be
possible to recombine these using data in the `workflow_run` invocation
to tell them apart, but the documentation here isn't very good so I've
made this PR dump out that event information so that we can look at it
and see if it contains the relevant information.
2024-03-07 20:54:17 +00:00
Chandler Carruth 524902b540 Switch our main macOS actions to Arm. (#3677)
GitHub has publicly available Arm macOS runners now:
https://github.blog/changelog/2024-01-30-github-actions-introducing-the-new-m1-macos-runner-available-to-open-source/

These runners are used when the OS label is `macos-14` instead of
`macos-12`.

This PR switches the main PR and merge queue macOS runs to that OS. It
adds a push-only `macos-12` run to check post-merge whether Intel macOS
keeps working as we don't want that to break too badly. Given how much
faster the M1 is, it didn't seem worth it to keep this in the critical
path of development. And the Intel path here is more likely than others
to diminish in importance over time.

All our OS predicates in the action encoded a specific OS version which
no longer works given two macOS versions, so I've switch all the OS
predicates to a generic pattern that doesn't encode a version.

Example run on a PR:
https://github.com/carbon-language/carbon-lang/actions/runs/7766629200?pr=3686
Example run on push:
https://github.com/carbon-language/carbon-lang/actions/runs/7766480822
2024-02-06 00:19:03 +00:00
Chandler Carruthandjosh11b da7533ae7f Update project to require Clang 16 or newer. (#3649)
This should also unblock our switch to C++20 and other improvements.

There are three core parts of the change --

1) Updating our infrastructure to fetch and find Clang-16.
2) Updating our documentation to reflect this and help folks with any
   system issues they encounter.

The infrastructure change is unfortunately tricky. We can't get Clang 16
easily on GitHub's runner images, and in the past we've had persistent
problems with flakiness when our actions download this much during their
runs. Due to the flakiness, we've previously removed all downloading of
dependencies outside of Bazel itself, and added retry loops around Bazel
specifically to overcome flaky downloads.

This change tries to address these problems by populating the Clang and
LLVM toolchain in a place that we can then cache using the built-in
GitHub action caching infrastructure. This seems like by far the least
likely to flake way of downloading extra things into our runs. And since
these are relatively slow moving dependencies, we should populate this
cache very, very rarely.

For Linux, this downloads the binary release artifact from GitHub,
prunes out large parts of it that we don't need, and then caches this as
a local toolchain. This proves both small and fast.

For macOS, this uses a trick to cache the destination of Homebrew
installs. It unfortunately caches the *entire* Homebrew installation
though, and so it also goes to some lengths to prune and minimize how
much is installed from Homebrew. The result is "only" a 2gb cache image.
Because of the size and slower download and filesystem, the macOS runs
see a 1 - 2 minute slowdown.

We might extend the Linux infrastructure here usefully if we want to
test multiple LLVM versions. We might also extend the macOS version to
get a cheaper way to prune parts of the system and free up disk space,
or to cache other Homebrew installed tools if needed.

Last but not least, this brought to the forefront an issue with our C++
toolchain integration which relied on a specific CMake build option
being set in the LLVM toolchain install. This option isn't used in the
official release artifacts. Instead, switch to a more robust approach to
linking libc++abi statically that shouldn't have these problems.

Beyond the infrastructure changes, this also updates the documentation
to reflect requiring Clang 16 or newer, and adds some extra tips for
folks that are missing this.

The documentation is also updated to address a problem with getting the
right libc++abi files installed to support the more robust linking
strategy. This may reduce the problems we've seen in the past around
libc++abi and linking on other Linux distros as well.

---------

Co-authored-by: josh11b <josh11b@users.noreply.github.com>
2024-01-25 01:23:09 +00:00
Jon Ross-Perkins 848d4d7ec0 Add geoffromer and josh11b as toolchain reviewers (#3584) 2024-01-10 01:12:36 +00:00
Jon Ross-Perkins facf6eea04 Check clang-tidy in tests.yaml (#3567)
Example success:
https://github.com/carbon-language/carbon-lang/actions/runs/7414437667/job/20175507192
Example failure:
https://github.com/carbon-language/carbon-lang/actions/runs/7414486486/job/20175656728
2024-01-04 21:45:53 +00:00
Jon Ross-Perkins 3fea3dd401 Verify bazel mod deps (#3517)
Query `bazel mod deps` with `--lockfile_mode=error` to detect
out-of-sync lockfiles; print the output to support cross-platform
updates.

Add a workaround for target-determinator problems to prevent them from
blocking changes (e.g.,
https://github.com/carbon-language/carbon-lang/actions/runs/7225229412/job/19694000744?pr=3514)

Example verify failure to merge into end result:

https://github.com/carbon-language/carbon-lang/actions/runs/7227335045/job/19694765560?pr=3517

Success after updates:

https://github.com/carbon-language/carbon-lang/actions/runs/7227387163/job/19694933047
2023-12-18 17:12:40 +00:00
Jon Ross-Perkins 226b653e11 Fix tests.yaml to execute tests when there's a mix of code and ignored files. (#3472)
Fix an error in tests.yaml where tests wouldn't be run if *any* file was
ignored. Instead, only skip tests if *all* files are ignored.

Example run:
https://github.com/carbon-language/carbon-lang/actions/runs/7132705321/job/19423815707
2023-12-07 19:16:49 +00:00