Skip to content

The task interface needs the ABI switch, and a task program runs with it (0.1.1) - #1

Merged
Sunrisepeak merged 2 commits into
mainfrom
feat/threads-through-the-abi-table
Sep 11, 2026
Merged

The task interface needs the ABI switch, and a task program runs with it (0.1.1)#1
Sunrisepeak merged 2 commits into
mainfrom
feat/threads-through-the-abi-table

Conversation

@Sunrisepeak

Copy link
Copy Markdown
Member

openkal.task needs -pthread on Emscripten, and -pthread changes the module configuration of every translation unit in the link, so it cannot be a flag of this package's own units. mcpp 2026.9.12.2 (mcpp-community/mcpp#619) carries the switch as a typed member of the consumer's root manifest:

[target.'cfg(os = "emscripten")'.abi]
threads = true

Changes

  • The threads feature declares requires_abi = { threads = true } instead of adding -pthread to src/**. A consumer that activates the feature without the table is refused before anything compiles, and the refusal names the feature and the table.

  • The README section that recorded "mcpp has no channel for a flag that applies to a whole dependency graph" is corrected. The failure measured on 2026-09-11 was -pthread in the consumer's per-package cxxflags, which does not reach the specification package's module. A graph-wide channel existed; what was missing was a way to scope it to a target and to let this feature state its requirement.

  • CI's task gate asserts three things:

    1. no task symbol without the feature;
    2. the refusal without the switch, naming the feature;
    3. with the switch, eight task symbols and a program that starts a task and joins it exiting 0 under node.

    The conformance step's comment states why task stays outside the suite's interface list: the suite's consumer manifest is generated by the specification's runner.

  • The CI engine pin moves to 2026.9.12.2.

  • The version moves to 0.1.1, so the index can publish the change.

Measurement

Measured 2026-09-12 with emsdk 6.0.9 and a development build of mcpp 2026.9.12.2, on a consumer of this checkout by path:

without the table:  exit 2
error: `openkal-emscripten` requires the artefact's ABI to have threads (feature `threads`), and this build does not state it.

with the table:     build exit 0; `mcpp run --target wasm32-emscripten` exit 0

The program exits 0 only if the parallel property is set, kal_task_start succeeds, kal_task_join succeeds and the task ran.

Compatibility

An mcpp older than 2026.9.12.2 reports requires_abi as an unknown feature key and skips it, so the feature no longer adds -pthread. The threads feature was not usable end to end on those versions (the module configuration mismatch above), so no working configuration is lost.

… it (0.1.1)

The threads feature declares requires_abi = { threads = true } instead of putting -pthread on this package's own units: the switch belongs to the artefact, and mcpp 2026.9.12.2 carries it as [target.'cfg(os = "emscripten")'.abi] threads = true in the consumer's root manifest. The README section that recorded a missing whole-graph channel is corrected, and CI asserts no task symbol without the feature, a refusal naming the feature without the switch, and with it eight symbols and a task program exiting 0 under node.
@Sunrisepeak
Sunrisepeak merged commit d5bc117 into main Sep 11, 2026
1 check passed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant