Skip to content

README: LNK1104 from build scripts in a deep checkout - #1118

Closed
AlexandreSchuelter wants to merge 1 commit into
xcl-dev:mainfrom
AlexandreSchuelter:readme-long-path-lnk1104
Closed

AlexandreSchuelter wants to merge 1 commit into
xcl-dev:mainfrom
AlexandreSchuelter:readme-long-path-lnk1104

Conversation

@AlexandreSchuelter

Copy link
Copy Markdown

A first build in a deep folder failed with LNK1104 on a build script, and nothing in the README, issues or PRs mentions it. This adds a short note under Building and usage: the symptom, that LongPathsEnabled does not help (link.exe is not long-path aware), and the fix (a short clone path or CARGO_TARGET_DIR).

What is in it

  • README.md: a Long paths bullet under Building and usage (4 lines)

Tested

  • AMD Radeon RX 6900 XT, driver 32.0.21045.29003; Ryzen 7 5800X3D; Windows NT 10.0.26300, LongPathsEnabled=1; Rust 1.100.0 stable-x86_64-pc-windows-msvc, VS 2022 Build Tools 17.14 (MSVC 14.44)
  • Checkout path of 186 characters, default target\: cargo build --workspace --release failed with LNK1104 on target\release\build\proc-macro2\<hash>\out\build_script_build.exe (263 characters)
  • Reproduced on 47efa2e with a 198-character CARGO_TARGET_DIR: cargo build -p xcl failed with LNK1104 on the build_script_build.exe of windows_x86_64_msvc, quote and serde_json
  • Build-script executables under the target directory measured 60–78 characters past it, hence "about 80" with \target
  • With CARGO_TARGET_DIR at 109 characters the same checkout builds; cargo test --workspace --no-fail-fast -- --test-threads=4 (debug) on 47efa2e: 738 passed, 3 failed, 41 ignored, no SKIPPED GPU tests. The 3 failures are the RDNA2 packed-mip test fixed by D3D12.X: map a one-slice title texture's packed mips where D3D12 addresses them #470 / D3D12.X: map and unmap 3D texture mips separately #1028 and its two PoisonError cascades (Tests: a panicking title-texture test no longer poisons the others #673)

Regression run
Not needed: README only.

Not tested

  • The exact threshold for every dependency's build-script path (only the 60–78 range above)
  • Windows 10, other Visual Studio / MSVC versions

AI use

  • Claude Code (Claude Opus 5.5): found the cause, wrote the note, ran the builds and tests above and drafted this description

Cargo's build-script paths under target\ add 60-78 characters past the
target directory (measured on this tree). With a checkout path of 186
characters, link.exe failed with LNK1104 on
target\release\build\proc-macro2\<hash>\out\build_script_build.exe
(263 characters), with LongPathsEnabled=1 in the registry. A
CARGO_TARGET_DIR of 109 characters built and tested fine. Reproduced on
47efa2e with a 198-character CARGO_TARGET_DIR.

Assisted-by: Claude Code (Claude Opus 5.5)
@Darkkandadr

Copy link
Copy Markdown

I hit the same failure on a first build, with a newer toolchain. The note matches what I saw.

Tested

  • Windows 11 Pro build 26300, LongPathsEnabled=1. Rust 1.96.0 stable-x86_64-pc-windows-msvc. VS Build Tools 2026 (18.12.1) and Windows SDK 10.0.26100.0, freshly installed.
  • Checkout path of 185 characters, default target\, cargo build --workspace on main 930e8b4: LINK : fatal error LNK1104 on target\debug\build\libc-<hash>\build_script_build-<hash>.exe. The build scripts of windows_x86_64_msvc, proc-macro2, quote and serde_core failed the same way.
  • The same checkout with CARGO_TARGET_DIR=C:\Users\<me>\AppData\Local\Temp\xclt built without warnings or errors.

The README change is 4 lines and only text, and I read it before testing.

Run and written with Claude Code (Claude Opus 5.5).

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