mirror of
https://github.com/burrowers/garble.git
synced 2025-12-24 12:58:05 +08:00
re-add "package P not in std" special case when loading runtimeLinknamed
Since some packages are in some Go versions but not others. We had a version of this check when we last supported two Go versions.
This commit is contained in:
@@ -265,10 +265,13 @@ func appendListedPackages(packages []string, mainBuild bool) error {
|
||||
}
|
||||
|
||||
if perr := pkg.Error; perr != nil {
|
||||
if pkg.Standard && len(pkg.CompiledGoFiles) == 0 && len(pkg.IgnoredGoFiles) > 0 {
|
||||
if !mainBuild && len(pkg.CompiledGoFiles) == 0 && len(pkg.IgnoredGoFiles) > 0 {
|
||||
// Some packages in runtimeLinknamed need a build tag to be importable,
|
||||
// like crypto/internal/boring/fipstls with boringcrypto,
|
||||
// so any pkg.Error should be ignored when the build tag isn't set.
|
||||
} else if !mainBuild && strings.Contains(perr.Err, "is not in std") {
|
||||
// When we support multiple Go versions at once, some packages may only
|
||||
// exist in the newer version, so we fail to list them with the older.
|
||||
} else {
|
||||
if pkgErrors.Len() > 0 {
|
||||
pkgErrors.WriteString("\n")
|
||||
|
||||
Reference in New Issue
Block a user