From 59b72f2182cb4b35c3d2fcb2da83ea47e9ed5f33 Mon Sep 17 00:00:00 2001 From: deadprogram Date: Sat, 12 Aug 2023 12:29:28 +0200 Subject: [PATCH] loader: merge go.env file which is now required starting in Go 1.21 to correctly get required packages Signed-off-by: deadprogram --- loader/goroot.go | 5 +++++ 1 file changed, 5 insertions(+) diff --git a/loader/goroot.go b/loader/goroot.go index b6812badc4..c1479b642f 100644 --- a/loader/goroot.go +++ b/loader/goroot.go @@ -207,6 +207,11 @@ func listGorootMergeLinks(goroot, tinygoroot string, overrides map[string]bool) merges[dir] = filepath.Join(goroot, dir) } + // Required starting in Go 1.21 due to https://github.com/golang/go/issues/61928 + if _, err := os.Stat(filepath.Join(goroot, "go.env")); err == nil { + merges["go.env"] = filepath.Join(goroot, "go.env") + } + return merges, nil }