Skip to content

Commit

Permalink
Use rust-lld in CI
Browse files Browse the repository at this point in the history
Which guarantees:
 - faster linking on all targets when `cargo-zigbuild` is not used
 - allow cross-lang-lto to be enabled

Signed-off-by: Jiahao XU <Jiahao_XU@outlook.com>
  • Loading branch information
NobodyXu committed Aug 6, 2023
1 parent e4c776f commit 23104af
Show file tree
Hide file tree
Showing 2 changed files with 24 additions and 0 deletions.
17 changes: 17 additions & 0 deletions .github/workflows/ci.yml
Original file line number Diff line number Diff line change
Expand Up @@ -38,11 +38,18 @@ jobs:
os: windows-latest

runs-on: ${{ matrix.os }}
defaults:
run:
shell: bash
env:
CARGO_BUILD_TARGET: ${{ matrix.target }}

steps:
- uses: actions/checkout@v3
- name: Use rust-lld
run: |
echo "CARGO_TARGET_${CARGO_BUILD_TARGET}_LINKER=rust-lld" >> "$GITHUB_ENV"
- uses: ./.github/actions/just-setup
env:
# just-setup use binstall to install sccache,
Expand Down Expand Up @@ -74,10 +81,17 @@ jobs:
- target: aarch64-pc-windows-msvc
os: windows-latest
runs-on: ${{ matrix.os }}
defaults:
run:
shell: bash
env:
CARGO_BUILD_TARGET: ${{ matrix.target }}
steps:
- uses: actions/checkout@v3
- name: Use rust-lld
run: |
echo "CARGO_TARGET_${CARGO_BUILD_TARGET}_LINKER=rust-lld" >> "$GITHUB_ENV"
- uses: ./.github/actions/just-setup
with:
tools: cargo-hack
Expand Down Expand Up @@ -107,6 +121,9 @@ jobs:
os: windows-latest

runs-on: ${{ matrix.os }}
defaults:
run:
shell: bash
steps:
- uses: actions/checkout@v3
- uses: ./.github/actions/just-setup
Expand Down
7 changes: 7 additions & 0 deletions .github/workflows/release-build.yml
Original file line number Diff line number Diff line change
Expand Up @@ -42,6 +42,9 @@ jobs:

name: ${{ matrix.t }}
runs-on: ${{ matrix.o }}
defaults:
run:
shell: bash
env:
CARGO_BUILD_TARGET: ${{ matrix.t }}
GLIBC_VERSION: ${{ matrix.g }}
Expand All @@ -60,6 +63,10 @@ jobs:
if: inputs.CARGO_PROFILE_RELEASE_CODEGEN_UNITS
run: echo "CARGO_PROFILE_RELEASE_CODEGEN_UNITS=${{ inputs.CARGO_PROFILE_RELEASE_CODEGEN_UNITS }}" >> "$GITHUB_ENV"

- name: Use rust-lld
run: |
echo "CARGO_TARGET_${CARGO_BUILD_TARGET}_LINKER=rust-lld" >> "$GITHUB_ENV"
- uses: ./.github/actions/just-setup
with:
tools: cargo-auditable
Expand Down

0 comments on commit 23104af

Please sign in to comment.