Skip to content

[brew bundle] Missing Go packages with custom GOPATH #20863

@LangLangBart

Description

@LangLangBart

brew doctor output

Your system is ready to brew.

Verification

  • I ran brew update twice and am still able to reproduce my issue.
  • My "brew doctor output" above says Your system is ready to brew or a definitely unrelated Tier message.
  • This issue's title and/or description do not reference a single formula e.g. brew install wget. If they do, open an issue at https://github.com/Homebrew/homebrew-core/issues/new/choose instead.

brew config output

HOMEBREW_VERSION: 4.6.16-110-gc28b3bc
ORIGIN: https://github.com/Homebrew/brew
HEAD: c28b3bc21d8b850dea763a6cda1e958cba828c6b
Last commit: 7 hours ago
Branch: main
Core tap JSON: 12 Oct 03:03 UTC
Core cask tap JSON: 12 Oct 03:03 UTC
HOMEBREW_PREFIX: /opt/homebrew
HOMEBREW_CASK_OPTS: ["--no-quarantine"]
HOMEBREW_COLOR: set
HOMEBREW_EDITOR: codium
HOMEBREW_FORBID_PACKAGES_FROM_PATHS: set
HOMEBREW_FORCE_BREWED_CURL: set
HOMEBREW_MAKE_JOBS: 10
HOMEBREW_NO_AUTO_UPDATE: set
HOMEBREW_NO_ENV_HINTS: set
HOMEBREW_SORBET_RUNTIME: set
Homebrew Ruby: 3.4.5 => /opt/homebrew/Library/Homebrew/vendor/portable-ruby/3.4.5/bin/ruby
CPU: deca-core 64-bit arm_firestorm_icestorm
Clang: 17.0.0 build 1700
Git: 2.51.0 => /opt/homebrew/bin/git
Curl: 8.16.0 => /opt/homebrew/opt/curl/bin/curl
macOS: 15.7.1-arm64
CLT: 26.0.0.0.1.1757719676
Xcode: 26.0.1
Rosetta 2: false

What were you trying to do (and why)?

Support for installing go packages in Brewfile was added with #20798


When I try to add my existing Go packages to my Brewfile, nothing happens.

go version
# go version go1.25.2 darwin/arm64

print -D $GOPATH
# ~/.go

ls -1 $GOPATH/bin
# asciigraph

brew bundle dump --go --file /dev/stdout

I believe the issue was that I set my GOPATH to ~/.go (notice the leading dot). After unsetting GOPATH and reinstalling the Go package, brew bundle detects it correctly.

The default for GOPATH is ~/go.

What happened (include all command output)?

The Go package is not being added to my Brewfile.

What did you expect to happen?

The Go package is correctly saved in my Brewfile.

Step-by-step reproduction instructions (by running brew commands)

Set the GOPATH environment variable in your .zshrc to something other than ~/go.


export GOPATH="$HOME/.go"


Install a go package, e.g. [asciigraph](https://github.com/guptarohit/asciigraph)


go install github.com/guptarohit/asciigraph/cmd/asciigraph@latest


Verify it is installed 


ls -1 $GOPATH/bin


Try to save the go package to the Brewfile, notice u get nothing.


brew bundle dump --go --file /dev/stdout

Metadata

Metadata

Assignees

Labels

No labels
No labels

Type

Projects

No projects

Milestone

No milestone

Relationships

None yet

Development

No branches or pull requests

Issue actions