Skip to content

Commit 658eb03

Browse files
committed
probe: 扩成 OS/arch/tap-path 矩阵(round 1 在 macos-14 全绿,说明不是公式坏了)
1 parent dc84590 commit 658eb03

1 file changed

Lines changed: 57 additions & 74 deletions

File tree

.github/workflows/tmp-brew-macos-probe.yml

Lines changed: 57 additions & 74 deletions
Original file line numberDiff line numberDiff line change
@@ -2,111 +2,94 @@ name: tmp-brew-macos-probe
22

33
# TEMPORARY. Delete before merging.
44
#
5-
# Reproduces "brew install mcpp errors on macOS" on a real arm64 macOS runner
6-
# and prints enough to identify WHICH step fails. Every brew invocation is
7-
# allowed to fail and is followed by a diagnostic dump, because a job that dies
8-
# on the first non-zero exit tells us the command failed and nothing else.
5+
# Round 1 (macos-14, pre-tapped) passed end to end: install → mcpp new →
6+
# mcpp run → toolchain bootstrap → binary ran. So the reported breakage is not
7+
# "the formula is broken"; it is environment- or path-specific.
8+
#
9+
# Round 2 widens along the three axes that can differ from that green run:
10+
# OS version the runner was macOS 14; users are on 15 / 26
11+
# arch macos-13 is Intel — the formula REFUSES it by design, and
12+
# this captures the exact message a user would see
13+
# tap path round 1 tapped first; the documented one-liner relies on
14+
# `brew install <user>/<repo>/<formula>` AUTO-tapping, which is
15+
# a different code path
16+
#
17+
# Every brew invocation records its own exit code. Note the trap round 1 fell
18+
# into: `cmd | tail -20` followed by `$?` reports TAIL's status, so a failing
19+
# command reads as success. Exit codes here are captured before any pipe.
920

1021
on:
1122
pull_request:
1223
workflow_dispatch:
1324

1425
jobs:
1526
brew-probe:
16-
name: brew install probe (macOS arm64)
17-
runs-on: macos-14
27+
name: "brew ${{ matrix.os }}"
28+
runs-on: ${{ matrix.os }}
1829
timeout-minutes: 40
30+
continue-on-error: true
31+
strategy:
32+
fail-fast: false
33+
matrix:
34+
os: [macos-14, macos-15, macos-26, macos-13]
1935
steps:
20-
- uses: actions/checkout@v4
21-
2236
- name: Environment
2337
run: |
38+
echo "runner: ${{ matrix.os }}"
2439
echo "arch: $(uname -m)"
2540
echo "macOS: $(sw_vers -productVersion)"
2641
echo "brew: $(brew --version | head -1)"
2742
echo "brew prefix: $(brew --prefix)"
28-
echo "already installed mcpp? $(command -v mcpp || echo no)"
43+
echo "tapped? $(brew tap | grep -c mcpp || true)"
2944
30-
- name: Tap
31-
run: |
32-
set -x
33-
brew tap mcpp-community/mcpp
34-
brew tap-info mcpp-community/mcpp
35-
36-
# The formula as the tap publishes it. `brew info` first: it evaluates
37-
# the ruby WITHOUT downloading, so a formula-level error (bad DSL, a
38-
# requirement that cannot be satisfied on this runner) shows up here
39-
# rather than being confused with a download/extract failure below.
40-
- name: "brew info (evaluate formula only)"
41-
run: |
42-
set +e
43-
brew info mcpp-community/mcpp/mcpp-m 2>&1 | tee info.log
44-
echo "exit=$?"
45-
echo "── ruby source as tapped ──"
46-
cat "$(brew --repo mcpp-community/mcpp)/Formula/mcpp-m.rb"
47-
48-
- name: "brew install mcpp-m (verbose, failure tolerated)"
45+
# EXACTLY the command README.md line 121 tells users to run — no prior
46+
# `brew tap`. Auto-tapping is part of what is being tested.
47+
- name: "brew install mcpp-community/mcpp/mcpp-m (documented one-liner)"
4948
id: install
5049
run: |
5150
set +e
52-
brew install --verbose mcpp-community/mcpp/mcpp-m 2>&1 | tee install.log
53-
rc=${PIPESTATUS[0]}
51+
brew install mcpp-community/mcpp/mcpp-m > install.log 2>&1
52+
rc=$?
5453
echo "install_rc=$rc" >> "$GITHUB_OUTPUT"
55-
echo "=== install exit code: $rc ==="
54+
echo "=== documented one-liner exit: $rc ==="
55+
tail -40 install.log
5656
exit 0
5757
58-
- name: "Diagnose a failed install"
58+
- name: "Diagnose"
5959
if: ${{ steps.install.outputs.install_rc != '0' }}
6060
run: |
61-
echo "── last 60 lines ──"
62-
tail -60 install.log
63-
echo "── anything that looks like an error ──"
64-
grep -nEi 'error|fail|cannot|no such|denied|unable|invalid' install.log | tail -40 || true
65-
echo "── brew gist-logs (formula build logs) ──"
66-
ls -la ~/Library/Logs/Homebrew/mcpp-m/ 2>/dev/null || echo "(no formula log dir)"
61+
echo "── full log ──"
62+
cat install.log
63+
echo "── error-ish lines ──"
64+
grep -nEi 'error|fail|cannot|no such|denied|unable|invalid|require' install.log | tail -40 || true
6765
for f in ~/Library/Logs/Homebrew/mcpp-m/*; do
6866
echo "===== $f ====="; cat "$f"
6967
done 2>/dev/null || true
7068
71-
- name: "Post-install: does the launcher work?"
72-
if: ${{ steps.install.outputs.install_rc == '0' }}
73-
run: |
74-
set -x
75-
brew list mcpp-community/mcpp/mcpp-m
76-
which mcpp
77-
mcpp --version
78-
mcpp --help | head -5
79-
80-
# The alias path the formula's header comment promises. A user reading
81-
# the README types `mcpp`, not `mcpp-m`, so this is a separate claim.
82-
- name: "Alias: brew install …/mcpp resolves"
83-
run: |
84-
set +e
85-
brew info mcpp-community/mcpp/mcpp 2>&1 | tail -20
86-
echo "alias info exit=$?"
87-
88-
- name: "brew audit (formula hygiene)"
89-
run: |
90-
set +e
91-
brew audit --strict --online mcpp-community/mcpp/mcpp-m 2>&1 | tail -40
92-
echo "audit exit=$?"
93-
94-
- name: "brew test (the formula's own test block)"
69+
- name: "Post-install: launcher + real build"
9570
if: ${{ steps.install.outputs.install_rc == '0' }}
9671
run: |
9772
set +e
98-
brew test --verbose mcpp-community/mcpp/mcpp-m 2>&1 | tail -40
99-
echo "test exit=$?"
73+
which mcpp; ver_rc=0
74+
mcpp --version > ver.log 2>&1 || ver_rc=$?
75+
echo "--version exit=$ver_rc"; cat ver.log
76+
cd "$(mktemp -d)"
77+
mcpp new brewhello > new.log 2>&1; new_rc=$?
78+
echo "new exit=$new_rc"; tail -10 new.log
79+
[ $new_rc -eq 0 ] || exit 0
80+
cd brewhello
81+
mcpp run > run.log 2>&1; run_rc=$?
82+
echo "run exit=$run_rc"; tail -40 run.log
83+
exit 0
10084
101-
# The real usability question, beyond "the files landed": a brew-installed
102-
# mcpp must be able to bootstrap a toolchain and build something.
103-
- name: "Real use: mcpp new → run"
104-
if: ${{ steps.install.outputs.install_rc == '0' }}
85+
# The other spelling the tap README advertises (line 30). Installing
86+
# through an alias is not the same code path as installing the formula.
87+
- name: "Alias: brew install …/mcpp"
88+
if: ${{ matrix.os != 'macos-13' }}
10589
run: |
10690
set +e
107-
cd "$(mktemp -d)"
108-
mcpp new brewhello 2>&1 | tail -20
109-
echo "new exit=$?"
110-
cd brewhello || exit 0
111-
mcpp run 2>&1 | tail -40
112-
echo "run exit=$?"
91+
brew uninstall --force mcpp-m > /dev/null 2>&1
92+
brew install mcpp-community/mcpp/mcpp > alias.log 2>&1
93+
echo "alias install exit=$?"
94+
tail -25 alias.log
95+
exit 0

0 commit comments

Comments
 (0)