brew: bump-formula-pr fails when attempting to sign commit
- Confirmed this is a problem with running a
brewcommand and notbrew installing or the post-install behaviour of one or more formulae? If it’s a formulae-specific problem please file this issue at the relevant tap e.g. for Homebrew/homebrew-core https://github.com/Homebrew/homebrew-core/issues/new - Ran
brew updateand retried your prior step? - Ran
brew doctor, fixed all issues and retried your prior step? - Ran
brew configandbrew doctorand included their output with your issue?
$ brew doctor
Your system is ready to brew.
To help us debug your issue please explain:
- What you were trying to do (and why) attempting to bump a formula with bump-formula-pr
- What happened (include command output) Error when it attempting to git-commit.
$ HOMEBREW_DEVELOPER=true brew bump-formula-pr --url=https://github.com/nodenv/node-build/archive/v2.6.20.tar.gz --sha256=af89b9eb0086324a78674d31e7d74e750d30ac8565b27058431b1b854b068b9a node-build
Already up-to-date.
==> replace "https://github.com/nodenv/node-build/archive/v2.6.19.tar.gz" with "https://github.com/nodenv/node-build/archive/v2.6.20.tar.gz"
==> replace "ed4b5aa3e5d6c474f7e53e9a78b6080bb7e57497ff1d2c67ddbc2700d0c5c2d0" with "af89b9eb0086324a78674d31e7d74e750d30ac8565b27058431b1b854b068b9a"
M Formula/node-build.rb
Switched to a new branch 'node-build-2.6.20'
error: gpg failed to sign the data
fatal: failed to write commit object
Error: Failure while executing: git commit --no-edit --verbose --message=node-build\ 2.6.20 -- /usr/local/Homebrew/Library/Taps/homebrew/homebrew-core/Formula/node-build.rb
- What you expected to happen expected it to commit and open a PR
- Step-by-step reproduction instructions (by running
brewcommands)
My git configuration has user.signingkey set and commit.gpgsign=true.
Failed on: HOMEBREW_DEVELOPER=true brew bump-formula-pr --url=https://github.com/nodenv/node-build/archive/v2.6.20.tar.gz --sha256=af89b9eb0086324a78674d31e7d74e750d30ac8565b27058431b1b854b068b9a node-build
The commit succeeded when executed manually (by just re-running the exact command that was echoed in the failure output: git commit --no-edit --verbose --message=node-build\ 2.6.20 -- /usr/local/Homebrew/Library/Taps/homebrew/homebrew-core/Formula/node-build.rb). So I’m presuming the issue is that the brew process is running under a different user so it doesn’t have access to gpg-agent, thus it’s unable to sign the commit. However, I’m not sure what the remedy should be here. (This isn’t the first issue I’ve encountered with homebrew respecting the user’s gitconfig, but then failing due to some configuration therein.)
Is there some configuration that other homebrew devs use? I assume I’m not the only one who has git configured to sign commits.
About this issue
- Original URL
- State: closed
- Created 7 years ago
- Comments: 27 (26 by maintainers)
Commits related to this issue
- bin/brew: allow `GPG_KEY` `GPG_TTY` is required for gpg-agent to identify which tty to prompt for the passphrase of user's GPG key. While user's GPG key have passphrase set, `HOMEBREW_NO_ENV_FILTERIN... — committed to tuzi3040/brew by tuzi3040 2 years ago
- bin/brew: allow `GPG_TTY` `GPG_TTY` is required for gpg-agent to identify which tty to prompt for the passphrase of user's GPG key. While user's GPG key have passphrase set, `HOMEBREW_NO_ENV_FILTERIN... — committed to tuzi3040/brew by tuzi3040 2 years ago
Oh good. You had me worried about your well being for a moment there.
Although I still can’t get this specific failure to reproduce if I
unset GPG_TTYlocally before running the command. What fun. I’ll wait for @jasonkarns to check it out before I poke around anymore but feel with some regret this is heading into create a VM territory 😆.That could well be it, to be fair. That’s quite a well-known piece of joy with GnuPG 😓.