This repository was archived by the owner on Dec 25, 2025. It is now read-only.
Fix macOS CI: Add ffmpeg@7, use temporary tap for mingw installation, make debug step resilient #23
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
Problem
The macOS CI job was failing due to three issues:
Homebrew tap requirement: Homebrew refuses to install a raw formula file with the error
"Homebrew requires formulae to be in a tap, rejecting: mingw-w64.rb". The existing workflow attempted to download and installmingw-w64.rbdirectly, which is no longer supported.Missing ffmpeg@7 dependency: The workflow tried to list files under
$(brew --prefix ffmpeg@7)/libin the debug step, but ffmpeg@7 was not installed, causing the step to fail.Debug step failures: The "Echo Libs [DEBUG]" step would fail if any package was missing, providing no debugging information for the workflow.
Reference: https://github.com/MythicApp/Engine/actions/runs/18499260690/job/52711383453#logs
Solution
1. Added ffmpeg@7 to Required Packages
Added
"ffmpeg@7"to theREQUIRED_PACKAGESarray to ensure it's installed and its prefix exists when referenced.2. Replaced Direct Formula Installation with Temporary Tap
Replaced the failing direct formula installation with a robust temporary tap approach:
This approach:
brew tap-newFormula/directory--build-from-sourceif bottles are incompatible3. Made Debug Step Resilient to Missing Packages
Updated the debug step to check if packages are installed before attempting to list their directories:
The step now:
lscommands withbrew ls --versionschecks|| trueto prevent failuresImpact
These changes ensure the macOS CI workflow will:
The workflow maintains backward compatibility by keeping
continue-on-error: trueon the mingw installation step, allowing the build to proceed even if mingw installation fails.Original prompt
Problem summary:
The macOS CI job fails when installing a legacy mingw-w64 formula because Homebrew refuses to install a raw formula file (error: "Homebrew requires formulae to be in a tap, rejecting: mingw-w64.rb"). Later the workflow also attempts to list files under $(brew --prefix ffmpeg@7)/lib which fails when ffmpeg@7 is not installed. The failing run: https://github.com/MythicApp/Engine/actions/runs/18499260690/job/52711383453#logs (job ref a8fa1bb).
Requested change:
Update .github/workflows/build.yml (at ref a8fa1bb) to:
Patch (apply to .github/workflows/build.yml at ref a8fa1bb):
Replace the REQUIRED_PACKAGES block and three steps as follows.
--- begin replacement
REQUIRED_PACKAGES=(
# Build Dependencies
"bison"
"pkg-config"
# "gcenx/wine/cx-llvm" # deprecated; using llvm-cx from macports instead
)
... (Install Homebrew Packages step unchanged) ...
name: Install mingw
continue-on-error: true
run: |
As of mingw-w64 12, brew uses UCRT instead of MSVCRT
Wine will fail to build with UCRT, so we must rollback.
curl -L https://raw.githubusercontent.com/Homebrew/homebrew-core/31209a399a7b40bf2cd3abd7aee2715547ccd5bd/Formula/m/mingw-w64.rb > mingw-w64.rb && brew install mingw-w64.rb
rm mingw-w64.rb
REPLACE WITH:
name: Install mingw (install legacy formula from a temporary tap)
continue-on-error: true
run: |
set -euo pipefail
FORMULA_URL="https://raw.githubusercontent.com/Homebrew/homebrew-core/31209a399a7b40bf2cd3abd7aee2715547ccd5bd/Formula/m/mingw-w64.rb"
TMP_FORMULA="/tmp/mingw-w64.rb"
curl -fL "$FORMULA_URL" -o "$TMP_FORMULA"
TAP_USER="${GITHUB_ACTOR:-MythicApp}"
TAP_REPO="homebrew-old-formula"
TAP_FULL="$TAP_USER/$TAP_REPO"
brew tap-new "$TAP_FULL"
TAP_DIR="$(brew --repo "$TAP_FULL")"
mkdir -p "$TAP_DIR/Formula"
mv "$TMP_FORMULA" "$TAP_DIR/Formula/mingw-w64.rb"
pushd "$TAP_DIR" >/dev/null
git add -A || true
git commit -m "Add legacy mingw-w64 formula" || true
popd >/dev/null
brew update || true
if ! brew install "$TAP_FULL/mingw-w64"; then
echo "Binary install failed; attempting build-from-source"
brew install --build-from-source "$TAP_FULL/mingw-w64"
fi
optional: cleanup tap after install
brew untap "$TAP_FULL" || true
name: Echo Libs [DEBUG]
run: |
echo "Brew Libs"
ls $(brew --prefix)/lib
echo "FFmpeg Libs"
ls $(brew --prefix ffmpeg@7)/lib
echo "GStreamer Libs"
ls $(brew --prefix gstreamer)/lib/gstreamer-1.0
REPLACE WITH:
name: Echo Libs [DEBUG]
run: |
set -euo pipefail
echo "Brew Libs"
ls "$(brew --prefix)/lib" || true
echo "FFmpeg Libs"
if brew ls --versions ffmpeg@7 >/dev/null 2>&1; then
ls "$(brew --prefix ffmpeg@7)/lib" || true
else
echo "ffmpeg@7 not installed"
fi
echo "GStreamer Libs"
if brew ls --versions gstreamer >/dev/null 2>&1; then
ls "$(brew --prefix gstreamer)/lib/gstreamer-1.0" || true
else
echo "gstreamer not installed"
fi
--- end replacement
Why this change:
Notes:
Please confirm you want me to open the PR with these changes and which targ...
This pull request was created as a result of the following prompt from Copilot chat.
💡 You can make Copilot smarter by setting up custom instructions, customizing its development environment and configuring Model Context Protocol (MCP) servers. Learn more Copilot coding agent tips in the docs.