runtime: add PresetBuilder::with_components escape hatch - #530
Merged
Conversation
…ent seams Add PresetBuilder::with_components, mapping the preset's ComponentsBuilder to the builders to open so an embedder overrides one seam (chain, store, ext, or logs) while the preset's extensions and add-ons carry through. The new PresetComponentsBuilder stage gathers those before consuming the preset and launches otherwise as PresetBuilder::launch.
mfw78
force-pushed
the
feat/509-preset-with-components
branch
from
July 23, 2026 14:15
bb9485d to
0541452
Compare
…ents e2e The manifest path derived from wasm.ancestors().nth(3) resolved to <root>/target, so the explicit manifest pointed at a nonexistent file and the loader silently fell back to an anonymous module. Derive the repo root once and reuse it for both the wasm fixture and the manifest.
mfw78
force-pushed
the
feat/509-preset-with-components
branch
from
July 23, 2026 14:52
0541452 to
974a18f
Compare
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.
What
Add
PresetBuilder::with_componentsincrates/nexum-runtime/src/builder.rs, the preset-path mirror of the value-boundTypedBuilder::with_components.It gathers the preset's extensions (plus any appended ones) and its add-ons before consuming the preset via
components(), hands the preset'sComponentsBuilderto a caller-suppliedFnOncethat returns the builders to open, and transitions to a newPresetComponentsBuilder<'a, T, C, S, E, L>stage whoselaunch()opens the overridden backends and drivesLaunchRuntime::launchexactly asPresetBuilder::launchdoes.An embedder can now swap any of the chain, store, ext, or logs seams straight from the preset shortcut, for example
.with_runtime(P).with_components(|c| c.with_logs(...)).launch(), while the preset's extensions and add-ons carry through unchanged.Why
The preset shortcut previously locked in all four component builders, so reaching a single seam meant dropping the preset entirely and rebuilding the lattice by hand. This closes that gap on the preset path and keeps parity with
TypedBuilder::with_components.Testing
cargo fmt --all -- --checkclean.cargo clean -p nexum-runtimethencargo clippy -p nexum-runtime --all-targets --all-features -- -D warningsclean after a forced recompile.cargo test -p nexum-runtime --all-features310 passed, 0 failed, 0 ignored, plus 1 doctest.preset_with_components_overrides_a_seamproves the substituted logs builder drives the launch's component build exactly once, then the launch bails on the empty module set.e2e_preset_with_components_launches_through_overridden_logsruns a full preset-path launch reading the overridden pipeline and stops it via the trigger-to-wait handshake; it skips when theexample.wasmfixture is not built.All commands run under
nix developon the CI-pinned rustc 1.94.0.AI Assistance
Implemented, reviewed and verified with Claude Code (Opus).
Closes #509