Skip to content

"Failed to create symlink" on windows #2019

Open
@baszalmstra

Description

@baszalmstra

When trying out this project I immediately ran into an issue on Windows:

ERROR: An error occurred during the fetch of repository 'crate_index':
   Traceback (most recent call last):
        File "C:/users/bas/_bazel_bas/2verhtmo/external/rules_rust/crate_universe/private/crates_repository.bzl", line 59, column 50, in _crates_repository_impl
                metadata_path = splice_workspace_manifest(
        File "C:/users/bas/_bazel_bas/2verhtmo/external/rules_rust/crate_universe/private/splicing_utils.bzl", line 180, column 12, in splice_workspace_manifest
                execute(
        File "C:/users/bas/_bazel_bas/2verhtmo/external/rules_rust/crate_universe/private/common_utils.bzl", line 48, column 13, in execute
                fail(_EXECUTE_ERROR_MESSAGE.format(
Error in fail: Command [C:/users/bas/_bazel_bas/2verhtmo/external/crate_index/cargo-bazel.exe, "splice", "--output-dir", C:/users/bas/_bazel_bas/2verhtmo/external/crate_index/splicing-output, "--splicing-manifest", C:/users/bas/_bazel_bas/2verhtmo/external/crate_index/splicing_manifest.json, "--config", C:/users/bas/_bazel_bas/2verhtmo/external/crate_index/cargo-bazel.json, "--cargo", C:/users/bas/_bazel_bas/2verhtmo/external/rust_windows_x86_64__x86_64-pc-windows-msvc__stable_tools/bin/cargo.exe, "--rustc", C:/users/bas/_bazel_bas/2verhtmo/external/rust_windows_x86_64__x86_64-pc-windows-msvc__stable_tools/bin/rustc.exe, "--cargo-lockfile", C:/users/bas/developer/prefix.dev/Cargo.lock] failed with exit code 1.
STDOUT ------------------------------------------------------------------------

STDERR ------------------------------------------------------------------------
Error: Failed to create symlink: C:/users/bas/developer/prefix.dev\.cargo -> C:\Users\bas\AppData\Local\Temp\.tmpFaPzlG\.cargo

Caused by:
    A required privilege is not held by the client. (os error 1314)

Looks like cargo-bazel tries to create a symlink which is only allowed in rare circumstances on Windows. Hard-links would usually work though?

Metadata

Metadata

Assignees

No one assigned

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions