Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Brew audit --git fails if taps default branch is not master #7712

Closed
3 tasks done
PurpleBooth opened this issue Jun 9, 2020 · 0 comments · Fixed by #7713
Closed
3 tasks done

Brew audit --git fails if taps default branch is not master #7712

PurpleBooth opened this issue Jun 9, 2020 · 0 comments · Fixed by #7713
Labels
outdated PR was locked due to age

Comments

@PurpleBooth
Copy link
Contributor

PurpleBooth commented Jun 9, 2020

Please note we will close your issue without comment if you delete, do not read or do not fill out the issue checklist below and provide ALL the requested information. If you repeatedly fail to use the issue template, we will block you from ever submitting issues to Homebrew again.

  • ran brew update and can still reproduce the problem?
  • ran brew doctor, fixed all issues and can still reproduce the problem?
  • ran brew config and brew doctor and included their output with your issue?

What you were trying to do (and why)

I have a personal tap at PurpleBooth/homebrew-repo. I recently became uncomfortable using the word "master", so I changed the default branch to "main". It worked fine until a recent change to how audit works (which is itself called by brew test-bot, which is what's blocking me from building bottles in a sensible way)

I believe this is related to this line, #7684 and Homebrew/homebrew-test-bot#422

What happened (include command output)

Command output

$ brew audit --git purplebooth/repo/readable-name-generator --online
Error: undefined method +' for nil:NilClass Please report this issue: https://docs.brew.sh/Troubleshooting /usr/local/Homebrew/Library/Homebrew/dev-cmd/audit.rb:789:in audit_revision_and_version_scheme'
/usr/local/Homebrew/Library/Homebrew/dev-cmd/audit.rb:931:in block in audit' /usr/local/Homebrew/Library/Homebrew/dev-cmd/audit.rb:924:in each'
/usr/local/Homebrew/Library/Homebrew/dev-cmd/audit.rb:924:in audit' /usr/local/Homebrew/Library/Homebrew/dev-cmd/audit.rb:128:in block in audit'
/usr/local/Homebrew/Library/Homebrew/dev-cmd/audit.rb:114:in each' /usr/local/Homebrew/Library/Homebrew/dev-cmd/audit.rb:114:in audit'
/usr/local/Homebrew/Library/Homebrew/brew.rb:110:in `

'

What you expected to happen

The audit to pass, or flag a problem with my configuration. I believe it would pass.

Ideally, the branch would be detected, rather than assuming master.

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

The exact thing I did was this. I might resolve this example because I like having binaries built

brew update
brew tap PurpleBooth/repo
brew audit --git purplebooth/repo/readable-name-generator --online

I've left a broken tap at

brew tap PurpleBooth/broken
brew audit --git purplebooth/broken/game-of-life

To create the git repository

git init .
git checkout -b main
git branch -d master
mkdir Formula
## The formula isn't important, it's just something to audit
cat > Formula/game-of-life.rb <<EOF
class GameOfLife < Formula
  desc "PurpleBooth's implementation of Conway's Game of life"
  homepage "https://github.com/PurpleBooth/game-of-life"
  url "https://github.com/PurpleBooth/game-of-life/archive/refs/tags/v1.31.0.tar.gz"
  sha256 "c05f34955bb193c84a28b6ce6396e53af7fe288189991eb2b5248ddce909ef41"

  depends_on "rust" => :build

  def install
    system "cargo", "install", "--locked", "--root", prefix, "--path", "."
  end

  test do
    system "#{bin}/game-of-life", "-h"
    system "#{bin}/game-of-life", "-V"
  end
end
EOF
git commit -am "Demonstration"

As a workaround you can return the default branch to master and it audit passes.

Output of brew config and brew doctor commands

$ brew config
HOMEBREW_VERSION: 2.3.0-71-g3a7213c
ORIGIN: https://github.com/Homebrew/brew
HEAD: 3a7213c2553da5a9022f82a746214ea255202ed0
Last commit: 6 hours ago
Core tap ORIGIN: https://github.com/Homebrew/homebrew-core
Core tap HEAD: 27684529432a5b5d7a86c7a0daf8f2a53de89412
Core tap last commit: 21 minutes ago
HOMEBREW_PREFIX: /usr/local
HOMEBREW_EDITOR: vim
HOMEBREW_MAKE_JOBS: 8
CPU: octa-core 64-bit haswell
Homebrew Ruby: 2.6.3 => /System/Library/Frameworks/Ruby.framework/Versions/2.6/usr/bin/ruby
Clang: 11.0 build 1103
Git: 2.27.0 => /usr/local/bin/git
Curl: 7.64.1 => /usr/bin/curl
Java: 14.0.1, 1.8.0_252
macOS: 10.15.4-x86_64
CLT: 11.5.0.0.1.1588476445
Xcode: N/A


$ brew doctor
Please note that these warnings are just used to help the Homebrew maintainers
with debugging if you file an issue. If everything you use Homebrew for is
working fine: please don't worry or file an issue; just ignore this. Thanks!

Warning: The filesystem on /System/Volumes/Data appears to be case-sensitive.
The default macOS filesystem is case-insensitive. Please report any apparent problems.

Warning: "config" scripts exist outside your system or Homebrew directories.
`./configure` scripts often look for *-config scripts to determine if
software packages are installed, and which additional flags to use when
compiling and linking.

Having additional scripts in your path can confuse software installed via
Homebrew if the config script overrides a system or Homebrew-provided
script of the same name. We found the following "config" scripts:
  /Users/billie/.cargo/bin/cargo-install-update-config
@BrewTestBot BrewTestBot added the outdated PR was locked due to age label Dec 11, 2020
@Homebrew Homebrew locked as resolved and limited conversation to collaborators Dec 11, 2020
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
outdated PR was locked due to age
Projects
None yet
Development

Successfully merging a pull request may close this issue.

2 participants