Files
warp/script/linux/install_build_deps
Landon e91b5a2192 Add libclang-dev and clang-format to Linux bootstrap deps (#9527)
## Description

Adds `libclang-dev` and `clang-format` to the Debian/Ubuntu package list
installed by `script/linux/install_build_deps` (run via
`script/linux/bootstrap`).

Without these, `script/presubmit` fails on a fresh Linux machine that
only ran `script/linux/bootstrap`:
- `clang-format` is invoked directly by the presubmit's C/C++/Obj-C
format check.
- `libclang-dev` pulls in `libclang-common-*-dev`, which provides
clang's resource-dir builtin headers that bindgen needs when nextest
builds `minimp4-sys` (pulled in via `warpui_core`'s `integration_tests`
feature).

Fixes #9526.

## Testing

Manually verified on a fresh Ubuntu setup that `script/linux/bootstrap`
followed by `script/presubmit` no longer fails on the clang-format check
or the bindgen build for `minimp4-sys`. No automated tests added — this
is a build-deps-only change to a shell script.

## Server API dependencies

N/A — no server API changes.

## Agent Mode
- [ ] Warp Agent Mode - This PR was created via Warp's AI Agent Mode
2026-04-30 13:04:02 -04:00

67 lines
2.4 KiB
Bash
Executable File

#!/usr/bin/env bash
#
# Install all dependencies required to build Warp on Linux.
set -e
# Define some control sequences for text formatting.
red="\033[0;31m"
reset="\033[0m"
# Install some development libraries that will be needed in the compilation
# process.
UNAME="$(uname -a)"
if [[ "$(source /etc/os-release; echo $ID $ID_LIKE)" = *"debian"* ]]; then
echo "⬇️ Installing build-time dependencies..."
# Define the packages to install as a bash array so we can include
# comments between lines.
PACKAGES=(
curl
git
# Install various core packages for development work on Linux.
build-essential cmake pkg-config
# Make it so that running `python` runs `python3`.
python-is-python3
# Development headers for various libraries, needed when compiling
# certain Rust crate dependencies.
libssl-dev libfreetype-dev libexpat1-dev libgit2-dev
# libs needed for loading system fonts
libfontconfig1-dev
# Needed in wasm compilation for parsing the version of wasm-bindgen
jq
# Needed for compressing web bundles
brotli
# Needed for voice input
libasound2-dev
# Needed by bindgen (used by minimp4-sys, pulled in by warpui_core's
# integration_tests feature) — pulls in libclang-common-*-dev which
# provides clang's resource-dir builtin headers.
libclang-dev
# Required by script/presubmit's clang-format check on C/C++/Obj-C sources.
clang-format
)
sudo apt-get install -y "${PACKAGES[@]}"
# Install a modern version of protoc. The apt 'protobuf-compiler' package on
# Ubuntu 20.04 ships protoc 3.6.1, which is too old for proto3 'optional'
# fields (requires protoc >= 3.15).
PROTOC_VERSION="25.1"
case "$(uname -m)" in
x86_64) PROTOC_ZIP="protoc-${PROTOC_VERSION}-linux-x86_64.zip" ;;
aarch64) PROTOC_ZIP="protoc-${PROTOC_VERSION}-linux-aarch_64.zip" ;;
*) echo "Unsupported architecture for protoc: $(uname -m)"; exit 1 ;;
esac
curl -fsSL -o /tmp/protoc.zip \
"https://github.com/protocolbuffers/protobuf/releases/download/v${PROTOC_VERSION}/${PROTOC_ZIP}"
sudo unzip -o /tmp/protoc.zip -d /usr/local bin/protoc 'include/*'
rm /tmp/protoc.zip
else
echo -e "⚠️ ${red}Unknown Linux distribution; necessary build dependencies may not be installed!${reset}"
fi
# Install Rust.
"$PWD"/script/install_rust
# Install various build-time dependencies through cargo.
"$PWD"/script/install_cargo_build_deps