ef06a5f44a
go:embed disallows using symlinked files by design. crypto/elliptic is the first std package to use it as of CL 380475, and unfortunately that broke the TestRepeatBootstrap long test. The reason it uses symlinks is for speed; it wants to copy GOROOT/src, but regular files aren't going to be modified in any way, so a symlink, if supported, means not needing to copy the contents. Replace the symlink attempt with hard links, which will mean regular files remain as such, fixing go:embed. It's worth noting that on many systems hard links won't work, as the temporary filesystem tends to be separate, but it doesn't hurt to try. In my system, where /tmp is tmpfs, the test now copies more bytes. With the added Logf, I can see overlayDir goes from ~30ms to ~100ms. This makes sense, as GOROOT/src currently weighs around 100MiB. To alleviate that slow-down, stop copying testdata directories, as they currently weigh around 20MiB and aren't needed for the test. This gets overlayDir on my system down to an acceptable ~70ms. I briefly considered teaching overlayDir what files can be symlinks, but that seemed fairly complex long-term, as any file could be embedded. While here, start using testing.T.TempDir and fs.WalkDir. For #50995. Change-Id: I17947e6bdee96237e1ca0606ad0b95e7c5987bc1 Reviewed-on: https://go-review.googlesource.com/c/go/+/383995 Trust: Daniel Martí <mvdan@mvdan.cc> Trust: Bryan Mills <bcmills@google.com> Run-TryBot: Bryan Mills <bcmills@google.com> Reviewed-by: Bryan Mills <bcmills@google.com> TryBot-Result: Gopher Robot <gobot@golang.org> |
||
---|---|---|
.github | ||
api | ||
doc | ||
lib/time | ||
misc | ||
src | ||
test | ||
.gitattributes | ||
.gitignore | ||
AUTHORS | ||
codereview.cfg | ||
CONTRIBUTING.md | ||
CONTRIBUTORS | ||
LICENSE | ||
PATENTS | ||
README.md | ||
SECURITY.md |
The Go Programming Language
Go is an open source programming language that makes it easy to build simple, reliable, and efficient software.
Gopher image by Renee French, licensed under Creative Commons 3.0 Attributions license.
Our canonical Git repository is located at https://go.googlesource.com/go. There is a mirror of the repository at https://github.com/golang/go.
Unless otherwise noted, the Go source files are distributed under the BSD-style license found in the LICENSE file.
Download and Install
Binary Distributions
Official binary distributions are available at https://golang.org/dl/.
After downloading a binary release, visit https://golang.org/doc/install for installation instructions.
Install From Source
If a binary distribution is not available for your combination of operating system and architecture, visit https://golang.org/doc/install/source for source installation instructions.
Contributing
Go is the work of thousands of contributors. We appreciate your help!
To contribute, please read the contribution guidelines at https://golang.org/doc/contribute.
Note that the Go project uses the issue tracker for bug reports and proposals only. See https://golang.org/wiki/Questions for a list of places to ask questions about the Go language.