Skip to content

Linux :test: c_import's noreturn probe matches only noreturn; uat golden names <host>; CI installs the facade libraries; generator coroutine stubs - #1807

Merged
ehartford merged 2 commits into
mainfrom
cimport-noreturn-probe
Sep 27, 2026
Merged

ehartford merged 2 commits into
mainfrom
cimport-noreturn-probe

Conversation

@ehartford

@ehartford ehartford commented Sep 27, 2026 •

Copy link
Copy Markdown
Contributor

This makes :test pass on linux-x86_64: four fixes for the failures a Linux battery hits on main.

1. c_import turned many glibc functions into -> Never

with_cimport_fn_is_noreturn (src/compiler/ClangBridge.w) decided a function was noreturn, and so lowered it to void, in two ways that overreached:

  • Token scan. It tokenized an attributed declaration and matched any __attribute__ token. glibc writes __attribute__ ((__const__)) and __THROW's __attribute__ ((__nothrow__)) on hundreds of declarations, so on Linux each became -> Never. abs(-3) returned -3, because the call was declare void @abs(i32) (behav_1372_two_modules_c_import). macOS headers spell these through macros such as __pure2, which is why only Linux was affected. The scan now matches only the declaration-attribute spellings: noreturn, _Noreturn and __noreturn__.
  • Type-spelling check. It searched the function's type spelling for the substring noreturn. That also matched a parameter type like noreturn_t, and an unnamed record's spelling, which embeds its header's path; a checkout directory named …noreturn… broke behav_c_import_anon_file_scope_record_uses. GNU noreturn appears in the type as exactly __attribute__((noreturn)), and that's what it matches now.

Two new tests; both fail on main and pass here:

  • behav_c_import_attributed_decl_return.w runs abs, labs, llabs and exit.
  • behav_c_import_noreturn_probe.w (check-only) covers GNU noreturn in both spellings, _Noreturn, and three false positives: a nothrow/const function, a noreturn_code_t parameter, and an unnamed-record parameter.

2. uat-tests only matched on macOS

A platform skip names the host ((platforms: darwin not listed)), and test/uat/expected*.txt recorded darwin. The comparison now normalizes the host to <host>.

3. The Linux lanes lacked the facade tests' libraries

The zlib, bzip2, sqlite3 and libcurl facade tests c_import the host's headers, by design; a UAT project gets them from with get. selfhost-linux, selfhost-linux-aarch64 and nightly-release installed only zlib1g-dev, and now also install libbz2-dev, libsqlite3-dev and libcurl4-openssl-dev.

4. emit-c-smoke failed to link

D69 (#1748) added with_fiber_coro_new, resume, suspend, finish and free to the fiber cores, and std.task's pull() references them. rt/fiber_stubs.w, which is linked when the fiber runtime isn't, had none. So emit-c-smoke's prelude runtime, emitted C linked against fiber_stubs.o, failed with undefined reference to `with_fiber_coro_finish' (pull_coro_main). This fails on plain main too.

The stubs now define all five. Each one stops the program with a message, because a generator can't be stepped without the fiber runtime, and returning a null coroutine would let pull() pretend to work.

Verification (linux-x86_64, pinned seed and SDK, this exact commit)

  • with build then :fixpoint: stage2 == stage3.

  • :test: all targets green, including seed-driver, emit-c-smoke, uat-tests, abi-hash-check and the debug-alloc lane. Per suite:

    Suite Files ok
    behavior 1410
    native-compile-error 1239
    native-spec 210
    native-phase 67
    internals 51
    native-codegen 17
    parser 9
    lexer 7
    comptime-diff 6
  • The two new tests fail on main (abs(-3) prints -3; an unreachable-code error after nr_touch) and pass here.

🤖 Generated with Claude Code

…den names <host>; CI installs the facade libraries

c_import (ClangBridge.w with_cimport_fn_is_noreturn) decided a function
was `-> Never`, lowered to `void`, two ways that both overreached:

- It tokenized an attributed declaration and matched any `__attribute__`
  token. glibc writes `__attribute__ ((__const__))` and __THROW's
  `__attribute__ ((__nothrow__))` on hundreds of declarations, so on linux
  each of them became `-> Never`: abs(-3) returned -3
  (behav_1372_two_modules_c_import). The tokens now matched are noreturn,
  _Noreturn and __noreturn__, the declaration-attribute spellings.
- It searched the function's type spelling for the substring "noreturn",
  which also matched a parameter type like `noreturn_t` and an unnamed
  record's spelling, which carries its header's path. GNU noreturn is in the
  type as exactly `__attribute__((noreturn))`; that is what it matches now.

behav_c_import_attributed_decl_return.w runs abs, labs, llabs and exit;
behav_c_import_noreturn_probe.w checks every noreturn spelling and each
false positive. Both fail before this change.

uat-tests: a platform skip names the host ("platforms: darwin not listed"),
so test/uat/expected*.txt only matched on macOS. The comparison normalizes
the host to <host>.

CI: the zlib, bzip2, sqlite3 and libcurl facade tests c_import the host's
headers; the linux lanes installed only zlib1g-dev. selfhost-linux,
selfhost-linux-aarch64 and nightly-release now install libbz2-dev,
libsqlite3-dev and libcurl4-openssl-dev too.

Co-Authored-By: Claude Opus 5.5 <[email protected]>
…smoke)

D69 (#1748) added with_fiber_coro_new/resume/suspend/finish/free to the
fiber cores and std.task's pull() references them. fiber_stubs, the
surface linked when the fiber runtime is not, had none, so emit-c-smoke's
prelude runtime (emitted C, linked against fiber_stubs.o without
per-function sections) failed:

    undefined reference to `with_fiber_coro_finish' (pull_coro_main)

Each is defined here and stops the program loudly: a generator cannot be
stepped without the fiber runtime, and returning a null coroutine would
let pull() pretend.

Co-Authored-By: Claude Opus 5.5 <[email protected]>
@ehartford ehartford changed the title Linux :test: c_import's noreturn probe matches only noreturn; uat golden names <host>; CI installs the facade libraries Linux :test: c_import's noreturn probe matches only noreturn; uat golden names <host>; CI installs the facade libraries; generator coroutine stubs Sep 27, 2026
@ehartford
ehartford merged commit 7f3e4d3 into main Sep 27, 2026
@ehartford
ehartford deleted the cimport-noreturn-probe branch September 27, 2026 23:43
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