diff --git a/.github/actions/build_docs/action.yml b/.github/actions/build_docs/action.yml index 1ff271f73ff6b800ec3a94615f31c35a7729bb47..002f6f4653f894cd1f6770f1c7b383a3df13fead 100644 --- a/.github/actions/build_docs/action.yml +++ b/.github/actions/build_docs/action.yml @@ -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 diff --git a/Dockerfile-distros b/Dockerfile-distros index c8a98d2f7db9bd5a235831257579968ed6d23fe8..5abda933a5a6801e4599df450800f8a92cc4ce60 100644 --- a/Dockerfile-distros +++ b/Dockerfile-distros @@ -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 . . diff --git a/crates/remote/src/transport.rs b/crates/remote/src/transport.rs index 8d0f212cfc4f9544d0a827a41aefc3a8af07ee72..5d57b703287539cff4384cec2cbe5966434717c5 100644 --- a/crates/remote/src/transport.rs +++ b/crates/remote/src/transport.rs @@ -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 { diff --git a/docs/src/development/linux.md b/docs/src/development/linux.md index af81d6220c7122d830cea61461169cd830dc299e..56545111fd11baeb5f272c0439f37f90c104c4d2 100644 --- a/docs/src/development/linux.md +++ b/docs/src/development/linux.md @@ -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/). diff --git a/script/install-mold b/script/install-mold deleted file mode 100755 index b0bf8517700beb2226d6f06e71fa8d4823175653..0000000000000000000000000000000000000000 --- a/script/install-mold +++ /dev/null @@ -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 </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 < /dev/null 2>&1 || curl --proto '=https' --tlsv1.2 -sSf https://sh.rustup.rs | sh -s -- -y cat <