[pull] master from golang:master - #203
Merged
Merged
Conversation
…ailure
When "go test" is applied to multiple packages, it runs cmd/vet
without -json (in contrast to "go vet"). If a package has diagnostics,
the vet tool prints them to stderr and exits nonzero.
Vet actions in the build graph set IgnoreFail so that upstream
diagnostics do not suppress vetting and testing of downstream
packages. However, when sh.run returns an error, Builder.vet returns
immediately without recording a.built.
Previously this was benign because unitchecker imported types from the
compiler's export data (cfg.PackageFile), treating missing .vetx
entries in cfg.PackageVetx as merely lacking analyzer facts. However,
with unitchecker transitioning to doing its own type export through
.vetx files, a missing .vetx file causes downstream typechecking to
fail entirely ("no package vetx file for ..."), causing downstream
test runs to fail with "[build failed]".
This change ensures that if the vet tool exited non-zero but nonetheless
successfully produced its output file (vcfg.VetxOutput), a.built is still
recorded in memory so that downstream actions in the same build graph
can locate the dependency's types and facts.
To preserve cache integrity:
- The .vetx file is only written to the persistent cache (cache.Default)
when runErr == nil.
- runErr is still returned, ensuring that the failing package is still
reported as a failure and its own test binary is not run.
Updates #81188
Change-Id: I26d36c0d1874dc1f78162cc84b6eeebe513b643d
Reviewed-on: https://go-review.googlesource.com/c/go/+/827884
LUCI-TryBot-Result: golang-scoped@luci-project-accounts.iam.gserviceaccount.com <golang-scoped@luci-project-accounts.iam.gserviceaccount.com>
Reviewed-by: Michael Matloob <matloob@google.com>
Auto-Submit: Alan Donovan <adonovan@google.com>
Reviewed-by: Michael Matloob <matloob@golang.org>
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to subscribe to this conversation on GitHub.
Already have an account?
Sign in.
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
See Commits and Changes for more details.
Created by
pull[bot] (v2.0.0-alpha.4)
Can you help keep this open source service alive? 💖 Please sponsor : )