Repository navigation
Linux :test: c_import's noreturn probe matches only noreturn; uat golden names <host>; CI installs the facade libraries; generator coroutine stubs - #1807
Merged
Conversation
…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]>
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
This makes
:testpass on linux-x86_64: four fixes for the failures a Linux battery hits onmain.1. c_import turned many glibc functions into
-> Neverwith_cimport_fn_is_noreturn(src/compiler/ClangBridge.w) decided a function was noreturn, and so lowered it tovoid, in two ways that overreached:__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 wasdeclare 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,_Noreturnand__noreturn__.noreturn. That also matched a parameter type likenoreturn_t, and an unnamed record's spelling, which embeds its header's path; a checkout directory named…noreturn…brokebehav_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
mainand pass here:behav_c_import_attributed_decl_return.wrunsabs,labs,llabsandexit.behav_c_import_noreturn_probe.w(check-only) covers GNU noreturn in both spellings,_Noreturn, and three false positives: anothrow/constfunction, anoreturn_code_tparameter, and an unnamed-record parameter.2.
uat-testsonly matched on macOSA platform skip names the host (
(platforms: darwin not listed)), andtest/uat/expected*.txtrecordeddarwin. 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_importthe host's headers, by design; a UAT project gets them fromwith get.selfhost-linux,selfhost-linux-aarch64andnightly-releaseinstalled onlyzlib1g-dev, and now also installlibbz2-dev,libsqlite3-devandlibcurl4-openssl-dev.4.
emit-c-smokefailed to linkD69 (#1748) added
with_fiber_coro_new,resume,suspend,finishandfreeto the fiber cores, andstd.task'spull()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 againstfiber_stubs.o, failed withundefined reference to `with_fiber_coro_finish'(pull_coro_main). This fails on plainmaintoo.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 buildthen:fixpoint: stage2 == stage3.:test: all targets green, includingseed-driver,emit-c-smoke,uat-tests,abi-hash-checkand the debug-alloc lane. Per suite:The two new tests fail on
main(abs(-3)prints-3; an unreachable-code error afternr_touch) and pass here.🤖 Generated with Claude Code