Skip to content

c_import: a header outside the embedded macOS sysroot says what was searched (#2530, diagnostic half) - #2753

Merged
ehartford merged 1 commit into
fix-959bfrom
fix-2530-diag
Oct 27, 2026
Merged

ehartford merged 1 commit into
fix-959bfrom
fix-2530-diag

Conversation

@ehartford

@ehartford ehartford commented Oct 27, 2026 •

Copy link
Copy Markdown
Contributor

c_import: a header outside the embedded macOS sysroot says what was searched (#2530, diagnostic half)

Without SDKROOT, with check examples/c-interop/src/main.w failed with
a bare "sqlite3.h: 'sqlite3.h' file not found" — no word that the
embedded, libc-only sysroot is what was searched, or what to do.
c_import_emit_header_error_detail_frontend (Frontend.w) appended a
remedy only when no sysroot existed at all; the #2530 case has one —
the embedded one (darwin_sdk_root, EmbeddedSysroot.w).

When the SDK in use is the embedded one (darwin_sdk_is_embedded: no
WITH_SDKROOT/SDKROOT/[c_import] sdk_path named, binary carries a
sysroot) and clang's detail names a header not found, the error now
says the embedded sysroot holds libc only, names the header, and gives
both ways out: name an SDK, or take the library through with get.
With a named SDK the message is unchanged (verified both polarities).

This is the issue's option (c), which applies under either design
outcome; (a) embedding system-library headers and (b) moving the
example to with get remain Eric's call (C interop, a published
example), so #2530 stays open.

Test err_2530_header_outside_embedded_sysroot (darwin only; the env
directives blank SDKROOT/WITH_SDKROOT for the in-process compile so
the embedded sysroot is in use on any shell). Fails pre-fix: "missing
expected check error: WITH_SDKROOT".

…earched (#2530, diagnostic half)

Without SDKROOT, `with check examples/c-interop/src/main.w` failed with
a bare "sqlite3.h: 'sqlite3.h' file not found" — no word that the
embedded, libc-only sysroot is what was searched, or what to do.
`c_import_emit_header_error_detail_frontend` (Frontend.w) appended a
remedy only when no sysroot existed at all; the #2530 case has one —
the embedded one (`darwin_sdk_root`, EmbeddedSysroot.w).

When the SDK in use is the embedded one (`darwin_sdk_is_embedded`: no
WITH_SDKROOT/SDKROOT/[c_import] sdk_path named, binary carries a
sysroot) and clang's detail names a header not found, the error now
says the embedded sysroot holds libc only, names the header, and gives
both ways out: name an SDK, or take the library through `with get`.
With a named SDK the message is unchanged (verified both polarities).

This is the issue's option (c), which applies under either design
outcome; (a) embedding system-library headers and (b) moving the
example to `with get` remain Eric's call (C interop, a published
example), so #2530 stays open.

Test err_2530_header_outside_embedded_sysroot (darwin only; the env
directives blank SDKROOT/WITH_SDKROOT for the in-process compile so
the embedded sysroot is in use on any shell). Fails pre-fix: "missing
expected check error: WITH_SDKROOT".
@ehartford

Copy link
Copy Markdown
Contributor Author

Battery GREEN on the stack top 3e1594f7d (stack #2754: #2750 #2751 #2752 #2753): tools/battery.w rc=0, wall 440s — gate, UAT and battery-checks all green (behavior-tests 1957 files ok; uat 12 pass, 1 skip; every survey "all targets green"). Each layer also passed src/main build :gate on its own commit before the stack battery (fix-2744, fix-981, fix-959b, fix-2530-diag, all rc=0 under the pinned seed). Merging the stack.

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