Skip to content

go build reports "Success" when go exits non-zero on a go.work pattern error #2203

Closed

Description

@mehrdad-tat

Summary

rtk prints Go build: Success (and exits 0) when the underlying go build
actually fails with exit 1 on a Go workspace pattern error. Plain compile
errors are surfaced correctly, but this command/pattern error class is masked —
which can let a broken build pass local checks.

Reproduction (minimal)

mkdir -p /tmp/rtkbug/mod && cd /tmp/rtkbug
printf 'go 1.24\n\nuse (\n\t./mod\n)\n' > go.work     # workspace root, NO root go.mod
printf 'module rtkbug/mod\ngo 1.24\n' > mod/go.mod
printf 'package main\nfunc main() {}\n' > mod/main.go

"$(go env GOROOT)/bin/go" build ./...   # real go: exit 1, "directory prefix . does not contain modules listed in go.work"
rtk go build ./...                       # rtk: "Go build: Success", exit 0   <-- WRONG

Expected

rtk go build reflects the real non-zero exit / surfaces the go error (or at least does not print Success).

Actual

Prints Go build: Success with exit 0, masking the failure. (rtk proxy go build ./... shows the real error, so the summarization layer infers success incorrectly.)

Notes

Compile errors (imported and not used, etc.) ARE shown correctly — masking appears specific to go command/pattern errors emitted as pattern ...: ... on stderr.

Environment

  • rtk: rtk 0.40.0
  • go: go version go1.26.3-X:nodwarf5 linux/amd64 · OS: linux/amd64

Activity

  1. pszymkowiak commented on Jun 1, 2026

    @pszymkowiak
    Collaborator

    wshm · Automated triage by AI

    🔍 Automated Triage

    🐛 Category bug
    🟠 Priority high
    🎯 Confidence 97%

    Summary

    rtk go build reports Success and exits 0 when go exits non-zero on workspace pattern errors; the summarization layer misclassifies 'pattern ...: ...' stderr output as non-fatal, masking real build failures.

    This looks like a simple fix that could be auto-resolved. Repo maintainers can use /wshm fix to attempt it.


    Triaged automatically by wshm · This is an automated analysis, not a human review.

  2. added a commit that references this issue on Jun 2, 2026
    05bf9c3
  3. mikeangstadt commented on Jun 2, 2026

    @mikeangstadt

    This appears to be already fixed in the current develop branch. Go build pattern error was fixed by commit f69ad6e (merged to develop via PR #2188). Please verify on latest develop and close if confirmed.

  4. KuSh commented on Sep 13, 2026

    @KuSh
    Collaborator

    This was fixed by #2188 and shipped in v0.42.3. On the current code, rtk go build ./... on a go.work pattern error prints the pattern ./...: directory prefix ... message and exits 1, matching plain go. If you still see a masked failure on the latest version, comment here and we will reopen.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

No one assigned

    Labels

    Type

    No type

    Projects

    No projects

      Milestone

      No milestone

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions