-
Notifications
You must be signed in to change notification settings - Fork 57
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
chore: Use rust-lld as linker to speed up test execution in CI as wel…
…l as locally
- Loading branch information
1 parent
b31e208
commit 394a8e1
Showing
4 changed files
with
62 additions
and
6 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -64,6 +64,21 @@ jobs: | |
uses: actions-rust-lang/[email protected] | ||
with: | ||
cache-workspaces: "./libs -> ./target" | ||
components: llvm-tools-preview | ||
- name: Install linker (Windows) | ||
if: ${{ matrix.os == 'windows-2022' }} | ||
uses: taiki-e/install-action@v2 | ||
with: | ||
tool: cargo-binutils | ||
- name: Install linker (Linux) | ||
if: ${{ matrix.os == 'ubuntu-22.04' }} | ||
run: | | ||
sudo apt-get update | ||
sudo apt-get install lld clang | ||
- name: Install linker (MacOS) | ||
if: ${{ matrix.os == 'macos-12' || matrix.os == 'macos-14' }} | ||
run: | | ||
brew install llvm | ||
- name: Build CLI | ||
run: | | ||
cd libs | ||
|
@@ -215,9 +230,23 @@ jobs: | |
- name: Install Rust stable toolchain | ||
uses: actions-rust-lang/[email protected] | ||
with: | ||
components: rustfmt | ||
components: rustfmt, llvm-tools-preview | ||
rustflags: "" | ||
cache-workspaces: "./libs -> ./target" | ||
- name: Install linker (Windows) | ||
if: ${{ matrix.os == 'windows-2022' }} | ||
uses: taiki-e/install-action@v2 | ||
with: | ||
tool: cargo-binutils | ||
- name: Install linker (Linux) | ||
if: ${{ matrix.os == 'ubuntu-22.04' }} | ||
run: | | ||
sudo apt-get update | ||
sudo apt-get install lld clang | ||
- name: Install linker (MacOS) | ||
if: ${{ matrix.os == 'macos-12' || matrix.os == 'macos-14' }} | ||
run: | | ||
brew install llvm | ||
- name: Download pavex CLI artifact | ||
uses: actions/download-artifact@v4 | ||
with: | ||
|
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,20 @@ | ||
# On Windows | ||
# ``` | ||
# cargo install -f cargo-binutils | ||
# rustup component add llvm-tools-preview | ||
[target.x86_64-pc-windows-msvc] | ||
rustflags = ["-C", "link-arg=-fuse-ld=lld"] | ||
[target.x86_64-pc-windows-gnu] | ||
rustflags = ["-C", "link-arg=-fuse-ld=lld"] | ||
|
||
# On Linux: | ||
# - Ubuntu, `sudo apt-get install lld clang` | ||
# - Arch, `sudo pacman -S lld clang` | ||
[target.x86_64-unknown-linux-gnu] | ||
rustflags = ["-C", "linker=clang", "-C", "link-arg=-fuse-ld=lld"] | ||
|
||
# On MacOS, `brew install llvm` and follow steps in `brew info llvm` | ||
[target.x86_64-apple-darwin] | ||
rustflags = ["-C", "link-arg=-fuse-ld=lld"] | ||
[target.aarch64-apple-darwin] | ||
linker = "/opt/homebrew/opt/llvm/bin/ld64.lld" |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters