probe: macOS brew install 复现(临时,勿合) #2
Workflow file for this run
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| name: tmp-brew-macos-probe | |
| # TEMPORARY. Delete before merging. | |
| # | |
| # Round 1 (macos-14, pre-tapped) passed end to end: install → mcpp new → | |
| # mcpp run → toolchain bootstrap → binary ran. So the reported breakage is not | |
| # "the formula is broken"; it is environment- or path-specific. | |
| # | |
| # Round 2 widens along the three axes that can differ from that green run: | |
| # OS version the runner was macOS 14; users are on 15 / 26 | |
| # arch macos-13 is Intel — the formula REFUSES it by design, and | |
| # this captures the exact message a user would see | |
| # tap path round 1 tapped first; the documented one-liner relies on | |
| # `brew install <user>/<repo>/<formula>` AUTO-tapping, which is | |
| # a different code path | |
| # | |
| # Every brew invocation records its own exit code. Note the trap round 1 fell | |
| # into: `cmd | tail -20` followed by `$?` reports TAIL's status, so a failing | |
| # command reads as success. Exit codes here are captured before any pipe. | |
| on: | |
| pull_request: | |
| workflow_dispatch: | |
| jobs: | |
| brew-probe: | |
| name: "brew ${{ matrix.os }}" | |
| runs-on: ${{ matrix.os }} | |
| timeout-minutes: 40 | |
| continue-on-error: true | |
| strategy: | |
| fail-fast: false | |
| matrix: | |
| os: [macos-14, macos-15, macos-26, macos-13] | |
| steps: | |
| - name: Environment | |
| run: | | |
| echo "runner: ${{ matrix.os }}" | |
| echo "arch: $(uname -m)" | |
| echo "macOS: $(sw_vers -productVersion)" | |
| echo "brew: $(brew --version | head -1)" | |
| echo "brew prefix: $(brew --prefix)" | |
| echo "tapped? $(brew tap | grep -c mcpp || true)" | |
| # EXACTLY the command README.md line 121 tells users to run — no prior | |
| # `brew tap`. Auto-tapping is part of what is being tested. | |
| - name: "brew install mcpp-community/mcpp/mcpp-m (documented one-liner)" | |
| id: install | |
| run: | | |
| set +e | |
| brew install mcpp-community/mcpp/mcpp-m > install.log 2>&1 | |
| rc=$? | |
| echo "install_rc=$rc" >> "$GITHUB_OUTPUT" | |
| echo "=== documented one-liner exit: $rc ===" | |
| tail -40 install.log | |
| exit 0 | |
| - name: "Diagnose" | |
| if: ${{ steps.install.outputs.install_rc != '0' }} | |
| run: | | |
| echo "── full log ──" | |
| cat install.log | |
| echo "── error-ish lines ──" | |
| grep -nEi 'error|fail|cannot|no such|denied|unable|invalid|require' install.log | tail -40 || true | |
| for f in ~/Library/Logs/Homebrew/mcpp-m/*; do | |
| echo "===== $f ====="; cat "$f" | |
| done 2>/dev/null || true | |
| - name: "Post-install: launcher + real build" | |
| if: ${{ steps.install.outputs.install_rc == '0' }} | |
| run: | | |
| set +e | |
| which mcpp; ver_rc=0 | |
| mcpp --version > ver.log 2>&1 || ver_rc=$? | |
| echo "--version exit=$ver_rc"; cat ver.log | |
| cd "$(mktemp -d)" | |
| mcpp new brewhello > new.log 2>&1; new_rc=$? | |
| echo "new exit=$new_rc"; tail -10 new.log | |
| [ $new_rc -eq 0 ] || exit 0 | |
| cd brewhello | |
| mcpp run > run.log 2>&1; run_rc=$? | |
| echo "run exit=$run_rc"; tail -40 run.log | |
| exit 0 | |
| # The other spelling the tap README advertises (line 30). Installing | |
| # through an alias is not the same code path as installing the formula. | |
| - name: "Alias: brew install …/mcpp" | |
| if: ${{ matrix.os != 'macos-13' }} | |
| run: | | |
| set +e | |
| brew uninstall --force mcpp-m > /dev/null 2>&1 | |
| brew install mcpp-community/mcpp/mcpp > alias.log 2>&1 | |
| echo "alias install exit=$?" | |
| tail -25 alias.log | |
| exit 0 |