Skip to content

Unable to build example: cannot open file librustc_std_workspace_alloc-ba723ab4066a2120.rlib #1556

Closed

Description

@PigeonF

Just adding this for posterity, since I managed to fix the issue.

Attempting to build the examples with

cd /path/to/rules_rust/examples/
bazel build //hello_lib

fails with

fatal error LNK1104: cannot open file 'C:\Users\PigeonF\_bazel_PigeonF\6fssty6r\execroot\examples\bazel-out\x64_windows-opt-exec-2B5CBBC6\bin\external\rust_windows_x86_64__x86_64-pc-windows-msvc_tools\rust_toolchain\lib\rustlib\x86_64-pc-windows-msvc\lib\librustc_std_workspace_alloc-ba723ab4066a2120.rlib'

The problem is that the path exceeds the path character limit on Windows.

The fix is described in the Best Practices Section of the bazel documentation (enabling 8.3 filename support, or using --output_user_root to change the build output directory)

Activity

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

      Milestone

      No milestone

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions