Skip to content

Commit 09a206c

Browse files
authored
Symlink all SDK files with go_local_sdk (#3696)
This is required with Go 1.21.1 as the `go` tool reads the `go.env` at the root of the SDK. Instead of explicitly symlinking that file, symlink all files except for the ones that already exist, e.g. because they were added by another SDK rule wrapped with `go_wrap_sdk`.
1 parent 9ebc93c commit 09a206c

File tree

1 file changed

+4
-2
lines changed

1 file changed

+4
-2
lines changed

go/private/sdk.bzl

Lines changed: 4 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -473,8 +473,10 @@ def _remote_sdk(ctx, urls, strip_prefix, sha256):
473473
)
474474

475475
def _local_sdk(ctx, path):
476-
for entry in ["src", "pkg", "bin", "lib", "misc"]:
477-
ctx.symlink(path + "/" + entry, entry)
476+
for entry in ctx.path(path).readdir():
477+
if ctx.path(entry.basename).exists:
478+
continue
479+
ctx.symlink(entry, entry.basename)
478480

479481
def _sdk_build_file(ctx, platform, version, experiments):
480482
ctx.file("ROOT")

0 commit comments

Comments
 (0)