Thanks to visit codestin.com
Credit goes to github.com

Skip to content
This repository was archived by the owner on Dec 25, 2025. It is now read-only.

Conversation

Copy link

Copilot AI commented Oct 17, 2025

Problem

The macOS CI job was failing due to three issues:

  1. 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 install mingw-w64.rb directly, which is no longer supported.

  2. Missing ffmpeg@7 dependency: The workflow tried to list files under $(brew --prefix ffmpeg@7)/lib in the debug step, but ffmpeg@7 was not installed, causing the step to fail.

  3. 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 the REQUIRED_PACKAGES array to ensure it's installed and its prefix exists when referenced.

REQUIRED_PACKAGES=(
    # ... existing packages ...
    "winetricks"
    "ffmpeg@7"  # Added
)

2. Replaced Direct Formula Installation with Temporary Tap

Replaced the failing direct formula installation with a robust temporary tap approach:

- name: Install mingw (install legacy formula from a temporary tap)
  continue-on-error: true
  run: |
    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

This approach:

  • Creates a temporary local tap using brew tap-new
  • Places the legacy formula in the tap's Formula/ directory
  • Commits it to satisfy Homebrew's tap requirement
  • Attempts binary installation first, with automatic fallback to --build-from-source if bottles are incompatible

3. Made Debug Step Resilient to Missing Packages

Updated the debug step to check if packages are installed before attempting to list their directories:

- name: Echo Libs [DEBUG]
  run: |
    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

The step now:

  • Guards ls commands with brew ls --versions checks
  • Uses || true to prevent failures
  • Prints informative messages when packages are absent
  • Properly quotes command substitutions to handle paths with spaces

Impact

These changes ensure the macOS CI workflow will:

  • ✅ Successfully install the legacy mingw-w64 formula (fixes "must be in a tap" error)
  • ✅ Not fail when optional packages are missing
  • ✅ Provide useful debugging information even when packages are absent
  • ✅ Handle binary bottle incompatibility gracefully with automatic source builds

The workflow maintains backward compatibility by keeping continue-on-error: true on 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:

  1. Add ffmpeg@7 to the REQUIRED_PACKAGES array so the formula prefix exists when referenced.
  2. Replace the existing "Install mingw" step which downloads and installs mingw-w64.rb directly with a robust temporary tap approach that:
    • downloads the legacy formula to a temp file
    • creates a local tap via brew tap-new
    • moves the formula into the tap's Formula/ directory and commits it
    • installs the formula from the tap, falling back to --build-from-source if binary bottles are incompatible
    • (optional) untaps the temporary tap
  3. Make the Echo Libs [DEBUG] step resilient to missing packages by guarding ls calls with brew ls --versions checks and not failing the step if a package is absent.

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

# Dependencies
"freetype"
"gettext"
"gnutls"
"gstreamer"
"sdl2"
"molten-vk"
"winetricks"
"ffmpeg@7"

)

... (Install Homebrew Packages step unchanged) ...

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:

  • Homebrew requires formulae to be in a tap. Creating a temporary tap and installing from it prevents the "FormulaUnavailableError" and the "must be in a tap" rejection.
  • Adding ffmpeg@7 ensures the subsequent debug step doesn't fail when trying to list its lib directory.
  • Guarding ls with brew checks prevents the debug step from exiting non-zero if optional packages are not installed.

Notes:

  • The step keeps continue-on-error: true for parity with the existing workflow. If you want the workflow to fail when mingw cannot be installed, remove continue-on-error for that step.
  • If you want me to push the branch name or use a specific base branch for the PR, tell me the target branch name. Otherwise I will create the PR against the repository's default branch.
  • File being changed: .github/workflows/build.yml (ref a8fa1bb)

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.

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:

  1. Add ffmpeg@7 to the REQUIRED_PACKAGES array so the formula prefix exists when referenced.
  2. Replace the existing "Install mingw" step which downloads and installs mingw-w64.rb directly with a robust temporary tap approach that:
    • downloads the legacy formula to a temp file
    • creates a local tap via brew tap-new
    • moves the formula into the tap's Formula/ directory and commits it
    • installs the formula from the tap, falling back to --build-from-source if binary bottles are incompatible
    • (optional) untaps the temporary tap
  3. Make the Echo Libs [DEBUG] step resilient to missing packages by guarding ls calls with brew ls --versions checks and not failing the step if a package is absent.

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

# Dependencies
"freetype"
"gettext"
"gnutls"
"gstreamer"
"sdl2"
"molten-vk"
"winetricks"
"ffmpeg@7"

)

... (Install Homebrew Packages step unchanged) ...

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:

  • Homebrew requires formulae to be in a tap. Creating a temporary tap and installing from it prevents the "FormulaUnavailableError" and the "must be in a tap" rejection.
  • Adding ffmpeg@7 ensures the subsequent debug step doesn't fail when trying to list its lib directory.
  • Guarding ls with brew checks prevents the debug step from exiting non-zero if optional packages are not installed.

Notes:

  • The step keeps continue-on-error: true for parity with the existing workflow. If you want the workflow to fail when mingw cannot be installed, remove continue-on-error for that step.
  • If you want me to push the branch name or use a specific base branch for the PR, tell me the target branch name. Otherwise I will create the PR against the repository's default branch.
  • File being changed: .github/workflows/build.yml (ref a8fa1bb)

Please confirm you want me to open the PR with these changes and which target branch (or use default).


💡 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.

Copilot AI changed the title [WIP] Update macOS CI job for ffmpeg and mingw installation Fix macOS CI: Add ffmpeg@7, use temporary tap for mingw installation, make debug step resilient Oct 17, 2025
Copilot AI requested a review from vapidinfinity October 17, 2025 14:03
@vapidinfinity
Copy link
Member

silly ahh robot

Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants