Skip to content

Fixed macOS CI build broken by the Homebrew cache - #630

Merged
aalex merged 1 commit into
devfrom
fix-build
Sep 18, 2026
Merged

aalex merged 1 commit into
devfrom
fix-build

Conversation

@aalex

@aalex aalex commented Sep 18, 2026

Copy link
Copy Markdown
Member

Summary

The macOS job started failing with qmake: command not found as soon as the Homebrew cache was populated by an earlier green run.

Two things combined:

  • Restoring /opt/homebrew/Cellar/qt brings back Qt's files but not Homebrew's symlinks (/opt/homebrew/opt/qt, the bin/ entries), and the cache hit skipped brew install qt, which is what creates them.
  • brew --prefix qt prints /opt/homebrew/opt/qt even when Qt is not installed, so export PATH="$(brew --prefix qt)/bin:$PATH" silently pointed at a missing directory instead of failing.

Changes, macOS job only:

  • Cache only the downloaded bottles (~/Library/Caches/Homebrew/downloads), never the Cellar.
  • Always run brew install qt — a no-op when Qt is already installed, and the step that creates the symlinks the rest of the job relies on.
  • Export the Qt bin directory once through $GITHUB_PATH instead of repeating export PATH in every step.
  • Added a qmake --version check so a broken toolchain fails at install time with a clear message.
  • Dropped the manual Always cache brew step; actions/cache@v5 saves in its post-step.

The Windows and Ubuntu jobs are untouched.

Test plan

  • build-macos reaches Check Qt installation and prints a Qt version
  • build-macos configures, builds, and runs the tests
  • A second run on a warm cache still passes (this is the case that broke)
  • build-windows and build-ubuntu stay green

Restoring /opt/homebrew/Cellar/qt from the cache brought back Qt's files
but not Homebrew's symlinks, while the cache hit skipped `brew install
qt`. Since `brew --prefix qt` prints /opt/homebrew/opt/qt even when Qt is
not installed, the PATH silently pointed at a missing directory and qmake
was not found.

- Cache only the downloaded bottles, never the Cellar.
- Always run `brew install qt`; it is a no-op when Qt is present and it
  is what creates the symlinks the later steps rely on.
- Export the Qt bin directory once through $GITHUB_PATH.
- Fail early with an explicit `qmake --version` check.
@aalex aalex self-assigned this Sep 18, 2026
@aalex
aalex merged commit cc29e94 into dev Sep 18, 2026
3 checks passed
@aalex
aalex deleted the fix-build branch September 18, 2026 15:34
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant