Skip to content

Commit c44ac51

Browse files
committed
fix(ci): retain packed Apple debug symbols
1 parent 9d29c01 commit c44ac51

5 files changed

Lines changed: 219 additions & 68 deletions

File tree

‎.github/workflows/build2-bridge-cffi.reusable.yaml‎

Lines changed: 65 additions & 35 deletions
Original file line numberDiff line numberDiff line change
@@ -290,16 +290,26 @@ jobs:
290290
if [[ "$TARGET" == *-musl ]]; then
291291
export RUSTFLAGS="${RUSTFLAGS:+$RUSTFLAGS }-C target-feature=-crt-static"
292292
fi
293+
split_debug_config=()
294+
if [[ "$TARGET" == *-apple-darwin ]]; then
295+
split_debug_config=(
296+
--config
297+
'profile.release-bridge-cffi.split-debuginfo="packed"'
298+
)
299+
fi
293300
# Use Cargo CLI controls rather than environment variables: `cross`
294301
# forwards only its configured environment allowlist into Linux
295-
# build containers.
302+
# build containers. Apple diagnostics use packed split debug so the
303+
# immutable bundle retains one UUID-matched dSYM instead of referring
304+
# to unpacked intermediate object files.
296305
${CARGO} build \
297306
-p bridge_cffi \
298307
--profile release-bridge-cffi \
299308
--target "$TARGET" \
300309
--target-dir target/csharp-entry-unstripped \
301310
--config profile.release-bridge-cffi.strip=false \
302-
--config profile.release-bridge-cffi.debug=2
311+
--config profile.release-bridge-cffi.debug=2 \
312+
"${split_debug_config[@]}"
303313
304314
- name: Verify Unix diagnostic contains debug information and symbols
305315
if: inputs.include_csharp_entry_diagnostics && !contains(matrix._.target, 'windows')
@@ -326,42 +336,60 @@ jobs:
326336
test "$actual_arch" = "$expected_arch"
327337
echo "architecture=$actual_arch" \
328338
>> "$outdir/diagnostic-inspection.txt"
329-
dwarf_source="$outdir/$primary"
330-
dsym_dwarf_count="$(find "$outdir" \
331-
-path '*.dSYM/Contents/Resources/DWARF/*' \
339+
# Cargo uplifts the cdylib dSYM through a top-level symlink while
340+
# retaining its physical output under deps/. Materialize that
341+
# canonical path so the manifest and uploaded artifact use the
342+
# same stable name after GitHub strips symlink metadata.
343+
dsym_bundle="$outdir/${primary}.dSYM"
344+
if [[ -L "$dsym_bundle" ]]; then
345+
materialized_dsym="${dsym_bundle}.materialized"
346+
rm -rf "$materialized_dsym"
347+
cp -R -L "$dsym_bundle" "$materialized_dsym"
348+
rm "$dsym_bundle"
349+
mv "$materialized_dsym" "$dsym_bundle"
350+
fi
351+
if [[ ! -d "$dsym_bundle" ]]; then
352+
echo "missing packed dSYM bundle: $dsym_bundle" >&2
353+
find "$outdir" -maxdepth 3 -name '*.dSYM' -print >&2
354+
exit 1
355+
fi
356+
dsym_dwarf_root="$dsym_bundle/Contents/Resources/DWARF"
357+
dsym_dwarf_count="$(find "$dsym_dwarf_root" \
332358
-type f -print |
333359
wc -l |
334360
tr -d ' ')"
335-
test "$dsym_dwarf_count" -le 1
336-
dsym_dwarf="$(find "$outdir" \
337-
-path '*.dSYM/Contents/Resources/DWARF/*' \
338-
-type f -print |
339-
sed -n '1p')"
340-
if [[ -n "$dsym_dwarf" ]]; then
341-
dwarf_source="$dsym_dwarf"
342-
dylib_uuid="$(dwarfdump --uuid "$outdir/$primary" |
343-
awk '
344-
/^UUID:/ {
345-
arch = $3
346-
gsub(/[()]/, "", arch)
347-
print tolower($2) " " arch
348-
}
349-
')"
350-
dsym_uuid="$(dwarfdump --uuid "$dsym_dwarf" |
351-
awk '
352-
/^UUID:/ {
353-
arch = $3
354-
gsub(/[()]/, "", arch)
355-
print tolower($2) " " arch
356-
}
357-
')"
358-
test -n "$dylib_uuid"
359-
test "$dylib_uuid" = "$dsym_uuid"
360-
{
361-
echo "dylib_uuid_arch=$dylib_uuid"
362-
echo "dsym_uuid_arch=$dsym_uuid"
363-
} >> "$outdir/diagnostic-inspection.txt"
361+
if [[ "$dsym_dwarf_count" -ne 1 ]]; then
362+
echo \
363+
"expected exactly one packed dSYM DWARF file for $TARGET; found $dsym_dwarf_count" \
364+
>&2
365+
find "$dsym_dwarf_root" -type f -print >&2
366+
exit 1
364367
fi
368+
dsym_dwarf="$(find "$dsym_dwarf_root" -type f -print |
369+
sed -n '1p')"
370+
dwarf_source="$dsym_dwarf"
371+
dylib_uuid="$(dwarfdump --uuid "$outdir/$primary" |
372+
awk '
373+
/^UUID:/ {
374+
arch = $3
375+
gsub(/[()]/, "", arch)
376+
print tolower($2) " " arch
377+
}
378+
')"
379+
dsym_uuid="$(dwarfdump --uuid "$dsym_dwarf" |
380+
awk '
381+
/^UUID:/ {
382+
arch = $3
383+
gsub(/[()]/, "", arch)
384+
print tolower($2) " " arch
385+
}
386+
')"
387+
test -n "$dylib_uuid"
388+
test "$dylib_uuid" = "$dsym_uuid"
389+
{
390+
echo "dylib_uuid_arch=$dylib_uuid"
391+
echo "dsym_uuid_arch=$dsym_uuid"
392+
} >> "$outdir/diagnostic-inspection.txt"
365393
dwarfdump --debug-info "$dwarf_source" |
366394
awk '
367395
!found && /DW_TAG_compile_unit/ {
@@ -435,7 +463,9 @@ jobs:
435463
"$primary" \
436464
diagnostic-inspection.txt \
437465
diagnostic-verification.txt
438-
find . -path '*.dSYM/*' -type f -print
466+
if [[ "$format" == "mach-o" ]]; then
467+
find "./${primary}.dSYM" -type f -print
468+
fi
439469
find . -maxdepth 1 -type f -name '*.dwp' -print
440470
} |
441471
sed 's#^\./##' |

‎TASK/csharp-entry-gates-handoff.md‎

Lines changed: 101 additions & 15 deletions
Original file line numberDiff line numberDiff line change
@@ -1,12 +1,15 @@
11
# C# implementation-entry external-run handoff
22

3-
Status: repository-local preparation is complete; the external workflow has
4-
not run. The exact local provenance commit and its matching one-shot gate tag
5-
must be reviewed and pushed before the first run. B8 passes locally, but its
6-
committed-source exact-package/trim reproduction is still pending. B11 also
7-
passes its complete local Linux trim/single-file matrix, while B4 remains
8-
blocked on the real eight-RID inputs and runners. `TASK/implementation.md`
9-
must not be created yet.
3+
Status: the exact-source tag bootstrap ran the first atomic external attempt
4+
at commit `9d29c01928df7ce726c49286a3067129fc039115`. Its source/release-plan
5+
preflight and six non-Apple producer jobs passed, including every experimental
6+
target, but both Apple diagnostic verifiers failed before upload and the
7+
atomic verifier was skipped. The failure is recorded below and promotes no
8+
gate. B8 passes locally, but its committed-source exact-package/trim
9+
reproduction is still pending. B11 also passes its complete local Linux
10+
trim/single-file matrix, while B4 remains blocked on the verified atomic
11+
package and real eight-RID consumers. `TASK/implementation.md` must not be
12+
created yet.
1013

1114
## Exact workflow
1215

@@ -99,15 +102,98 @@ Once that push is authorized, this explicitly non-publishing evidence run is
99102
an in-scope verification step; it does not authorize any production release
100103
or publication.
101104

