Repository navigation
frontend: the c_import cache key names the sysroot the header is read from (#2530) - #2778
Merged
Merged
Conversation
… from (#2530) The battery on the #2530 stub fix went red on err_2530_stub_names_only_exported: "undefined variable" for sqlite3_enable_load_extension, a function the embedded sysroot's sqlite3.h declares. Stage1 and the installed compiler both passed it. Root cause (Frontend.w c_import cache key): the key is the header's spelling, links, flags, defines and the compiler's identity, but not the sysroot the header is read from, and a bare "sqlite3.h" carries no content fingerprint. The same release binary had imported sqlite3.h under SDKROOT (the Xcode SDK's header defines SQLITE_OMIT_LOAD_EXTENSION, so the load-extension API is not declared); the fixture blanks SDKROOT to read the embedded sysroot and was served that import from ~/.cache/with/c_import. Reproduced with one cache epoch: SDKROOT=<Xcode SDK> with check u.w -> c_import cache miss SDKROOT= with check u.w -> c_import cache hit (fs) error: undefined variable The key now carries host_c_sysroot() (compiler.EmbeddedSysroot, the one owner of which sysroot c_import parses against: WITH_SDKROOT, SDKROOT, [c_import] sdk_path, else the embedded sysroot, whose directory names its content hash). Evidence: test/behavior/behav_2530_cimport_cache_keys_sysroot.w (two throwaway sysroots whose probe_key.h declare different functions) failed on the installed compiler ("kb.w under sb: undefined variable") and passes on stage1; after poisoning the cache with an Xcode-SDK import of sqlite3.h, stage1 still passes err_2530_stub_names_only_exported.
This was referenced Oct 28, 2026
Contributor
Author
|
Seed-driven battery GREEN on the stack top 6cba97b ( |
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.
frontend: the c_import cache key names the sysroot the header is read from (#2530)
The battery on the #2530 stub fix went red on
err_2530_stub_names_only_exported: "undefined variable" for
sqlite3_enable_load_extension, a function the embedded sysroot's
sqlite3.h declares. Stage1 and the installed compiler both passed it.
Root cause (Frontend.w c_import cache key): the key is the header's
spelling, links, flags, defines and the compiler's identity, but not the
sysroot the header is read from, and a bare "sqlite3.h" carries no
content fingerprint. The same release binary had imported sqlite3.h
under SDKROOT (the Xcode SDK's header defines SQLITE_OMIT_LOAD_EXTENSION,
so the load-extension API is not declared); the fixture blanks SDKROOT
to read the embedded sysroot and was served that import from
~/.cache/with/c_import. Reproduced with one cache epoch:
SDKROOT= with check u.w -> c_import cache miss
SDKROOT= with check u.w -> c_import cache hit (fs)
error: undefined variable
The key now carries host_c_sysroot() (compiler.EmbeddedSysroot, the one
owner of which sysroot c_import parses against: WITH_SDKROOT, SDKROOT,
[c_import] sdk_path, else the embedded sysroot, whose directory names
its content hash).
Evidence: test/behavior/behav_2530_cimport_cache_keys_sysroot.w (two
throwaway sysroots whose probe_key.h declare different functions)
failed on the installed compiler ("kb.w under sb: undefined variable")
and passes on stage1; after poisoning the cache with an Xcode-SDK import
of sqlite3.h, stage1 still passes err_2530_stub_names_only_exported.