Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

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

Closed
zilbuz opened this issue Sep 28, 2017 · 3 comments
Closed

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

zilbuz opened this issue Sep 28, 2017 · 3 comments
Labels
T-bootstrap Relevant to the bootstrap subteam: Rust's build system (x.py and src/bootstrap) T-infra Relevant to the infrastructure team, which will review and decide on the PR/issue.

Comments

@zilbuz
Copy link
Contributor

zilbuz commented Sep 28, 2017

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

@cuviper
Copy link
Member

cuviper commented Sep 28, 2017

Many programs (including link.exe) allow a @file argument which will read arguments from that file.

@hanna-kruppe
Copy link
Contributor

hanna-kruppe commented Sep 28, 2017

This is #41190 which was fixed recently (in #44094). So this should be fixed automatically once the fix makes it into the bootstrap compiler (I believe the fix will be in 1.22). In the mean time, bootstrapping from a recent local rustc ought to fix this.

@Mark-Simulacrum Mark-Simulacrum added T-bootstrap Relevant to the bootstrap subteam: Rust's build system (x.py and src/bootstrap) T-infra Relevant to the infrastructure team, which will review and decide on the PR/issue. labels Sep 29, 2017
@zilbuz
Copy link
Contributor Author

zilbuz commented Sep 29, 2017

Oh I didn't find these PR. Bootstrapping from a recent local rustc fixed my issue, so I close it :)

@zilbuz zilbuz closed this as completed Sep 29, 2017
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
T-bootstrap Relevant to the bootstrap subteam: Rust's build system (x.py and src/bootstrap) T-infra Relevant to the infrastructure team, which will review and decide on the PR/issue.
Projects
None yet
Development

No branches or pull requests

4 participants