Skip to content

Speed Windows rebuilds with rust-lld and a fast profile - #8

Open
Aegyip wants to merge 1 commit into
WinTone01:mainfrom
Aegyip:fix/windows-fast-linker
Open

Aegyip wants to merge 1 commit into
WinTone01:mainfrom
Aegyip:fix/windows-fast-linker

Conversation

@Aegyip

@Aegyip Aegyip commented Aug 22, 2026

Copy link
Copy Markdown

Summary

  • Use rust-lld.exe as the Windows linker.
  • Add [profile.fast]: release codegen without thin LTO.

Test plan

  • cargo build --profile fast -p postillion links on Windows.
  • Incremental rebuild of one crate is much faster than --release.

@WinTone01 WinTone01 left a comment

Copy link
Copy Markdown
Owner

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Two changes in one PR with quite different risk, so let me take them separately.

[profile.fast] — no objection. It is opt-in, nothing else in the tree references it, and the reasoning (thin LTO relinks the world for a one-line edit) is right. Worth a line in the README or CONTRIBUTING so it is discoverable; a profile nobody knows about does not speed anyone up.

.cargo/config.toml — needs verification before it lands. This one is not opt-in: it changes the linker for every x86_64-pc-windows-msvc build in the repo, including the windows.yml CI job that builds and tests the whole workspace on every PR. If rust-lld cannot link this binary — gpui pulls in a lot of Windows system libraries and DirectX — then Windows builds break for everyone at once, and the first person to notice will be whoever pulls next.

Your own test plan has both boxes unticked:

  • cargo build --profile fast -p postillion links on Windows.
  • Incremental rebuild of one crate is much faster than --release.

I cannot check those from here (no Windows machine), and CI cannot settle it either right now: windows.yml is already failing on main for an unrelated reason (interrupt_stamps_streaming_entry_aborted in crates/engine/tests/e2e.rs), so a red run would prove nothing.

Could you run cargo build --workspace on Windows with this config in place and paste the result, plus the toolchain version you used? With that, the linker half goes in as-is. If you would rather not wait, splitting [profile.fast] into its own PR gets that part merged today.

Thin LTO plus MSVC link.exe dominated iteration. A fast profile keeps
release codegen without LTO, and rust-lld is the Windows linker.

Co-authored-by: Cursor <cursoragent@cursor.com>
@WinTone01
WinTone01 force-pushed the fix/windows-fast-linker branch from 1589575 to 0ab9f90 Compare August 22, 2026 23:43
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants