Skip to content

rustc on Windows gives error when dependencies are on a mapped network drive #25505

Closed
@yonran

Description

@yonran

When I try to cargo build a project in a mapped network drive in Windows that has at least one dependency, gcc gives error saying it can’t find the dependencies. (In the following example, F:\ is mapped to \vboxsvr\Downloads)

PS F:\hellors> cargo build
   Compiling hellors v0.1.0 (file:///F:/hellors)
error: linking with `gcc` failed: exit code: 1
note: "gcc" "-Wl,--enable-long-section-names" "-fno-use-linker-plugin" "-Wl,--nxcompat" "-static-libgcc" "-m64" "-L" "C:\Rust\bin\rustlib\x86_64-pc-windows-gnu\lib" "-o" "F:\hellors\target\debug\hellors.exe" "F:\hellors\target\debug\hellors.o" "-Wl,--gc-sections" "\\?\UNC\vboxsrv\Downloads\hellors\target\debug\deps\liblibc-674726c388d62fa2.rlib" "C:\Rust\bin\rustlib\x86_64-pc-windows-gnu\lib\libstd-4e7c5e5c.rlib" "C:\Rust\bin\rustlib\x86_64-pc-windows-gnu\lib\libcollections-4e7c5e5c.rlib" "C:\Rust\bin\rustlib\x86_64-pc-windows-gnu\lib\librustc_unicode-4e7c5e5c.rlib" "C:\Rust\bin\rustlib\x86_64-pc-windows-gnu\lib\librand-4e7c5e5c.rlib" "C:\Rust\bin\rustlib\x86_64-pc-windows-gnu\lib\liballoc-4e7c5e5c.rlib" "C:\Rust\bin\rustlib\x86_64-pc-windows-gnu\lib\liblibc-4e7c5e5c.rlib" "C:\Rust\bin\rustlib\x86_64-pc-windows-gnu\lib\libcore-4e7c5e5c.rlib" "-L" "F:\hellors\target\debug" "-L" "F:\hellors\target\debug\deps" "-L" "C:\Rust\bin\rustlib\x86_64-pc-windows-gnu\lib" "-L" "F:\hellors\.rust\bin\x86_64-pc-windows-gnu" "-L" "F:\hellors\bin\x86_64-pc-windows-gnu" "-Wl,--whole-archive" "-Wl,-Bstatic" "-Wl,--no-whole-archive" "-Wl,-Bdynamic" "-lws2_32" "-luserenv" "-lcompiler-rt"
note: gcc: error: \\liblibc-674726c388d62fa2.rlib: No such file or directory

Note that gcc was given the path “\?\UNC\vboxsrv\Downloads\hellors\target\debug\deps\liblibc-674726c388d62fa2.rlib” instead of “F:\hellors...”

Compiling a project on a network drive last worked in the 2015-04-29 Windows nightly, and this error started happening on the 2015-05-01 Windows nightly (although you might get the crt2.o/crtbegin.o/crtend.o error instead on some projects from 2015-05-01 to 2015-05-05 #25072).

Metadata

Metadata

Assignees

No one assigned

    Labels

    O-windowsOperating system: Windows

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions