{"record":{"id":"ed1d888b6a13601b","repo":"golang/go","slug":"finding-s-w","errorCode":null,"errorMessage":"finding %s: %w","messagePattern":"finding (.+?): %w","errorType":"exception","errorClass":null,"httpStatus":null,"severity":"error","filePath":"src/cmd/go/internal/work/exec.go","lineNumber":1425,"sourceCode":"\tc := cache.Default()\n\tlist, _, err := cache.GetBytes(c, cache.Subkey(a.actionID, \"srcfiles\"))\n\tif err != nil {\n\t\treturn fmt.Errorf(\"reading srcfiles list: %w\", err)\n\t}\n\tvar gofiles []string\n\tfor name := range strings.SplitSeq(string(list), \"\\n\") {\n\t\tif name == \"\" { // end of list\n\t\t\tcontinue\n\t\t} else if !strings.HasSuffix(name, \".go\") {\n\t\t\tcontinue\n\t\t}\n\t\tif strings.HasPrefix(name, \"./\") {\n\t\t\tgofiles = append(gofiles, name[len(\"./\"):])\n\t\t\tcontinue\n\t\t}\n\t\tfile, err := b.findCachedObjdirFile(a, c, name)\n\t\tif err != nil {\n\t\t\treturn fmt.Errorf(\"finding %s: %w\", name, err)\n\t\t}\n\t\tgofiles = append(gofiles, file)\n\t}\n\ta.Package.CompiledGoFiles = gofiles\n\treturn nil\n}\n\n// vetConfig is the configuration passed to vet describing a single package.\ntype vetConfig struct {\n\tID           string   // package ID (example: \"fmt [fmt.test]\")\n\tCompiler     string   // compiler name (gc, gccgo)\n\tDir          string   // directory containing package\n\tImportPath   string   // canonical import path (\"package path\")\n\tGoFiles      []string // absolute paths to package source files\n\tNonGoFiles   []string // absolute paths to package non-Go files\n\tIgnoredFiles []string // absolute paths to ignored source files\n\n\tModule      *analysis.Module  // module information, if any","sourceCodeStart":1407,"sourceCodeEnd":1443,"githubUrl":"https://github.com/golang/go/blob/b6b368adc57c96c3151d224d172029f233ead2c3/src/cmd/go/internal/work/exec.go#L1407-L1443","documentation":"While reconstructing the compiled-Go-file list from cache, loadCachedCompiledGoFiles calls findCachedObjdirFile for each manifest entry that is not a local (./) path. If locating that file in the cache fails, this wraps the underlying error with the file's logical name. It means the srcfiles manifest references a file the cache cannot supply.","triggerScenarios":"Fires inside the `for name := range strings.SplitSeq(string(list), \"\\n\")` loop of loadCachedCompiledGoFiles when b.findCachedObjdirFile(a, c, name) returns an error for a generated (non-local) file such as a _cgo_*.go artifact.","commonSituations":"A srcfiles manifest pointing at a file missing from the cache due to partial writes, eviction, or corruption; common with cgo packages on flaky cache storage.","solutions":["Run `go clean -cache` and rebuild","Check for concurrent builds or a cache directory on NFS/FUSE","Verify free disk space on the cache partition"],"exampleFix":"// before\ngo build ./...\n// after\ngo clean -cache && go build ./...","handlingStrategy":"retry","validationCode":null,"typeGuard":null,"tryCatchPattern":"// On a missing cached objdir file, clean and retry\nif bytes.Contains(out, []byte(\"finding\")) && bytes.Contains(out, []byte(\": \")) {\n    exec.Command(\"go\", \"clean\", \"-cache\").Run()\n    out, err = cmd.CombinedOutput()\n}","preventionTips":["Keep GOCACHE on reliable local storage","Avoid concurrent builds sharing one cache","Ensure cgo toolchain is stable so generated artifacts are reproducible"],"tags":["go-toolchain","build-cache","io","cgo"],"analyzedSha":"b6b368adc57c96c3151d224d172029f233ead2c3","analyzedAt":"2026-08-12T00:22:02.250Z","schemaVersion":2},"datasetVersion":"2026-08-12T06:17:24.410Z"}