From 3ad42b8f15ccc1811c46c1423869ee6546cac257 Mon Sep 17 00:00:00 2001 From: Emily Date: Sun, 16 Mar 2025 17:08:08 +0000 Subject: [PATCH] github: use faster linkers in CI MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit This shaves off something like 20 to 40 seconds for Linux. It’s seemingly within the margin of error for Windows, so not sure if we’ll want to keep it there. --- .cargo/config-ci.toml | 9 ++++++++- .github/workflows/ci.yml | 4 ++++ 2 files changed, 12 insertions(+), 1 deletion(-) diff --git a/.cargo/config-ci.toml b/.cargo/config-ci.toml index e66ca5fb7..ff42c9675 100644 --- a/.cargo/config-ci.toml +++ b/.cargo/config-ci.toml @@ -2,8 +2,15 @@ debug = "none" incremental = false +[target.x86_64-unknown-linux-gnu] +rustflags = ["-Clink-arg=-fuse-ld=mold"] + +[target.aarch64-unknown-linux-gnu] +rustflags = ["-Clink-arg=-fuse-ld=mold"] + +[target.x86_64-pc-windows-msvc] +linker = "rust-lld.exe" # NOTE: on Windows, build with the static CRT, so that produced .exe files don't # depend on vcruntime140.dll; otherwise the user requires visual studio if they # download a raw .exe -[target.x86_64-pc-windows-msvc] rustflags = ["-Ctarget-feature=+crt-static"] diff --git a/.github/workflows/ci.yml b/.github/workflows/ci.yml index c90797110..cf78da010 100644 --- a/.github/workflows/ci.yml +++ b/.github/workflows/ci.yml @@ -80,6 +80,10 @@ jobs: - uses: taiki-e/install-action@0f58b6a196e0d71c72fd459ab8fd8b228f85f669 with: tool: nextest,taplo-cli + - name: Install mold + uses: rui314/setup-mold@f80524ca6eeaa76759b57fb78ddce5d87a20c720 + with: + make-default: false - name: Build run: >- cargo build