Removal of mold/wild scripts and mentions in docs (#53078)

Self-Review Checklist:

- [x] I've reviewed my own diff for quality, security, and reliability
- [x] Unsafe blocks (if any) have justifying comments
- [ ] The content is consistent with the [UI/UX
checklist](https://github.com/zed-industries/zed/blob/main/CONTRIBUTING.md#uiux-checklist)
- [ ] Tests cover the new/changed behavior
- [ ] Performance impact has been considered and is acceptable


Release Notes:

- N/A

---------

Co-authored-by: Claude Opus 4.6 <noreply@anthropic.com>
This commit is contained in:
Nitin K. M. 2026-04-08 23:50:02 +05:30 committed by GitHub
parent 3f5823267f
commit 64b93202f8
No known key found for this signature in database
GPG key ID: B5690EEEBB952194
7 changed files with 4 additions and 137 deletions

View file

@ -19,10 +19,6 @@ runs:
shell: bash -euxo pipefail {0}
run: ./script/linux
- name: Install mold linker
shell: bash -euxo pipefail {0}
run: ./script/install-mold
- name: Download WASI SDK
shell: bash -euxo pipefail {0}
run: ./script/download-wasi-sdk

View file

@ -11,8 +11,7 @@ ENV CARGO_TERM_COLOR=always
COPY script/linux script/
RUN ./script/linux
COPY script/install-mold script/install-cmake script/
RUN ./script/install-mold "2.34.0"
COPY script/install-cmake script/
RUN ./script/install-cmake "3.30.4"
COPY . .

View file

@ -263,10 +263,6 @@ async fn build_remote_server_from_source(
rust_flags.push_str(&format!(" -C link-arg=-L{path}"));
}
}
if build_remote_server.contains("mold") {
rust_flags.push_str(" -C link-arg=-fuse-ld=mold");
}
if platform.arch.as_str() == std::env::consts::ARCH
&& platform.os.as_str() == std::env::consts::OS
{

View file

@ -21,33 +21,6 @@ Clone the [Zed repository](https://github.com/zed-industries/zed).
If you prefer to install the system libraries manually, you can find the list of required packages in the `script/linux` file.
### Linkers {#linker}
On Linux, Rust's default linker is [LLVM's `lld`](https://blog.rust-lang.org/2025/09/18/Rust-1.90.0/). Alternative linkers, especially [Wild](https://github.com/davidlattimore/wild) and [Mold](https://github.com/rui314/mold), can improve clean and incremental build times.
Zed currently uses Mold in CI because it is more mature. For local development, Wild is recommended because it is typically 5-20% faster than Mold.
These linkers can be installed with `script/install-mold` and `script/install-wild`.
To use Wild as your default, add these lines to your `~/.cargo/config.toml`:
```toml
[target.x86_64-unknown-linux-gnu]
linker = "clang"
rustflags = ["-C", "link-arg=--ld-path=wild"]
[target.aarch64-unknown-linux-gnu]
linker = "clang"
rustflags = ["-C", "link-arg=--ld-path=wild"]
```
To use Mold as your default:
```toml
[target.'cfg(target_os = "linux")']
rustflags = ["-C", "link-arg=-fuse-ld=mold"]
```
## Building from source
Once the dependencies are installed, you can build Zed using [Cargo](https://doc.rust-lang.org/cargo/).

View file

@ -1,45 +0,0 @@
#!/usr/bin/env bash
# Install `mold` official binaries from GitHub Releases.
#
# Adapted from the official rui314/setup-mold@v1 action to:
# * use environment variables instead of action inputs
# * remove make-default support
# * use curl instead of wget
# * support doas for sudo
# * support redhat systems
# See: https://github.com/rui314/setup-mold/blob/main/action.yml
set -euo pipefail
MOLD_VERSION="2.34.0"
if [ "$(uname -s)" != "Linux" ]; then
echo "Error: This script is intended for Linux systems only."
exit 1
elif [ -e /usr/local/bin/mold ]; then
echo "Warning: existing mold found at /usr/local/bin/mold. Skipping installation."
exit 0
fi
if [ "$(whoami)" = root ]; then SUDO=; else SUDO="$(command -v sudo || command -v doas || true)"; fi
MOLD_REPO="${MOLD_REPO:-https://github.com/rui314/mold}"
MOLD_URL="${MOLD_URL:-$MOLD_REPO}/releases/download/v$MOLD_VERSION/mold-$MOLD_VERSION-$(uname -m)-linux.tar.gz"
echo "Downloading from $MOLD_URL"
curl -fsSL --output - "$MOLD_URL" \
| $SUDO tar -C /usr/local --strip-components=1 --no-overwrite-dir -xzf -
# Note this binary depends on the system libatomic.so.1 which is usually
# provided as a dependency of gcc so it should be available on most systems.
cat <<EOF
Mold is installed to /usr/local/bin/mold
To make it your default, add or merge these lines into your ~/.cargo/config.toml:
[target.'cfg(target_os = "linux")']
linker = "clang"
rustflags = ["-C", "link-arg=-fuse-ld=mold"]
EOF

View file

@ -1,44 +0,0 @@
#!/usr/bin/env bash
# Install wild-linker official binaries from GitHub Releases.
set -euo pipefail
WILD_VERSION="${WILD_VERSION:-${1:-0.6.0}}"
if [ "$(uname -s)" != "Linux" ]; then
echo "Error: This script is intended for Linux systems only."
exit 1
elif [ -z "$WILD_VERSION" ]; then
echo "Usage: $0 [version]"
exit 1
elif command -v wild >/dev/null 2>&1 && wild --version | grep -Fq "$WILD_VERSION" ; then
echo "Warning: existing wild $WILD_VERSION found at $(command -v wild). Skipping installation."
exit 0
fi
if [ "$(whoami)" = root ]; then SUDO=; else SUDO="$(command -v sudo || command -v doas || true)"; fi
ARCH="$(uname -m)"
WILD_REPO="${WILD_REPO:-https://github.com/davidlattimore/wild}"
WILD_PACKAGE="wild-linker-${WILD_VERSION}-${ARCH}-unknown-linux-gnu"
WILD_URL="${WILD_URL:-$WILD_REPO}/releases/download/$WILD_VERSION/${WILD_PACKAGE}.tar.gz"
DEST_DIR=/usr/local/bin
echo "Downloading from $WILD_URL"
curl -fsSL --output - "$WILD_URL" \
| $SUDO tar -C ${DEST_DIR} --strip-components=1 --no-overwrite-dir -xzf - \
"${WILD_PACKAGE}/wild"
cat <<EOF
Wild is installed to ${DEST_DIR}/wild
To make it your default, add or merge these lines into your ~/.cargo/config.toml:
[target.x86_64-unknown-linux-gnu]
linker = "clang"
rustflags = ["-C", "link-arg=--ld-path=wild"]
[target.aarch64-unknown-linux-gnu]
linker = "clang"
rustflags = ["-C", "link-arg=--ld-path=wild"]
EOF

View file

@ -12,9 +12,6 @@ function finalize {
# after packages install (curl, etc), get the rust toolchain
which rustup > /dev/null 2>&1 || curl --proto '=https' --tlsv1.2 -sSf https://sh.rustup.rs | sh -s -- -y
cat <<EOF
Note: It's recommended to install and configure Wild or Mold for faster builds.
Run script/install-wild or script/install-mold.
Finished installing Linux dependencies with script/linux
EOF
}
@ -55,11 +52,11 @@ if [[ -n $apt ]]; then
)
if (grep -qP 'PRETTY_NAME="(Debian|Raspbian).+13' /etc/os-release); then
# libstdc++-14-dev is in build-essential
deps+=( mold )
true
elif (grep -qP 'PRETTY_NAME="(Linux Mint 22|.+24\.(04|10))' /etc/os-release); then
deps+=( mold libstdc++-14-dev )
deps+=( libstdc++-14-dev )
elif (grep -qP 'PRETTY_NAME="((Debian|Raspbian).+12|Linux Mint 21|.+22\.04)' /etc/os-release); then
deps+=( mold libstdc++-12-dev )
deps+=( libstdc++-12-dev )
elif (grep -qP 'PRETTY_NAME="((Debian|Raspbian).+11|Linux Mint 20|.+20\.04)' /etc/os-release); then
# Ubuntu 20.04 ships clang-10 and libstdc++-10 which lack adequate C++20
# support for building webrtc-sys (requires -std=c++20, lambdas in
@ -125,7 +122,6 @@ if [[ -n $dnf ]] || [[ -n $yum ]]; then
perl-IPC-Cmd
perl-File-Compare
perl-File-Copy
mold
)
elif grep -qP '^ID="?(rhel|rocky|alma|centos|ol)' /etc/os-release; then
deps+=( perl-interpreter )
@ -183,7 +179,6 @@ if [[ -n $zyp ]]; then
libxkbcommon-x11-devel
libzstd-devel
make
mold
openssl-devel
sqlite3-devel
tar
@ -217,7 +212,6 @@ if [[ -n $pacman ]]; then
openssl
zstd
pkgconf
mold
sqlite
pipewire
xdg-desktop-portal
@ -250,7 +244,6 @@ if [[ -n $xbps ]]; then
openssl-devel
wayland-devel
vulkan-loader
mold
sqlite-devel
pipewire
xdg-desktop-portal
@ -277,7 +270,6 @@ if [[ -n $emerge ]]; then
media-libs/vulkan-loader
x11-libs/libxcb
x11-libs/libxkbcommon
sys-devel/mold
dev-db/sqlite
media-video/pipewire
sys-apps/xdg-desktop-portal