Skip to content

x.py build --incremental fails because of a command too long #44898

Closed
@zilbuz

Description

@zilbuz

I'm on Windows, with a x86_64-pc-windows-msvc toolchain. When compiling Rust with x.py build --incremental after editing librustc_mir/borrow_check.rs, I have the following error:

Compiling rustc_mir v0.0.0 (file:///C:/Users/zilbuz/projets/rust/src/librustc_mir)
error: could not exec the linker `link.exe`: The filename or extension is too long. (os error 206)
  |
  = note: "C:\\Program Files (x86)\\Microsoft Visual Studio\\2017\\Community\\VC\\Tools\\MSVC\\14.11.25503\\bin\\HostX64\\x64\\link.exe" "/NOLOGO" "/NXCOMPAT" "/LIBPATH:C:\\Use
rs\\zilbuz\\projets\\rust\\build\\x86_64-pc-windows-msvc\\stage0-sysroot\\lib\\rustlib\\x86_64-pc-windows-msvc\\lib" "C:\\Users\\zilbuz\\projets\\rust\\build\\x86_64-pc-windows

[... snip 40936 characters]

e0-sysroot\\lib\\rustlib\\x86_64-pc-windows-msvc\\lib" "std-488c7c40c2087fcf.dll.lib" "C:\\Users\\zilbuz\\AppData\\Local\\Temp\\rustc.DmRRue9GNCaI\\libcompiler_builtins-2f642fd
8dbd70770.rlib" "psapi.lib" "kernel32.lib" "advapi32.lib" "advapi32.lib" "ws2_32.lib" "userenv.lib" "shell32.lib" "libcmt.lib" "/DLL" "/IMPLIB:C:\\Users\\zilbuz\\projets\\rust\
\build\\x86_64-pc-windows-msvc\\stage0-rustc\\x86_64-pc-windows-msvc\\release\\deps\\rustc_mir-0f20c3c479aba5d8.dll.lib"

error: aborting due to previous error

error: Could not compile `rustc_mir`.

Caused by:
  process didn't exit successfully: `C:\Users\zilbuz\projets\rust\build\bootstrap/debug/rustc --crate-name rustc_mir src\librustc_mir\lib.rs --error-format json --crate-type dy
lib --emit=dep-info,link -C prefer-dynamic -C opt-level=2 -C metadata=0f20c3c479aba5d8 -C extra-filename=-0f20c3c479aba5d8 --out-dir C:\Users\zilbuz\projets\rust\build\x86_64-p
c-windows-msvc\stage0-rustc\x86_64-pc-windows-msvc\release\deps --target x86_64-pc-windows-msvc -L dependency=C:\Users\zilbuz\projets\rust\build\x86_64-pc-windows-msvc\stage0-r
ustc\x86_64-pc-windows-msvc\release\deps -L dependency=C:\Users\zilbuz\projets\rust\build\x86_64-pc-windows-msvc\stage0-rustc\release\deps --extern graphviz=C:\Users\zilbuz\pro
jets\rust\build\x86_64-pc-windows-msvc\stage0-rustc\x86_64-pc-windows-msvc\release\deps\graphviz-5d7fe7040ed57f01.dll --extern rustc_data_structures=C:\Users\zilbuz\projets\rus
t\build\x86_64-pc-windows-msvc\stage0-rustc\x86_64-pc-windows-msvc\release\deps\rustc_data_structures-b9628b020bb214b5.dll --extern log=C:\Users\zilbuz\projets\rust\build\x86_6
4-pc-windows-msvc\stage0-rustc\x86_64-pc-windows-msvc\release\deps\liblog-27c77b885b9a02c9.rlib --extern syntax_pos=C:\Users\zilbuz\projets\rust\build\x86_64-pc-windows-msvc\st
age0-rustc\x86_64-pc-windows-msvc\release\deps\syntax_pos-6ea3df7d784b3eb9.dll --extern rustc_errors=C:\Users\zilbuz\projets\rust\build\x86_64-pc-windows-msvc\stage0-rustc\x86_
64-pc-windows-msvc\release\deps\rustc_errors-548d0fe0cca64918.dll --extern bitflags=C:\Users\zilbuz\projets\rust\build\x86_64-pc-windows-msvc\stage0-rustc\x86_64-pc-windows-msv
c\release\deps\libbitflags-f4d0c753c8935159.rlib --extern rustc=C:\Users\zilbuz\projets\rust\build\x86_64-pc-windows-msvc\stage0-rustc\x86_64-pc-windows-msvc\release\deps\rustc
-5c43ee8e6dfcc144.dll --extern rustc_const_math=C:\Users\zilbuz\projets\rust\build\x86_64-pc-windows-msvc\stage0-rustc\x86_64-pc-windows-msvc\release\deps\rustc_const_math-81d4
91847226ec65.dll --extern syntax=C:\Users\zilbuz\projets\rust\build\x86_64-pc-windows-msvc\stage0-rustc\x86_64-pc-windows-msvc\release\deps\syntax-a61322cf56404b56.dll --extern
 rustc_const_eval=C:\Users\zilbuz\projets\rust\build\x86_64-pc-windows-msvc\stage0-rustc\x86_64-pc-windows-msvc\release\deps\rustc_const_eval-03adaa682e06899f.dll -L native=C:\
Users\zilbuz\projets\rust\build\x86_64-pc-windows-msvc\stage0-rustc\x86_64-pc-windows-msvc\release\build\miniz-sys-75134b743b58a2a9\out` (exit code: 101)
thread 'main' panicked at 'command did not execute successfully: "C:\\Users\\zilbuz\\projets\\rust\\build\\x86_64-pc-windows-msvc\\stage0/bin\\cargo.exe" "build" "--target" "x8
6_64-pc-windows-msvc" "-j" "4" "--release" "--features" " llvm" "--manifest-path" "C:\\Users\\zilbuz\\projets\\rust\\src/rustc/Cargo.toml" "--message-format" "json"
expected success, got: exit code: 101', src\bootstrap\compile.rs:883:8
note: Run with `RUST_BACKTRACE=1` for a backtrace.
failed to run: C:\Users\zilbuz\projets\rust\build\bootstrap\debug\bootstrap build --stage 1 --incremental
Build completed unsuccessfully in 0:00:38

I think this may be because the command line is too long (41 760 characters).

The longest path in the command line is at 196 characters :
C:\\Users\\zilbuz\\projets\\rust\\build\\x86_64-pc-windows-msvc\\stage0-rustc\\x86_64-pc-windows-msvc\\release\\deps\\rustc_mir-0f20c3c479aba5d8.rustc_mir-dataflow-move_paths-abs_domain.volatile.o

Attached is the complete trace with RUST_BACKTRACE=1 : build-incremental-fail-full.txt

Metadata

Metadata

Assignees

No one assigned

    Labels

    T-bootstrapRelevant to the bootstrap subteam: Rust's build system (x.py and src/bootstrap)T-infraRelevant to the infrastructure team, which will review and decide on the PR/issue.

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions