Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
27 changes: 9 additions & 18 deletions .github/workflows/ci.yml
Original file line number Diff line number Diff line change
Expand Up @@ -15,8 +15,7 @@ name: CI
# task gating the ten kal_task_* symbols exist in a `-pthread` link and
# in no other, and the interfaces word follows the link
# longjmp a C program that siglongjmps over two frames runs under
# node when the engine resolves the abi key, and the step
# reports a skip while no engine does
# node (`[target.<sel>.abi] longjmp`, mcpp 2026.11.12.1)
#
# ONE TOOLCHAIN, NOT TWO, AND THAT IS A PROPERTY OF THE TARGET RATHER THAN A
# GAP. Every other implementation here is built by a matrix of compiler
Expand All @@ -43,7 +42,7 @@ env:
# `em++`'s C compiler is `emcc` and not `em` (a C translation unit in the
# conformance suite does not compile without that), and the wasm target rows
# resolve the emsdk payload.
MCPP_VERSION: 2026.11.9.1
MCPP_VERSION: 2026.11.12.1
XLINGS_VERSION: v2026.10.26.1
# The mtest engine the runs are reported with: the conformance suite's cases
# (tools/run-conformance.sh with MTEST set) and `mcpp test`'s store (target/mtest).
Expand Down Expand Up @@ -418,25 +417,17 @@ jobs:
# frames works depends on the lowering the whole link chose, so the
# switch belongs to the artefact and the probe's own root manifest
# states it (`longjmp = "wasm"`, the same table threads use). The
# engine under this pin does not know the member yet, and a manifest
# that names it is refused naming the member -- which is the skip:
# the step attempts the build, reads the refusal, and reports a skip
# rather than a green it did not earn. The day an engine resolves the
# key, the same build succeeds, the program runs, and this step is the
# gate that turns with it.
- name: A C program that siglongjmps over two frames, when the engine knows the key
# engine reads the member from mcpp 2026.11.12.1, which is this
# repository's pin: the probe builds and runs, and a build that fails is
# a failure. Until that engine the step read the refusal of the member
# and reported a skip.
- name: A C program that siglongjmps over two frames
run: |
# GitHub runs this step under `bash -e`; the failure of the probe's
# build is an expected outcome the step reads, so the capture has to
# be part of the conditional, not an assignment errexit kills first.
cd probe/longjmp
# Not through a pipe: the build's status is the step's.
if ! out=$(mcpp build --target wasm32-emscripten 2>&1); then
if printf '%s\n' "$out" | grep -q "has no member 'longjmp'"; then
echo " - this engine has no member 'longjmp' in the abi table; the probe is skipped"
exit 0
fi
printf '%s\n' "$out"
echo "::error::the probe's build failed for a reason other than the missing member"
echo "::error::the probe did not build"
exit 1
fi
printf '%s\n' "$out" | tail -3
Expand Down
8 changes: 7 additions & 1 deletion probe/longjmp/mcpp.toml
Original file line number Diff line number Diff line change
@@ -1,7 +1,13 @@
[package]
name = "longjmp-probe"
version = "0.1.0"
description = "A C program that siglongjmps over two frames, carrying the ABI switch the lowering needs. Not part of the implementation's build: continuous integration builds it only when the engine resolves the key below, and the refusal an engine without the key produces is the skip."
description = "A C program that siglongjmps over two frames, carrying the ABI switch the lowering needs. Not part of the implementation's build: continuous integration builds and runs it."

# Stated, not inferred: the engine infers a program from `src/main.cpp`, and
# this one is C.
[targets.longjmp-probe]
kind = "bin"
main = "src/main.c"

[target.'cfg(os = "emscripten")'.abi]
longjmp = "wasm"
9 changes: 8 additions & 1 deletion probe/longjmp/src/main.c
Original file line number Diff line number Diff line change
Expand Up @@ -5,7 +5,14 @@
* register-cached int that came back as its pre-jump value would describe a
* lowering that rewound the frames rather than unwound them, which is the
* observation this program exists to make. A second jump goes back over both
* frames to the origin, so each buffer is used once in each direction. */
* frames to the origin, so each buffer is used once in each direction.
*
* sigsetjmp and siglongjmp are POSIX's, and this C library declares them, as
* every C library does, only to a unit that asks for POSIX; the engine
* compiles C at the standard alone. The unit states what it asks for. (The
* probe was first compiled on 2026-11-12, by the first engine that resolves
* the key in its manifest; without this line it did not compile.) */
#define _POSIX_C_SOURCE 200809L
#include <setjmp.h>

static volatile int visited;
Expand Down
Loading