Skip to content

dx serve --hot-patch fails on Windows with linker = "rust-lld.exe" set #4694

@Runi-c

Description

@Runi-c

Problem

Explicitly opting into lld on Windows (a practice recommended, for example, by Bevy's getting started guide) causes dx serve to fail consistently with the following errors (verbose logging):

01:16:36 [dev] Linker warnings: Linker error:
lld is a generic driver.
Invoke ld.lld (Unix), ld64.lld (macOS), lld-link (Windows), wasm-ld (WebAssembly) instead
 
01:16:36 [dev] Failed to generate fat binary: lld is a generic driver.
Invoke ld.lld (Unix), ld64.lld (macOS), lld-link (Windows), wasm-ld (WebAssembly) instead
01:16:36 [dev] Fat linking completed in 146771us
01:16:36 [dev] Setting builder to failed state
01:16:36 [dev] Build failed: The system cannot find the file specified. (os error 2)

The first error seems to suggest that rust-lld.exe isn't being called with the right semantics (to inform it what linker flavor we want).

Steps To Reproduce

Steps to reproduce the behavior:

  • ensure you have rust-lld.exe:
cargo install -f cargo-binutils
rustup component add llvm-tools-preview
  • create a skeleton project:
cargo new repro
cd repro
  • add a .cargo/config.toml using rust-lld.exe for windows:
[target.x86_64-pc-windows-msvc]
linker = "rust-lld.exe"
  • run with dx serve --hot-patch

Expected behavior

No error should occur.

Environment:

  • Dioxus version: dioxus 0.7.0-rc.0 (a519fba)
  • Rust version: rustc 1.90.0 (1159e78c4 2025-09-14)
  • OS info: Windows 10
  • App platform: desktop

Metadata

Metadata

Assignees

No one assigned

    Labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions