Skip to content

Commit 0749bbb

Browse files
committed
test: the runner check reads the manifest's keys, the MSI payload is found by content, and independent platform steps run after a failure (mcpp#634)
Run 34823714568 measured every P2 criterion on macos-15 (LC_RPATH @executable_path/../Frameworks and @loader_path; codesign --verify --deep --strict valid, both signatures flags=0x2(adhoc); exit 7 with the framework loaded from Contents/Frameworks; exit 134, "Library not loaded", without it) and then failed its own precondition: the grep for `runner` matched the fixture's header comment. Comments are removed before the search. On windows-2022 the bundle was produced (1126642 bytes beside the 32768-byte MSI), and `wix burn extract` without the bootstrapper application wrote the payloads under their ids, `a0` and `a1`, so a search by extension found nothing. The check now extracts with -oba as well and looks for a payload byte-identical to the MSI. The repeated "The system cannot find the path specified." lines are mcpp's own output on Windows: the job log of main's last run (34772006562) carries twelve of them. The macOS framework, Metal and iOS steps and the Windows bundle step run when an earlier step of their job failed, so one run reports each of their readings.
1 parent c49cbb6 commit 0749bbb

3 files changed

Lines changed: 27 additions & 14 deletions

File tree

.github/workflows/ci.yml

Lines changed: 7 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -1890,7 +1890,7 @@ jobs:
18901890
# bootstrapper application, chaining the MSI the step above measured, and
18911891
# built through the extension `xim:wix` 5.0.2-1 carries.
18921892
- name: dist-wix produces a Burn bundle that chains the MSI
1893-
if: runner.os == 'Windows'
1893+
if: ${{ !cancelled() && runner.os == 'Windows' }}
18941894
timeout-minutes: 20
18951895
working-directory: tests/msi-consumer
18961896
run: MCPP="$MCPP" ./check-setup.sh
@@ -1943,12 +1943,14 @@ jobs:
19431943
echo "ok: one bundle, a valid plist, it launches, and the resource is where NSBundle looks"
19441944
19451945
# THE CLOSURE AS A FRAMEWORK, ON THE BUNDLE (mcpp#634, B1 to B3). The
1946-
# plan-level half runs on Linux. This half reads the linked program's
1946+
# plan-level half runs on Linux. This step, the Metal step and the iOS
1947+
# step measure independent things, so each runs when an earlier step of
1948+
# the job failed and the job reports every reading it can take. This half reads the linked program's
19471949
# load commands, verifies the bundle's ad-hoc signature, runs the program
19481950
# with and without its framework, runs the bundle through `mcpp run
19491951
# --format app` with no runner in the manifest, and attaches the image.
19501952
- name: dist-apple carries the closure as a signed framework, runs through macapp-run, and writes a disk image
1951-
if: runner.os == 'macOS'
1953+
if: ${{ !cancelled() && runner.os == 'macOS' }}
19521954
timeout-minutes: 30
19531955
working-directory: tests/app-framework-consumer
19541956
run: MCPP="$MCPP" ./check-apple-bundle.sh
@@ -1958,7 +1960,7 @@ jobs:
19581960
# Metal toolchain the script asserts the rule's refusal and annotates the
19591961
# run with a warning that the two criteria are unmeasured.
19601962
- name: rules-metal compiles Metal libraries, or records that this runner has no Metal toolchain
1961-
if: runner.os == 'macOS'
1963+
if: ${{ !cancelled() && runner.os == 'macOS' }}
19621964
timeout-minutes: 20
19631965
working-directory: tests/metal-consumer
19641966
run: MCPP="$MCPP" ./check-metal.sh
@@ -1981,7 +1983,7 @@ jobs:
19811983
# gives: "a machine without Xcode should not download a compiler before
19821984
# being told the compiler is not what is missing."
19831985
- name: dist-apple's iOS row produces a bundle the simulator launches
1984-
if: runner.os == 'macOS'
1986+
if: ${{ !cancelled() && runner.os == 'macOS' }}
19851987
working-directory: tests/ios-app-consumer
19861988
shell: bash
19871989
run: |

tests/app-framework-consumer/check-apple-bundle.sh

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -107,7 +107,9 @@ echo "ok: exit 7 through the framework copy; without it, exit $rc and 'Library n
107107

108108
# ── 4. mcpp run --format app ───────────────────────────────────────────────
109109
echo "== 4. mcpp run --format app, through the runner dist-apple supplies =="
110-
if grep -q 'runner' mcpp.toml; then fail "the fixture's manifest names a runner" mcpp.toml; fi
110+
# The manifest's keys, not its prose: the header comment names the runner this
111+
# member supplies, so the comments are removed before the search.
112+
if sed 's/#.*$//' mcpp.toml | grep -q 'runner'; then fail "the fixture's manifest names a runner" mcpp.toml; fi
111113
# mcpp_run <variant> <mcpp run arguments...>
112114
mcpp_run() {
113115
local variant="$1"; shift

tests/msi-consumer/check-setup.sh

Lines changed: 17 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -4,8 +4,11 @@
44
# 1. `mcpp pack --format setup` writes a Burn bundle named after the product
55
# and the architecture, never `setup.exe`, beside the MSI it chains.
66
# 2. The bundle carries that MSI: `wix burn extract` takes the attached
7-
# container apart, and the package inside is byte-for-byte the MSI the
8-
# first action wrote.
7+
# container apart, and one of the payloads inside is byte-for-byte the
8+
# MSI the first action wrote. A payload is identified by its content, not
9+
# by its file name: extracted without the bootstrapper application, whose
10+
# manifest maps the names, the payloads keep their ids (`a0`, `a1`; the
11+
# second is the MSI's cabinet), measured on windows-2022.
912
#
1013
# The bundle's user interface is WiX's stock bootstrapper application, which
1114
# `wix build` finds only through the extension `xim:wix` 5.0.2-1 carries; a
@@ -45,12 +48,18 @@ wix="$home/registry/data/xpkgs/xim-x-wix/5.0.2-1/tool/tools/net6.0/any/wix.exe"
4548
[ -f "$wix" ] || fail "no wix.exe of xim:wix 5.0.2-1 at $wix"
4649
out="$PWD/target/setup-extract"
4750
rm -rf "$out"
48-
"$wix" burn extract "$(cygpath -w "$bundle")" -o "$(cygpath -w "$out")" > setup-extract.log 2>&1 \
49-
|| fail "wix burn extract refused the bundle" setup-extract.log
50-
inside=$(find "$out" -type f -iname '*.msi')
51-
reading extracted "$(find "$out" -type f | sed "s|^$out/||" | tr '\n' ' ')"
52-
[ "$(printf '%s\n' "$inside" | grep -c .)" = 1 ] || fail "expected one MSI in the bundle, found: $(echo $inside)" setup-extract.log
53-
cmp -s "$inside" "$msi" || fail "the MSI inside the bundle ($(size "$inside") bytes) differs from $msi ($(size "$msi") bytes)"
51+
"$wix" burn extract "$(cygpath -w "$bundle")" -oba "$(cygpath -w "$out/ba")" -o "$(cygpath -w "$out/payloads")" \
52+
> setup-extract.log 2>&1 || fail "wix burn extract refused the bundle" setup-extract.log
53+
# A listing file rather than process substitution, which Git Bash emulates.
54+
find "$out/payloads" -type f | sort > setup-payloads.log
55+
reading extracted "$(sed "s|^$out/payloads/||" setup-payloads.log | tr '\n' ' ')"
56+
[ -s setup-payloads.log ] || fail "wix burn extract wrote no payload" setup-extract.log
57+
match=""
58+
while IFS= read -r payload; do
59+
if cmp -s "$payload" "$msi"; then match="$payload"; break; fi
60+
done < setup-payloads.log
61+
[ -n "$match" ] || fail "no payload in the bundle is byte-for-byte $msi ($(size "$msi") bytes)" setup-payloads.log setup-extract.log
62+
reading msi-payload "${match#$out/payloads/}, $(size "$match") bytes"
5463
echo "ok: the bundle's container holds the MSI, byte-for-byte"
5564

5665
echo "PASS: dist-wix writes a Burn bundle that chains the MSI"

0 commit comments

Comments
 (0)