|
|
@@ -50,8 +50,8 @@ These commands should help set up a development environment on your machine.
|
|
|
# Update apt.
|
|
|
sudo apt update
|
|
|
|
|
|
-# Check that the `clang` version is at least 16, our minimum version. That needs
|
|
|
-# the number of the `:` in the output to be over 16. For example, `1:16.0-57`.
|
|
|
+# Check that the `clang` version is at least 19, our minimum version. That needs
|
|
|
+# the number of the `:` in the output to be over 19. For example, `1:19.0-1`.
|
|
|
apt-cache show clang | grep 'Version:'
|
|
|
|
|
|
# Install tools.
|
|
|
@@ -88,25 +88,28 @@ it to your `$PATH`, and aliasing `bazel` to it.
|
|
|
|
|
|
#### Old `clang` versions
|
|
|
|
|
|
-If the version of `clang` is earlier than 16, you may still have version 16
|
|
|
+If the version of `clang` is earlier than 19, you may still have version 19
|
|
|
available. You can use the following install instead:
|
|
|
|
|
|
```shell
|
|
|
# Install explicitly versioned Clang tools.
|
|
|
sudo apt install \
|
|
|
- clang-16 \
|
|
|
- libc++-16-dev \
|
|
|
- libc++abi-16-dev \
|
|
|
- lld-16 \
|
|
|
- lldb-16
|
|
|
+ clang-19 \
|
|
|
+ libc++-19-dev \
|
|
|
+ libc++abi-19-dev \
|
|
|
+ lld-19 \
|
|
|
+ lldb-19
|
|
|
|
|
|
# In your Carbon checkout, tell Bazel where to find `clang`. You can also
|
|
|
# export this path as the `CC` environment variable, or add it directly to
|
|
|
# your `PATH`.
|
|
|
-echo "build --repo_env=CC=$(readlink -f $(which clang-16))" >> user.bazelrc
|
|
|
+echo "build --repo_env=CC=$(readlink -f $(which clang-19))" >> user.bazelrc
|
|
|
```
|
|
|
|
|
|
-> NOTE: Most LLVM 16+ installs should build Carbon. If you're having issues, see
|
|
|
+And if it's not available directly from the distribution, you can install Clang
|
|
|
+tools on Debian/Ubuntu from <https://apt.llvm.org>.
|
|
|
+
|
|
|
+> NOTE: Most LLVM 19+ installs should build Carbon. If you're having issues, see
|
|
|
> [troubleshooting build issues](#troubleshooting-build-issues).
|
|
|
|
|
|
### macOS
|
|
|
@@ -245,13 +248,11 @@ considering if they fit your workflow.
|
|
|
|
|
|
The required setup for LLDB is:
|
|
|
|
|
|
-1. Install a minimum of LLVM 19 instead of LLVM 16.
|
|
|
- - The `lldb-dap` tool was added as part of LLVM 19.
|
|
|
-2. In the `.vscode` subdirectory, symlink `lldb_launch.json` to `launch.json`.
|
|
|
+1. In the `.vscode` subdirectory, symlink `lldb_launch.json` to `launch.json`.
|
|
|
For example: `ln -s lldb_launch.json .vscode/launch.json`
|
|
|
-3. Install the
|
|
|
+2. Install the
|
|
|
[`llvm-vs-code-extensions.lldb-dap` extension](https://marketplace.visualstudio.com/items?itemName=llvm-vs-code-extensions.lldb-dap).
|
|
|
-4. In VS Code settings, it may be necessary to set `lldb-dap.executable-path`
|
|
|
+3. In VS Code settings, it may be necessary to set `lldb-dap.executable-path`
|
|
|
to the path of `lldb-dap`.
|
|
|
|
|
|
A typical debug session looks like:
|
|
|
@@ -305,8 +306,8 @@ includes things such as changing LLVM versions, or installing libc++. Running
|
|
|
|
|
|
Many build issues result from the particular options `clang` and `llvm` have
|
|
|
been built with, particularly when it comes to system-installed versions. If you
|
|
|
-run `clang --version`, you should see at least version 16. If you see an older
|
|
|
-version, please update, or use the special `clang-16` instructions above.
|
|
|
+run `clang --version`, you should see at least version 19. If you see an older
|
|
|
+version, please update, or use the special `clang-19` instructions above.
|
|
|
|
|
|
System installs of macOS typically won't work, for example being an old LLVM
|
|
|
version or missing llvm-ar; [setup commands](#setup-commands) includes LLVM from
|
|
|
@@ -323,7 +324,7 @@ providing the output of the following diagnostic commands:
|
|
|
```shell
|
|
|
echo $CC
|
|
|
which clang
|
|
|
-which clang-16
|
|
|
+which clang-19
|
|
|
clang --version
|
|
|
grep llvm_bindir $(bazel info workspace)/bazel-execroot/external/+clang_toolchain_extension+bazel_cc_toolchain/clang_detected_variables.bzl
|
|
|
|