httpfs: compile remote-read optimization guards on wasm - #71
Merged
Conversation
HTTPFS_REMOTE_READ_OPTIMIZATIONS is 0 on wasm, which compiles out the PrefetchZone/PersistentBlockCache declarations and the zoneFor/ submitPrefetch definitions, but readFromFile() still referenced those types unconditionally, breaking the wasm build. - Hoist copySpanPortion out of the optimization guard; it only serves the L1 LRU path, which exists in all builds. - Drop the dead #else declarations of the guarded types. - Guard the L2/L3 cache layers, the write-through/submitPrefetch block and the trace-log arguments referencing zone/diskCache behind HTTPFS_REMOTE_READ_OPTIMIZATIONS.
adsharma
added a commit
to LadybugDB/ladybug
that referenced
this pull request
Aug 29, 2026
- Bump extension submodule: httpfs guarded the remote-read optimization code (PersistentBlockCache/PrefetchZone/ copySpanPortion/submitPrefetch) so that it no longer breaks the wasm build where HTTPFS_REMOTE_READ_OPTIMIZATIONS is 0 (LadybugDB/extensions#71). - copy_constructors.h: declare the copy helper templates inline instead of static. Internal-linkage templates in a header trigger -Wunused-template in every TU that includes them without instantiating them, and per-TU static copies are an ODR hazard.
adsharma
added a commit
to LadybugDB/ladybug
that referenced
this pull request
Aug 29, 2026
- Bump extension submodule: httpfs guarded the remote-read optimization code (PersistentBlockCache/PrefetchZone/ copySpanPortion/submitPrefetch) so that it no longer breaks the wasm build where HTTPFS_REMOTE_READ_OPTIMIZATIONS is 0 (LadybugDB/extensions#71). - copy_constructors.h: declare the copy helper templates inline instead of static. Internal-linkage templates in a header trigger -Wunused-template in every TU that includes them without instantiating them, and per-TU static copies are an ODR hazard.
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.
Summary
Fixes the wasm build failure in
httpfs/src/httpfs.cpp:HTTPFS_REMOTE_READ_OPTIMIZATIONSis0on wasm (http_config.h), which compiles out thePrefetchZone/PersistentBlockCachedeclarations inhttpfs.hand thezoneFor/submitPrefetchdefinitions inhttpfs.cpp— butreadFromFile()still referenced those types unconditionally.Changes
copySpanPortionout of theHTTPFS_REMOTE_READ_OPTIMIZATIONSguard: it has no dependency on the guarded cache types and is needed by the L1 LRU-cache path in all builds.#elsebranch that declaredPersistentBlockCache*/PrefetchZone*locals — those types don't exist when optimizations are off.HTTPFS_REMOTE_READ_OPTIMIZATIONS: the L2 (prefetch zone) + L3 (persistent disk cache) block, the write-through/submitPrefetchblock after the network fetch, and the trace-log arguments referencingzone/diskCache.Behavior on native builds is unchanged; the wasm single-threaded path now serves reads via L1 LRU + network fetch as before the optimizations were introduced.
Test plan
em++ -fsyntax-only -D__WASM__onhttpfs.cpp: all 4 errors gone.httpfs.cpp: clean (HTTPFS_REMOTE_READ_OPTIMIZATIONS=1path unchanged).