Skip to content

CI brew style check fails for custom taps due to picking up gemspec files #20339

@PatTheMav

Description

@PatTheMav

brew doctor output

All steps passed!

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.5.13-26-gff4ee5d
ORIGIN: https://github.com/Homebrew/brew
HEAD: ff4ee5d0b5c214d67a15abbf46722bc375c5f137
Last commit: 13 hours ago
Branch: main
Core tap JSON: 30 Jul 20:33 UTC
HOMEBREW_PREFIX: /home/linuxbrew/.linuxbrew
HOMEBREW_CACHE: /home/runner/.cache/Homebrew
HOMEBREW_CASK_OPTS: []
HOMEBREW_CLEANUP_PERIODIC_FULL_DAYS: 3650
HOMEBREW_COLOR: set
HOMEBREW_CURL_PATH: /usr/bin/curl
HOMEBREW_DEVELOPER: set
HOMEBREW_FAIL_LOG_LINES: 150
HOMEBREW_GITHUB_API_TOKEN: set
HOMEBREW_GIT_EMAIL: [email protected]
HOMEBREW_GIT_NAME: BrewTestBot
HOMEBREW_GIT_PATH: /usr/bin/git
HOMEBREW_LOGS: /home/runner/work/homebrew-custom/homebrew-custom/logs
HOMEBREW_MAKE_JOBS: 4
HOMEBREW_NO_AUTO_UPDATE: set
HOMEBREW_NO_EMOJI: set
HOMEBREW_NO_ENV_HINTS: set
HOMEBREW_NO_INSTALLED_DEPENDENTS_CHECK: set
HOMEBREW_SORBET_RUNTIME: set
Homebrew Ruby: 3.4.5 => /home/linuxbrew/.linuxbrew/Homebrew/Library/Homebrew/vendor/portable-ruby/3.4.5/bin/ruby
CPU: quad-core 64-bit zen3
Clang: 14.0.0
Git: 2.50.1 => /usr/bin/git
Curl: 7.81.0 => /usr/bin/curl
Kernel: Linux 6.8.0-1031-azure x86_64 GNU/Linux
OS: Ubuntu 22.04.5 LTS (jammy)
Host glibc: 2.35
/usr/bin/gcc: 11.4.0
/usr/bin/ruby: 3.0.2
glibc: N/A
gcc@11: N/A
gcc: N/A
xorg: N/A

What were you trying to do (and why)?

I'm maintaining a custom tap on GitHub using the default workflows created by brew tap-new and created a pull request to update an existing formula in the tap.

This issue has been reported by other users as well and was first mentioned in a GitHub Discussion.

What happened (include all command output)?

The Run brew test-bot --only-tap-syntax step fails on Ubuntu (but not macOS) with the following message:

Taps/<user>/homebrew-<tap_name>/home/.cache/gem/specs/index.rubygems.org%443/quick/Marshal.4.8/bundler-2.6.8.gemspec:1:1: F: Lint/Syntax: Invalid byte sequence in utf-8.

Adding an explicit brew style job to the workflow with verbose and debug logging enabled showed that the rubygems' gemspec cache directory somehow ends up in the tap directory and is then picked up for checks by rubocop possibly due to #17482.

What did you expect to happen?

That the Run brew test-bot --only-tap-syntax succeeds because all formulas have been locally checked with brew style already.

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

1. Set up a custom tap per the [official documentation](https://docs.brew.sh/How-to-Create-and-Maintain-a-Tap)
2. Push the main branch to GitHub or open a pull request with changes targeting the main branch
3. Observe the `Run brew test-bot --only-tap-syntax` to fail for the Ubuntu-based Job.

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions