In particular, I was unable to build Carbon using extra/clang
and aur/bazelisk
, and had to shim similar packages with brew
.
- Install build tools
# sync key required for `libunwind-carbon`
gpg --recv-keys 015A268A17D55FA4
yay -S brew lld libunwind-carbon libc++ zlib
-
Fix any Brew context issues with
brew doctor
-
Install Brew packages
brew install bazelisk llvm
- Clone Carbon language repo
git clone https://github.com/carbon-language/carbon-lang carbon
cd carbon
- Build and run the explorer project
bazel run //explorer explorer/testdata/print/format_only.carbon
From here, you can execute other source files in a similar fashion with bazel run //explorer PATH_TO_FILE.carbon
. It's kind of a hack, but you could alias the explorer command to something like carbon
. Note that I redacted --
suggested in the Carbon documentation, which is used to represent the end of command options. I also redacted the prefixing ./
in front of the source file path option.