// include all packages within subdirectories as well.
// These will be imported during bootstrap as bootstrap/name, like bootstrap/math/big.
var bootstrapDirs = []string{
+ "cmp",
"cmd/asm",
"cmd/asm/internal/...",
"cmd/cgo",
"debug/pe",
"go/build/constraint",
"go/constant",
+ "go/version",
"internal/abi",
"internal/coverage",
+ "cmd/internal/cov/covcmd",
"internal/bisect",
"internal/buildcfg",
"internal/goarch",
"internal/godebugs",
"internal/goexperiment",
"internal/goroot",
+ "internal/gover",
"internal/goversion",
+ // internal/lazyregexp is provided by Go 1.17, which permits it to
+ // be imported by other packages in this list, but is not provided
+ // by the Go 1.17 version of gccgo. It's on this list only to
+ // support gccgo, and can be removed if we require gccgo 14 or later.
+ "internal/lazyregexp",
"internal/pkgbits",
"internal/platform",
"internal/profile",
"internal/unsafeheader",
"internal/xcoff",
"internal/zstd",
- "math/big",
"math/bits",
"sort",
- "strconv",
}
// File prefixes that are ignored by go/build anyway, and cause
var ignoreSuffixes = []string{
"_test.s",
"_test.go",
+ // Skip PGO profile. No need to build toolchain1 compiler
+ // with PGO. And as it is not a text file the import path
+ // rewrite will break it.
+ ".pgo",
}
var tryDirs = []string{
mkbuildcfg(pathf("%s/src/internal/buildcfg/zbootstrap.go", goroot))
mkobjabi(pathf("%s/src/cmd/internal/objabi/zbootstrap.go", goroot))
- mkzosarch("", pathf("%s/src/internal/platform/zosarch.go", goroot))
// Use $GOROOT/pkg/bootstrap as the bootstrap workspace root.
// We use a subdirectory of $GOROOT/pkg because that's the
// binary that works for the current gohostarch.
// This saves 6+ seconds of bootstrap.
if archCaps, ok := isUnneededSSARewriteFile(srcFile, gohostarch); ok {
- return fmt.Sprintf(`// Code generated by go tool dist; DO NOT EDIT.
-
-package ssa
+ return fmt.Sprintf(`%spackage ssa
func rewriteValue%s(v *Value) bool { panic("unused during bootstrap") }
func rewriteBlock%s(b *Block) bool { panic("unused during bootstrap") }
-`, archCaps, archCaps)
+`, generatedHeader, archCaps, archCaps)
}
return bootstrapFixImports(srcFile)
}
}
- lines[0] = "// Code generated by go tool dist; DO NOT EDIT.\n// This is a bootstrap copy of " + srcFile + "\n\n//line " + srcFile + ":1\n" + lines[0]
+ lines[0] = generatedHeader + "// This is a bootstrap copy of " + srcFile + "\n\n//line " + srcFile + ":1\n" + lines[0]
return strings.Join(lines, "")
}