Compare commits

...

6 Commits

Author SHA1 Message Date
jif-oai
f3c93fdd12 Change backend 2 2025-10-29 14:45:34 +00:00
jif-oai
b8161ef528 Change backend 2025-10-29 14:28:08 +00:00
jif-oai
05715c83b6 Fix 2025-10-29 14:11:14 +00:00
jif-oai
017646b014 One more try 2025-10-29 14:02:29 +00:00
jif-oai
ae312ff0b6 sccache 12 2025-10-29 12:50:11 +00:00
jif-oai
cbc1b50095 feat: LLD linkers for Windows build 2025-10-29 12:32:55 +00:00

View File

@@ -6,6 +6,10 @@ on:
- main
workflow_dispatch:
permissions:
actions: write
contents: read
# CI builds in debug (dev) for faster signal.
jobs:
@@ -29,7 +33,7 @@ jobs:
if [[ "${{ github.event_name }}" == "pull_request" ]]; then
BASE_SHA='${{ github.event.pull_request.base.sha }}'
echo "Base SHA: $BASE_SHA"
# List files changed between base and current HEAD (merge-base aware)
# List files changed between base and current HEAD (merge-base aware)
mapfile -t files < <(git diff --name-only --no-renames "$BASE_SHA"...HEAD)
else
# On push / manual runs, default to running everything
@@ -98,7 +102,11 @@ jobs:
# Speed up repeated builds across CI runs by caching compiled objects.
RUSTC_WRAPPER: sccache
CARGO_INCREMENTAL: "0"
SCCACHE_CACHE_SIZE: 10G
SCCACHE_CACHE_SIZE: 20G
# Use lld on Windows targets to speed up linking. rust-lld.exe ships with
# the Rust toolchain, so no extra install is required.
CARGO_TARGET_X86_64_PC_WINDOWS_MSVC_LINKER: rust-lld.exe
CARGO_TARGET_AARCH64_PC_WINDOWS_MSVC_LINKER: rust-lld.exe
strategy:
fail-fast: false
@@ -173,7 +181,7 @@ jobs:
uses: taiki-e/install-action@0c5db7f7f897c03b771660e91d065338615679f4 # v2
with:
tool: sccache
version: 0.7.5
version: 0.12.0
- name: Configure sccache backend
shell: bash
@@ -188,17 +196,45 @@ jobs:
echo "Using sccache local disk + actions/cache fallback"
fi
- name: Force sccache GHA (Windows)
if: startsWith(matrix.runner, 'windows')
shell: bash
run: |
if [[ -n "${ACTIONS_CACHE_URL:-}" && -n "${ACTIONS_RUNTIME_TOKEN:-}" ]]; then
echo "SCCACHE_GHA_ENABLED=true" >> "$GITHUB_ENV"
echo "Forcing sccache GitHub backend on Windows"
fi
- name: Remap debug paths (Windows)
if: startsWith(matrix.runner, 'windows')
shell: bash
run: |
echo "RUSTFLAGS=--remap-path-prefix=${GITHUB_WORKSPACE}=." >> "$GITHUB_ENV"
- name: Lower debug info (Windows, dev)
if: startsWith(matrix.runner, 'windows')
shell: bash
run: |
echo "CARGO_PROFILE_DEV_DEBUG=0" >> "$GITHUB_ENV"
- name: Restore sccache cache (fallback)
if: ${{ env.SCCACHE_GHA_ENABLED != 'true' }}
id: cache_sccache_restore
uses: actions/cache/restore@v4
with:
path: ${{ github.workspace }}/.sccache/
key: sccache-${{ matrix.runner }}-${{ matrix.target }}-${{ matrix.profile }}-${{ hashFiles('**/Cargo.lock') }}-${{ github.run_id }}
key: sccache-${{ github.job }}-${{ matrix.runner }}-${{ matrix.target }}-${{ matrix.profile }}-${{ hashFiles('**/Cargo.lock') }}-${{ github.run_id }}
restore-keys: |
sccache-${{ github.job }}-${{ matrix.runner }}-${{ matrix.target }}-${{ matrix.profile }}-${{ hashFiles('**/Cargo.lock') }}-
sccache-${{ matrix.runner }}-${{ matrix.target }}-${{ matrix.profile }}-${{ hashFiles('**/Cargo.lock') }}-
sccache-${{ matrix.runner }}-${{ matrix.target }}-${{ matrix.profile }}-
- name: Start sccache server and zero stats
shell: bash
run: |
sccache --start-server || true
sccache --zero-stats || true
- if: ${{ matrix.target == 'x86_64-unknown-linux-musl' || matrix.target == 'aarch64-unknown-linux-musl'}}
name: Prepare APT cache directories (musl)
shell: bash
@@ -279,7 +315,7 @@ jobs:
uses: actions/cache/save@v4
with:
path: ${{ github.workspace }}/.sccache/
key: sccache-${{ matrix.runner }}-${{ matrix.target }}-${{ matrix.profile }}-${{ hashFiles('**/Cargo.lock') }}-${{ github.run_id }}
key: sccache-${{ github.job }}-${{ matrix.runner }}-${{ matrix.target }}-${{ matrix.profile }}-${{ hashFiles('**/Cargo.lock') }}-${{ github.run_id }}
- name: sccache stats
if: always()
@@ -328,7 +364,11 @@ jobs:
env:
RUSTC_WRAPPER: sccache
CARGO_INCREMENTAL: "0"
SCCACHE_CACHE_SIZE: 10G
SCCACHE_CACHE_SIZE: 20G
# Use lld on Windows targets to speed up linking. rust-lld.exe ships with
# the Rust toolchain, so no extra install is required.
CARGO_TARGET_X86_64_PC_WINDOWS_MSVC_LINKER: rust-lld.exe
CARGO_TARGET_AARCH64_PC_WINDOWS_MSVC_LINKER: rust-lld.exe
strategy:
fail-fast: false
@@ -336,19 +376,19 @@ jobs:
include:
- runner: macos-14
target: aarch64-apple-darwin
profile: dev
profile: ci-test
- runner: ubuntu-24.04
target: x86_64-unknown-linux-gnu
profile: dev
profile: ci-test
- runner: ubuntu-24.04-arm
target: aarch64-unknown-linux-gnu
profile: dev
profile: ci-test
- runner: windows-latest
target: x86_64-pc-windows-msvc
profile: dev
profile: ci-test
- runner: windows-11-arm
target: aarch64-pc-windows-msvc
profile: dev
profile: ci-test
steps:
- uses: actions/checkout@v5
@@ -373,7 +413,7 @@ jobs:
uses: taiki-e/install-action@0c5db7f7f897c03b771660e91d065338615679f4 # v2
with:
tool: sccache
version: 0.7.5
version: 0.12.0
- name: Configure sccache backend
shell: bash
@@ -388,17 +428,45 @@ jobs:
echo "Using sccache local disk + actions/cache fallback"
fi
- name: Force sccache GHA (Windows)
if: startsWith(matrix.runner, 'windows')
shell: bash
run: |
if [[ -n "${ACTIONS_CACHE_URL:-}" && -n "${ACTIONS_RUNTIME_TOKEN:-}" ]]; then
echo "SCCACHE_GHA_ENABLED=true" >> "$GITHUB_ENV"
echo "Forcing sccache GitHub backend on Windows"
fi
- name: Remap debug paths (Windows)
if: startsWith(matrix.runner, 'windows')
shell: bash
run: |
echo "RUSTFLAGS=--remap-path-prefix=${GITHUB_WORKSPACE}=." >> "$GITHUB_ENV"
- name: Lower debug info (Windows, ci-test)
if: startsWith(matrix.runner, 'windows')
shell: bash
run: |
echo "CARGO_PROFILE_CI_TEST_DEBUG=0" >> "$GITHUB_ENV"
- name: Restore sccache cache (fallback)
if: ${{ env.SCCACHE_GHA_ENABLED != 'true' }}
id: cache_sccache_restore
uses: actions/cache/restore@v4
with:
path: ${{ github.workspace }}/.sccache/
key: sccache-${{ matrix.runner }}-${{ matrix.target }}-${{ matrix.profile }}-${{ hashFiles('**/Cargo.lock') }}-${{ github.run_id }}
key: sccache-${{ github.job }}-${{ matrix.runner }}-${{ matrix.target }}-${{ matrix.profile }}-${{ hashFiles('**/Cargo.lock') }}-${{ github.run_id }}
restore-keys: |
sccache-${{ github.job }}-${{ matrix.runner }}-${{ matrix.target }}-${{ matrix.profile }}-${{ hashFiles('**/Cargo.lock') }}-
sccache-${{ matrix.runner }}-${{ matrix.target }}-${{ matrix.profile }}-${{ hashFiles('**/Cargo.lock') }}-
sccache-${{ matrix.runner }}-${{ matrix.target }}-${{ matrix.profile }}-
- name: Start sccache server and zero stats
shell: bash
run: |
sccache --start-server || true
sccache --zero-stats || true
- uses: taiki-e/install-action@0c5db7f7f897c03b771660e91d065338615679f4 # v2
with:
tool: nextest
@@ -429,7 +497,7 @@ jobs:
uses: actions/cache/save@v4
with:
path: ${{ github.workspace }}/.sccache/
key: sccache-${{ matrix.runner }}-${{ matrix.target }}-${{ matrix.profile }}-${{ hashFiles('**/Cargo.lock') }}-${{ github.run_id }}
key: sccache-${{ github.job }}-${{ matrix.runner }}-${{ matrix.target }}-${{ matrix.profile }}-${{ hashFiles('**/Cargo.lock') }}-${{ github.run_id }}
- name: sccache stats
if: always()