{"record":{"id":"f9de56cb7b409527","repo":"golangci/golangci-lint","slug":"build-process-w","errorCode":null,"errorMessage":"build process: %w","messagePattern":"build process: %w","errorType":"exception","errorClass":null,"httpStatus":null,"severity":"error","filePath":"pkg/commands/custom.go","lineNumber":103,"sourceCode":"func (c *customCommand) runE(cmd *cobra.Command, _ []string) error {\n\ttmp, err := os.MkdirTemp(os.TempDir(), \"custom-gcl\")\n\tif err != nil {\n\t\treturn fmt.Errorf(\"create temporary directory: %w\", err)\n\t}\n\n\tdefer func() {\n\t\tif os.Getenv(envKeepTempFiles) != \"\" {\n\t\t\tlog.Printf(\"WARN: The env var %s has been detected: the temporary directory is preserved: %s\", envKeepTempFiles, tmp)\n\n\t\t\treturn\n\t\t}\n\n\t\t_ = os.RemoveAll(tmp)\n\t}()\n\n\terr = internal.NewBuilder(c.log, c.cfg, tmp).Build(cmd.Context())\n\tif err != nil {\n\t\treturn fmt.Errorf(\"build process: %w\", err)\n\t}\n\n\treturn nil\n}\n","sourceCodeStart":85,"sourceCodeEnd":108,"githubUrl":"https://github.com/golangci/golangci-lint/blob/ed7a235d2d771152056fdc142a9855567c5796a9/pkg/commands/custom.go#L85-L108","documentation":"The custom binary builder (runE of the 'custom' command) clones golangci-lint and compiles it with plugins. If internal.NewBuilder(...).Build() returns any error, it is wrapped as \"build process: %w\". It means one of the build steps (clone, plugin file update, go.mod edits, go build) failed while creating the custom golangci-lint binary.","triggerScenarios":"Running `golangci-lint custom` where Builder.Build fails: git clone of the target golangci-lint version fails, updatePluginsFile or addToGoMod fails, or the final `go build` of the custom binary errors.","commonSituations":"Bad/unknown golangci-lint version in .custom-gcl.yml; no network access or corporate proxy blocking GitHub; invalid plugin repo URLs; Go toolchain missing or too old for the target version; build flags referencing nonexistent packages.","solutions":["Read the wrapped cause at the end of the message and fix that specific step (clone, plugin file, go.mod, or compile error).","Check network/proxy settings and that the golangci-lint version specified exists and can be cloned.","Verify each plugin entry in .custom-gcl.yml points to a valid module path/version and the Go toolchain is installed and up to date.","Re-run with debug logging to see which build phase failed."],"exampleFix":"// before\nversion: v1.61.0 // typo/nonexistent tag\n// after\nversion: v1.61.0 // verify tag exists: git ls-remote https://github.com/golangci/golangci-lint vX.Y.Z","handlingStrategy":"validation","validationCode":"if _, err := exec.LookPath(\"git\"); err != nil { return fmt.Errorf(\"git required: %w\", err) }\nif _, err := exec.LookPath(\"go\"); err != nil { return fmt.Errorf(\"go toolchain required: %w\", err) }\n// verify version exists before invoking the custom build\nif err := exec.Command(\"git\", \"ls-remote\", \"--exit-code\",\n  \"https://github.com/golangci/golangci-lint\", \"refs/tags/\"+version).Run(); err != nil {\n  return fmt.Errorf(\"version %s does not exist\", version)\n}","typeGuard":null,"tryCatchPattern":"if err := customCmd.Run(); err != nil {\n  var buildErr *BuildError\n  if errors.As(err, &buildErr) { log.Fatalf(\"custom build failed: %v\", errors.Unwrap(err)) }\n}","preventionTips":["Pin an existing golangci-lint tag in .custom-gcl.yml and verify it with git ls-remote.","Ensure git and a recent Go toolchain are installed in your build/CI environment.","Set HTTP(S)_PROXY/HTTPS_PROXY and GOPROXY correctly behind corporate firewalls.","Run with debug logging the first time to catch which build phase fails."],"tags":["golangci-lint","custom-binary","build"],"backgroundTag":"custom-binary-build-failed","analyzedSha":"ed7a235d2d771152056fdc142a9855567c5796a9","analyzedAt":"2026-09-02T18:47:33.865Z","contentChangedAt":null,"schemaVersion":2},"datasetVersion":"2026-09-08T10:18:20.063Z"}