105+
## Remote builder-only diagnostic
106+
107+
Before the exact tag bootstrap was pushed, the registered language-neutral
108+
builder was dispatched directly as a non-publishing diagnostic.
109+
[GitHub Actions run 29620985984](https://github.com/BoundaryML/baml/actions/runs/29620985984)
110+
completed successfully on attempt 1 at exact remote source
111+
`6d52aff1446c66be440771a14b85512c67214ca1`, release version `0.15.0`.
112+
The matrix job and every one of the eight target jobs concluded `success`;
113+
none of the three upstream-experimental targets was hidden by
114+
`continue-on-error`. Every target built, checksummed, and uploaded its
115+
shipping artifact. Native-host C/C++ ABI smoke tests also passed on Linux x64
116+
glibc, macOS ARM64, and both Windows targets where the workflow enables them.
117+
118+
The downloaded artifacts' own identity sidecars all record the exact source
119+
SHA, run ID `29620985984`, attempt `1`, target, canonical asset, and release
120+
version. Their shipping primaries are:
121+
122+
| Target | Bytes | SHA-256 |
123+
| --- | ---: | --- |
124+
| `aarch64-apple-darwin` | 21,111,072 | `76c157a8c8b68d2607ba1ac00f0abb780a1080d88555d575b69bf2cb748f0ddc` |
125+
| `x86_64-apple-darwin` | 21,539,636 | `df4c64c8ae040e99d3f4a0b67ee52355107e5d1ef28aedc4770a907ff1d57991` |
126+
| `aarch64-unknown-linux-gnu` | 21,446,720 | `9410ac423d2f7a2d86282d7a8435e0b160c531f40e21ad9de23e8ce3f185cfdc` |
127+
| `aarch64-unknown-linux-musl` | 21,376,824 | `66b0ff4c0af3d393e295e8e5394fc5e39e59abf5c3a1518d09ef42384c0a00c4` |
128+
| `x86_64-unknown-linux-gnu` | 24,318,040 | `e545e6dca35bdb6c119961d088a65ce1f5ed12c9ab91db1177ca9e0a328e2e4f` |
129+
| `x86_64-unknown-linux-musl` | 24,170,528 | `f6fbe864eb4b994c7b3424b8a8e65e85208199882dd8bb61834776e147604fff` |
130+
| `x86_64-pc-windows-msvc` | 24,422,400 | `90b394181f0721bbe40c0a5db98af117b49e88c8537011f10d0b783234280c0b` |
131+
| `aarch64-pc-windows-msvc` | 22,409,728 | `f895081ac3d990ad823f28c6dee4de85fb2e8f5482d50acbc9842cda0e1de1fd` |
132+
133+
This diagnostic deliberately left the C# entry-diagnostic condition false.
134+
It therefore produced no unstripped bundles, PDB/DWARF proof, normalized
135+
NuGet package, exact-package native consumers, protocol-host fan-in,
136+
trim/single-file executions, unsupported-RID/NativeAOT diagnostics, or atomic
137+
completeness manifest. It is useful cross-platform builder evidence only and
138+
does not promote B3, B4, B8, B11, B12, or C6.
139+
140+
## First atomic attempt
141+
142+
[GitHub Actions run 29626183183](https://github.com/BoundaryML/baml/actions/runs/29626183183)
143+
was triggered by the exact tag
144+
`csharp-entry-gates-9d29c01928df7ce726c49286a3067129fc039115`.
145+
Its event was `push`, its head SHA was
146+
`9d29c01928df7ce726c49286a3067129fc039115`, and attempt 1 froze the
147+
expected `0.15.0` release plan. The plan job and central target-matrix job
148+
passed. All six non-Apple producer jobs passed their shipping build,
149+
shipping-artifact upload, unstripped diagnostic build, platform-specific
150+
debug/symbol verification, and diagnostic upload. That includes all three
151+
upstream-experimental targets; no `continue-on-error` failure was hidden.
152+
153+
Both `aarch64-apple-darwin` and `x86_64-apple-darwin` passed their shipping
154+
build/upload and unstripped diagnostic build, then failed
155+
`Verify Unix diagnostic contains debug information and symbols`. Their
156+
diagnostic upload steps did not run, and `Verify C# entry gates` was skipped
157+
because its complete producer dependency was not satisfied. No package,
158+
consumer, protocol-host, trim/single-file, unsupported-RID/NativeAOT, or
159+
completeness evidence was produced.
160+
161+
The diagnostic build requests `debug=2` and `strip=false` but does not pin
162+
`split-debuginfo`. Cargo's
163+
[profile reference](https://doc.rust-lang.org/cargo/reference/profiles.html#split-debuginfo)
164+
documents `unpacked` as the macOS default when debug information is enabled;
165+
the
166+
[rustc reference](https://doc.rust-lang.org/rustc/codegen-options/index.html#split-debuginfo)
167+
states that this leaves macOS debug information in per-compilation object
168+
files. The verifier intentionally retains and accepts only the dylib itself
169+
or one UUID-matched `.dSYM`, so the default unpacked layout cannot satisfy the
170+
immutable diagnostic-bundle contract. Both Apple architectures failed the
171+
same step within seconds of their successful diagnostic builds. The focused
172+
repair is to request `split-debuginfo="packed"` only for Apple diagnostic
173+
builds, retain the generated `.dSYM`, and keep the existing UUID/DWARF and
174+
local-symbol assertions. That repair is implemented locally: `actionlint`,
175+
independent YAML parsing, shell syntax checks, Cargo profile-override parsing,
176+
and three-target argument expansion prove that only Apple receives the packed
177+
override. The Apple runner result and another complete exact-source attempt
178+
remain pending.
179+
102180
## Provenance preflight
103181

104-
The final precommit temporary-index preview contains exactly the intended 120
105-
source/evidence files. `git diff --cached --check` passes, Git reports zero
106-
binary entries, and the scope contains zero paths under local `.codex/`,
107-
`.TASK.readonly-seed/`, `AGENTS.md`, or any excluded directory. The real index
108-
was not touched by the preview. The local provenance commit must match this
109-
scope exactly; its committed SHA becomes the workflow's `source_sha`. Later
110-
edits invalidate that identity rather than inheriting it.
182+
The first provenance commit's temporary-index preview contained exactly the
183+
intended 120 source/evidence files. `git diff --cached --check` passed, Git
184+
reported zero binary entries, and the scope contained zero paths under local
185+
`.codex/`, `.TASK.readonly-seed/`, `AGENTS.md`, or any excluded directory.
186+
That scope became commit
187+
`6d52aff1446c66be440771a14b85512c67214ca1`; trigger bootstrap commit
188+
`9d29c01928df7ce726c49286a3067129fc039115` was the first atomic attempt's
189+
source.
190+
191+
The Apple packed-debug repair and post-run ledger updates require a new
192+
reviewed source commit and a new matching
193+
`csharp-entry-gates-<full source SHA>` tag. Its precommit scope must contain
194+
only the native-builder workflow plus these four continuously maintained
195+
ledger files. The local `.codex/`, `.TASK.readonly-seed/`, `AGENTS.md`, and all
196+
excluded paths remain outside that commit.
111197

112198
After the run, record in `verification-gates.md`:
113199

@@ -322,4 +408,4 @@ Current source SHA-256 values:
322408
| shared Rust setup action | `2063428518629315d1d6bb67e4c864764466cfc6a9654469dec014d908c2713a` |
323409
| manual caller workflow | `cd3e45ef30ecd8789116e16a3c34212b35a905244020b417a57e70a35fc28f96` |
324410
| reusable verifier workflow | `9b4118773f3c2c397ab1b50270c97cd12a920631ee3f1df7ef803230a780619e` |
325-
| native builder workflow | `38f117d90015add19bdd0edc153b66d7339ba1b16cb621356ae3d4aac3782f41` |
411+
| native builder workflow | `966e45b3dbe0a140eb2fe5905d2924d8befe95a7f4fd83111b263cd1ace7128c` |

‎TASK/package-feasibility-evidence.md‎

Lines changed: 42 additions & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -1,10 +1,12 @@
11
# C# atomic-package feasibility evidence
22

3-
Status: B4 partially executed on 2026-07-17; blocked on all eight
4-
workflow-produced target artifacts and the required native runner matrix.
5-
Deterministic unsigned-package normalization and the current Linux x64 local
6-
baseline are proved. The workflow, fixtures, and contract edits are included
7-
in the local provenance change; the baseline SHA alone does not contain them.
3+
Status: B4 partially executed through the first exact-source atomic attempt on
4+
2026-07-18. All eight shipping targets built, and all six non-Apple paired
5+
unstripped diagnostics passed, but both Apple diagnostics failed retained
6+
DWARF verification before upload. The atomic verifier and native consumer
7+
matrix were therefore skipped. Deterministic unsigned-package normalization
8+
and the current Linux x64 local baseline are proved; no eight-RID package
9+
baseline is approved.
810

911
## Target and size authority
1012

@@ -290,12 +292,43 @@ build diagnostics. Its normalized package was `60,964,748` bytes with SHA-256
290292
The real package baseline remains unset until the workflow consumes eight
291293
distinct immutable release artifacts.
292294

295+
## Remote eight-target builder diagnostic
296+
297+
The already registered language-neutral native builder was dispatched
298+
directly as a safe non-publishing diagnostic. [Run
299+
29620985984](https://github.com/BoundaryML/baml/actions/runs/29620985984)
300+
completed successfully at exact source
301+
`6d52aff1446c66be440771a14b85512c67214ca1`, attempt 1, release version
302+
`0.15.0`. All eight jobs, including the three targets marked experimental for
303+
other upstream uses, concluded `success`; each produced a distinct shipping
304+
binary, matching SHA-256 sidecar, and run/source/release identity sidecar.
305+
`TASK/csharp-entry-gates-handoff.md` records every binary's exact size and
306+
digest.
307+
308+
This direct diagnostic did not request the unstripped native builds and did
309+
not invoke the C# verifier. It therefore produced no paired debug bundles,
310+
platform-native debug proof, normalized package, package size/baseline,
311+
consumer executions, or atomic completeness manifest. It proves that the
312+
current branch's eight shipping builders can complete on their registered
313+
runners; it is not B4 evidence for an atomic package and does not unblock C6.
314+
315+
The first exact-source atomic attempt, [run
316+
29626183183](https://github.com/BoundaryML/baml/actions/runs/29626183183),
317+
used tag and source SHA
318+
`9d29c01928df7ce726c49286a3067129fc039115`. Its immutable plan and all six
319+
non-Apple shipping/diagnostic producers passed. Both Apple shipping and
320+
diagnostic builds also completed, but their diagnostic verification failed
321+
because the build left Cargo's macOS debug layout at the documented
322+
`split-debuginfo=unpacked` default while the immutable bundle contract accepts
323+
the dylib or one UUID-matched `.dSYM`. The diagnostic uploads and downstream
324+
atomic verifier were correctly skipped. No B4 or C6 promotion is claimed.
325+
293326
## Remaining closure
294327

295-
B4 remains blocked, not passed. An authorized maintainer must execute the
296-
reviewed, committed non-publishing workflow through its exact-source tag
297-
bootstrap (or normal manual dispatch after the workflow reaches the default
298-
branch) and record its immutable outputs. That run must:
328+
B4 remains blocked, not passed. Neither the builder-only run nor the failed
329+
first atomic attempt satisfies the atomic package contract. The locally
330+
validated Apple-only packed-debug repair must be committed and executed from
331+
a new exact-source bootstrap tag; a passing attempt must:
299332

300333
1. supply all eight real immutable artifacts from the frozen release plan;
301334
2. inspect format, architecture, minimum OS/libc, dependencies, RPATH, exports,

‎TASK/state-of-csharp-completeness.md‎

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -212,7 +212,7 @@ together. The completed design says a single “interop,” “streaming,” or
212212
| Internal Protobuf generation is deterministic and private | passed locally | two isolated byte-identical local generations, no-op/import graph, internal/path inspection in `TASK/protocol-generation-evidence.md`; the untriggered workflow uploads three host manifests and requires cross-host identity | packaging P1; build-host matrix remains |
213213
| `Grpc.Tools` and schemas do not flow to consumers | passed locally | isolated exact-package cache/asset/public-surface inspection | packaging P1 |
214214
| Frozen `Grpc.Tools` / `Google.Protobuf` compatibility | passed locally | exact 2.82.0/libprotoc 35.0 with tested 3.35.1 and range `[3.35.1,4.0.0)` plus envelope vectors | packaging P1; build-host/trim matrix remains |
215-
| One atomic eight-RID `baml-bridge` package | blocked | `TASK/package-feasibility-evidence.md`: exact 200,000,000-byte ceiling, deterministic `0644` normalizer, one current local Linux x64 package execution, and untriggered all-eight workflow in `TASK/csharp-entry-gates-handoff.md`; real artifacts/runners remain | release; Q10 feasibility |
215+
| One atomic eight-RID `baml-bridge` package | blocked | `TASK/package-feasibility-evidence.md`: exact 200,000,000-byte ceiling, deterministic `0644` normalizer, current local Linux x64 package execution, eight successful shipping builders, and six passing non-Apple paired diagnostics in atomic attempt 29626183183. Both Apple diagnostic verifiers failed under Cargo's unpacked-debug default, so package/verifier/consumer lanes were skipped; `TASK/csharp-entry-gates-handoff.md` records the exact repair boundary. | release; Q10 feasibility |
216216
| Only selected RID native asset reaches RID-specific publish | passed locally | sole canonical `linux-x64` package asset reaches concrete Ubuntu x64 publish byte-identically | release; other RIDs remain |
217217
| Unsupported RID diagnostics | passed locally | exact evidence package rejects explicit `linux-s390x` with bounded `BAML0010`; warning-free eight-way runtime policy throws `PlatformNotSupportedException` with detected facts/list and never substitutes architecture/libc | release; final product target/loader and native matrix remain |
218218
| Union one-field-per-arm binary layout | passed locally | current .NET 10 probe retains arity 2/8/16/32 sizes, copy cost, construction/match allocations, duplicate cases, invalid default, source hashes, and exact output | P6; `TASK/union-layout-evidence.md` |

0 commit comments

Comments
 (0)