Skip to content

Windows failing with "expected an absolute Windows path for junction_target" #2445

@mbland

Description

@mbland

The bazel-contrib/rules_scala daily CI build began failing on Windows with Bazel 7.7.1 at bazel-contrib/rules_scala@eae29fd:

The error is:

ERROR: <builtin>: fetching local_repository rule //:rules_scala+:
  java.io.IOException: Could not create symlink to repository
  "/c/b/bk-windows-8slj/bazel/rules-scala-scala/tmp/test_bzlmod_macros"
  (absolute path: "/c/b/bk-windows-8slj/bazel/rules-scala-scala/tmp/test_bzlmod_macros"):
Cannot create junction
  (name=C:\tools\msys64\home\b\_bazel_b\jto5y4qq\external\rules_scala+,
   target=\c\b\bk-windows-8slj\bazel\rules-scala-scala\tmp\test_bzlmod_macros):
ERROR: src/main/native/windows/file-jni.cc(122):
  nativeCreateJunction(\\?\C:\tools\msys64\home\b\_bazel_b\jto5y4qq\external\rules_scala+,
    \\?\\c\b\bk-windows-8slj\bazel\rules-scala-scala\tmp\test_bzlmod_macros):
ERROR: src/main/native/windows/file.cc(231):
  CreateJunction(\\?\\c\b\bk-windows-8slj\bazel\rules-scala-scala\tmp\test_bzlmod_macros):
expected an absolute Windows path for junction_target

There's nothing from diffing the raw Buildkite logs to suggest that anything changed. Was there a Windows build image change that could account for this? Is there a workaround, or does Bazel itself require a fix, since this happens in the local_repository implementation?

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