Skip to content

Commit 8b89660

Browse files
committed
perf(ci): optimize Windows Rust builds
- Add Dev Drive setup to reduce filesystem overhead - Enable long paths support for Windows - Add static CRT linking for Windows MSVC targets
1 parent b6805fa commit 8b89660

2 files changed

Lines changed: 26 additions & 0 deletions

File tree

.cargo/config.toml

Lines changed: 11 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -3,3 +3,14 @@ rustflags = ["--cfg", "tokio_unstable"] # also update .github/workflows/ci.yml
33

44
[unstable]
55
bindeps = true
6+
7+
# Windows static CRT linking for portable binaries
8+
# Note: must include --cfg tokio_unstable since target-specific rustflags override [build] rustflags
9+
[target.x86_64-pc-windows-msvc]
10+
rustflags = ["--cfg", "tokio_unstable", "-C", "target-feature=+crt-static"]
11+
12+
[target.i686-pc-windows-msvc]
13+
rustflags = ["--cfg", "tokio_unstable", "-C", "target-feature=+crt-static"]
14+
15+
[target.aarch64-pc-windows-msvc]
16+
rustflags = ["--cfg", "tokio_unstable", "-C", "target-feature=+crt-static"]

.github/workflows/ci.yml

Lines changed: 15 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -41,6 +41,21 @@ jobs:
4141
target: x86_64-apple-darwin
4242
runs-on: ${{ matrix.os }}
4343
steps:
44+
- name: Set up Dev Drive
45+
uses: samypr100/setup-dev-drive@30f0f98ae5636b2b6501e181dfb3631b9974818d # v4.0.0
46+
if: matrix.os == 'windows-latest'
47+
with:
48+
workspace-copy: true
49+
drive-size: 8GB
50+
drive-format: NTFS
51+
env-mapping: |
52+
CARGO_HOME,{{ DEV_DRIVE }}/.cargo
53+
RUSTUP_HOME,{{ DEV_DRIVE }}/.rustup
54+
55+
- name: Enable long paths
56+
if: matrix.os == 'windows-latest'
57+
run: git config --system core.longpaths true
58+
4459
- uses: actions/checkout@11bd71901bbe5b1630ceea73d27597364c9af683 # v4.2.2
4560
with:
4661
persist-credentials: false

0 commit comments

Comments
 (0)