misc/reboot: overlay $GOROOT/lib in temporary goroot

This fixes the test after CL 455357, which builds the time/tzdata file
from $GOROOT/lib/time/zoneinfo.zip.

Change-Id: I0c5afa6521b58dd3b57c3b4c3c704a622b846382
Reviewed-on: https://go-review.googlesource.com/c/go/+/462279
Run-TryBot: Ian Lance Taylor <iant@golang.org>
Reviewed-by: Cherry Mui <cherryyz@google.com>
Reviewed-by: Dmitri Shuralyov <dmitshur@google.com>
Auto-Submit: Ian Lance Taylor <iant@golang.org>
Reviewed-by: Dmitri Shuralyov <dmitshur@golang.org>
TryBot-Bypass: Ian Lance Taylor <iant@golang.org>
Reviewed-by: Than McIntosh <thanm@google.com>
This commit is contained in:
Ian Lance Taylor 2023-01-17 16:14:05 -08:00 committed by Gopher Robot
parent 198074abd7
commit d449c01d12

View file

@ -36,14 +36,22 @@ func TestRepeatBootstrap(t *testing.T) {
if err := os.Mkdir(dotGit, 000); err != nil {
t.Fatal(err)
}
overlayStart := time.Now()
goroot := filepath.Join(parent, "goroot")
gorootSrc := filepath.Join(goroot, "src")
overlayStart := time.Now()
if err := overlayDir(gorootSrc, filepath.Join(realGoroot, "src")); err != nil {
t.Fatal(err)
}
t.Logf("GOROOT/src overlay set up in %s", time.Since(overlayStart))
gorootLib := filepath.Join(goroot, "lib")
if err := overlayDir(gorootLib, filepath.Join(realGoroot, "lib")); err != nil {
t.Fatal(err)
}
t.Logf("GOROOT overlay set up in %s", time.Since(overlayStart))
if err := os.WriteFile(filepath.Join(goroot, "VERSION"), []byte(runtime.Version()), 0666); err != nil {
t.Fatal(err)