brew audit falsely reports PHP tap aliases as incorrect

Created on 18 May 2017  Â·  4Comments  Â·  Source: Homebrew/brew

We've recently been seeing these messages in the jenkins logs for the PHP tap

https://jenkins.brew.sh/job/Homebrew%20PHP%20Pull%20Requests/63/version=sierra/console

This also happends locally on the machine if you make modifications to the Formulas that have aliases. It does not seem to affect formulas in core when trying to do an audit for some reason.

This seems to be related to the commit https://github.com/Homebrew/brew/commit/b14f1572b7ee3b04593bde5d52e14a36aea8d701
by @MikeMcQuaid since reverting it will remove the erroneous alias error.

➜  dev-cmd git:(master) ✗ brew config
HOMEBREW_VERSION: 1.2.1-12-g0977b4a17d-dirty
ORIGIN: https://github.com/Homebrew/brew.git
HEAD: 0977b4a17d92853a952bcba643cfd3dac21db944
Last commit: 2 hours ago
Core tap ORIGIN: https://github.com/Homebrew/homebrew-core
Core tap HEAD: b39cdd5b5f0acda2aa9ca2a27af4e1772b9d4611
Core tap last commit: 3 hours ago
HOMEBREW_PREFIX: /usr/local
HOMEBREW_REPOSITORY: /usr/local/Homebrew
HOMEBREW_CELLAR: /usr/local/Cellar
HOMEBREW_BOTTLE_DOMAIN: https://homebrew.bintray.com
CPU: quad-core 64-bit haswell
Homebrew Ruby: 2.0.0-p648
Clang: 8.1 build 802
Git: 2.13.0 => /usr/local/bin/git
Perl: /usr/local/bin/perl => /usr/local/Cellar/perl/5.24.1/bin/perl
Python: /usr/local/bin/python => /usr/local/Cellar/python/2.7.13/Frameworks/Python.framework/Versions/2.7/bin/python2.7
Ruby: /usr/local/bin/ruby => /usr/local/Cellar/ruby/2.4.1_1/bin/ruby
Java: 1.8.0_102, 1.8.0_77, 1.8.0_60
macOS: 10.12.5-x86_64
Xcode: 8.3.2
CLT: 8.3.2.0.1.1492020469
X11: N/A
➜  dev-cmd git:(master) brew audit --strict composer
homebrew/php/composer:
  * W: 41: col 5: Useless assignment to variable - `caveats`.
  * Formula has other versions so create a versioned alias:
      cd /usr/local/Homebrew/Library/Taps/homebrew/homebrew-php/Aliases
      ln -s ../Formula/composer.rb [email protected]
  * Formula has invalid versioned aliases:
      homebrew/php/[email protected]
Error: 3 problems in 1 formula
➜  dev-cmd git:(master) git revert --no-commit b14f1572b7ee3b04593bde5d52e14a36aea8d701
➜  dev-cmd git:(master) ✗ brew audit --strict composer
homebrew/php/composer:
  * W: 41: col 5: Useless assignment to variable - `caveats`.
Error: 1 problem in 1 formula

You can also see here https://gist.github.com/javian/faabc6739b582bf838d5bb0a2fcd118b that even if you follow the instructions the error still occurs. I'm assuming this is a bug =)

Most helpful comment

@javian I'm sorry, I meant to mention you on the PR I created, but it seems I forgot to. I created https://github.com/Homebrew/brew/pull/2644 to address this bug after you mentioned it on Slack. I tested the PR against the composer formula, and it should fix the bug within the audit code itself that was producing the false positives.

If you can, testing the PR yourself would quite helpful.

All 4 comments

Could this also be causing this ? https://github.com/Homebrew/homebrew-php/issues/4167

@javian I'm sorry, I meant to mention you on the PR I created, but it seems I forgot to. I created https://github.com/Homebrew/brew/pull/2644 to address this bug after you mentioned it on Slack. I tested the PR against the composer formula, and it should fix the bug within the audit code itself that was producing the false positives.

If you can, testing the PR yourself would quite helpful.

Thanks @JCount ! I won't be able to test it until tonight so if it gets merged before then I will just provide a thank you somewhere down the line =)

Seems to solve the issue for me at least when applying it locally.

Was this page helpful?
0 / 5 - 0 ratings

Related issues

Rotonen picture Rotonen  Â·  4Comments

hktalent picture hktalent  Â·  4Comments

VagelisD picture VagelisD  Â·  3Comments

mislav picture mislav  Â·  3Comments

fxcoudert picture fxcoudert  Â·  3Comments