Link error building copy_file with msvc - regression in rules_rust 0.66

Open
#3,879 1 comment 0 reactions 0 assignees View on GitHub

Maintainers usually reply within 3 days

Nobody has claimed this yet.

Assessment

Difficulty
4/5
Estimated time
3-5 days
Newbie friendliness
35/100
Issue type
Bug
Clarity
Mostly clear
Activity status
Stale
Tech stack
rust
Domain
build-system

Research direction

Reproduce the failure with rules_rust 0.66 by running bazel build //... on Windows with the MSVC toolchain. Inspect the generated linker arguments for external/rules_rust+/cargo/private:copy_file, especially the library paths, and compare them with rules_rust 0.65; done means the copy_file target and the full build link successfully.

Written by the indexing model from the issue text.

Description

awaiting-response help wanted windows

When upgrading to rules_rust 0.66 from 0.65 we see this error:

D:\workdir\gitlab\plm\tc\servicemesh>bazel build //...
INFO: Analyzed 229 targets (2186 packages loaded, 86137 targets configured).
ERROR: D:/udu/b/jsuyf6jg/external/rules_rust+/cargo/private/BUILD.bazel:4:12: Compiling Rust bin copy_file (1 files) [for tool] failed: (Exit 1): process_wrapper.exe failed: error executing Rustc command (from target @@rules_rust+//cargo/private:copy_file) bazel-out\x64_windows-opt-exec-ST-ec4a08ce3b65\bin\external\rules_rust+\util\process_wrapper\process_wrapper.exe --subst pwd=${pwd} -- ... (remaining 55 arguments skipped)
error: linking with `external/tc_toolchain+/toolchain/x64-windows/14.42.34433/link.exe` failed: exit code: 1181
  |
  = note: "external/tc_toolchain+/toolchain/x64-windows/14.42.34433/link.exe" "/NOLOGO" "C:\\Users\\browchri.PLM\\AppData\\Local\\Temp\\rustclVmcWj\\symbols.o" "<2 object files omitted>" "<sysroot>\\lib\\rustlib\\x86_64-pc-windows-msvc\\lib/{libstd-*,libpanic_unwind-*,libwindows_targets-*,librustc_demangle-*,libstd_detect-*,libhashbrown-*,librustc_std_workspace_alloc-*,libunwind-*,libcfg_if-*,librustc_std_workspace_core-*,liballoc-*,libcore-*,libcompiler_builtins-*}.rlib" "kernel32.lib" "kernel32.lib" "kernel32.lib" "ntdll.lib" "userenv.lib" "ws2_32.lib" "dbghelp.lib" "/defaultlib:msvcrt" "/NXCOMPAT" "/LIBPATH:<sysroot>/lib/rustlib/x86_64-pc-windows-msvc/lib" "/OUT:bazel-out/x64_windows-opt-exec-ST-ec4a08ce3b65/bin/external/rules_rust+/cargo/private/copy_file.exe" "/OPT:REF,ICF" "/DEBUG" "/PDBALTPATH:%_PDB%" "/nologo" "/SUBSYSTEM:CONSOLE" "/NOLOGO" "/MACHINE:X64" "/NODEFAULTLIB" "delayimp.lib" "kernel32.lib" "/DYNAMICBASE" "/NXCOMPAT" "/Brepro" "/experimental:deterministic" "/NOLOGO" "/MACHINE:X64" "/NODEFAULTLIB" "delayimp.lib" "kernel32.lib" "/DYNAMICBASE" "/NXCOMPAT" "/Brepro" "/experimental:deterministic" "ucrt.lib" "vcruntime.lib" "msvcrt.lib" "msvcprt.lib" "oldnames.lib" "/DEBUG:FULL" "/INCREMENTAL:NO" "/pdbaltpath:%_PDB%" "/OPT:ICF" "/OPT:REF" "-LIBPATH:C:\\apps\\MVS17124\\VC\\Tools\\MSVC\\14.42.34433\\ATLMFC\\lib\\x64" "-LIBPATH:C:\\apps\\MVS17124\\VC\\Tools\\MSVC\\14.42.34433\\lib\\x64" "-LIBPATH:C:\\Program Files (x86)\\Windows Kits\\NETFXSDK\\4.8\\lib\\um\\x64" "-LIBPATH:C:\\Program Files (x86)\\Windows Kits\\10\\lib\\10.0.26100.0\\ucrt\\x64" "-LIBPATH:C:\\Program Files (x86)\\Windows Kits\\10\\\\lib\\10.0.26100.0\\\\um\\x64"
  = note: some arguments are omitted. use `--verbose` to show all linker arguments
  = note: LINK : fatal error LNK1181: cannot open input file 'Files.obj'␍␍
Dominant language
Starlark
Stars
857
Forks
701
Avg merge
4d 7h
Merged PRs (30d)
46

Getting set up

First steps

  1. Read the whole issue, then the project's contributing guide.
  2. Comment on the issue to say you are picking it up — it saves two people doing the same work.
  3. Fork the repository and make your change on a branch.
  4. Open a pull request that references the issue number.

More from bazelbuild/rules_rust

All issues in bazelbuild/rules_rust

Similar issues

More Build System issues

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.