bazel-contrib / rules_go

Go rules for Bazel
Apache License 2.0
1.38k stars 656 forks source link

Go 1.23.0 Windows build fails with "stdlib: The system cannot find the path specified." #4049

Closed jayconrod closed 1 month ago

jayconrod commented 2 months ago

What version of rules_go are you using?

0.49.0

Also reproduced at master, which is currently 520bee5039bcaf831ed3e79c513f35f629c04624.

What version of gazelle are you using?

n/a

What version of Bazel are you using?

7.3.0

Does this issue reproduce with the latest releases of all the above?

yes

What operating system and processor architecture are you using?

Windows / amd64

Any other potentially useful information about your toolchain?

n/a

What did you do?

  1. Create a minimal workspace, as below (use txtar to extract).
  2. bazel build //:hello
-- WORKSPACE --
-- MODULE.bazel --
module(
    name = "scratch",
    version = "0.0.0",
)

bazel_dep(
    name = "rules_go",
    version = "0.49.0",
)

go_sdk = use_extension("@rules_go//go:extensions.bzl", "go_sdk")
go_sdk.download(
    name = "go_sdk",
    version = "1.23.0",
)

use_repo(go_sdk, "go_sdk")
-- BUILD --
load("@rules_go//go:def.bzl", "go_library")

go_library(
    name = "hello",
    srcs = ["hello.go"],
    importpath = "example.com/hello",
)
-- hello.go --
package hello

What did you expect to see?

Successful build

What did you see instead?

ERROR: C:/_b/fhie23dh/external/rules_go~/BUILD.bazel:42:7: GoStdlib external/rules_go~/stdlib_/pkg failed: (Exit 1): builder.exe failed: error executing GoStdlib command (from target @@rules_go~//:stdlib) bazel-out\x64_windows-opt-exec-ST-d57f47055a04\bin\external\rules_go~~go_sdk~go_sdk\builder_reset\builder.exe stdlib -sdk external/rules_go~~go_sdk~go_sdk -goroot external/rules_go~~go_sdk~go_sdk ... (remaining 8 arguments skipped)
stdlib: The system cannot find the path specified.
Target //:hello failed to build                                                                                                                         
Arm1stice commented 2 months ago

Can confirm I am seeing this as well, been looking for a solution all day but can't seem to figure out what is going on

jayconrod commented 2 months ago

Some debugging: the error is emitted by filepath.EvalSymlinks in replicateTree. Working directory is C:\_b\fhie23dh\execroot\_main. src is external\rules_go~~go_sdk~go_sdk\src.

There are some changes mentioned in the release notes:

On Windows, EvalSymlinks no longer evaluates mount points, which was a source of many inconsistencies and bugs. This behavior is controlled by the winsymlink setting. For Go 1.23, it defaults to winsymlink=1. Previous versions default to winsymlink=0.

On Windows, EvalSymlinks no longer tries to normalize volumes to drive letters, which was not always even possible. This behavior is controlled by the winreadlinkvolume setting. For Go 1.23, it defaults to winreadlinkvolume=1. Previous versions default to winreadlinkvolume=0.

brounnoupegreula-7757 commented 1 month ago

any news about this guys? i also get this error