fix(runtime): epic train follow-ups (round 2)#277
Closed
mfw78 wants to merge 2 commits into
Closed
Conversation
Return a BuildError naming the failing component slot (chain, store, or extension) from ComponentsBuilder::build, instead of an opaque anyhow::Result. The leaf ComponentBuilder::build stays anyhow because the backends fail for heterogeneous reasons (I/O for the store, network for the chain). Callers that propagate into anyhow keep working through the std::error::Error conversion.
Pass the executor explicitly with .with_executor(&TokioExecutor) in the CLI builder chain, rather than relying on the builder's implicit tokio default. This names the launch root as the point where an embedder or a non-tokio target substitutes its own executor. Behaviour-preserving: the binary still spawns on tokio.
9cf62da to
d0e5c40
Compare
Contributor
Author
|
Superseded by the consolidated follow-up PR #278, which carries this change as a preserved commit. Closing to reduce the outstanding-PR count; the commit history is unchanged. |
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
Two deferred M0 follow-ups from the epic train, one commit each.
BuildErrorfor the component build path.ComponentsBuilder::buildnow returnsResult<Components<T>, BuildError>, whereBuildErrornames the failing slot (Chain,Store, orExt) instead of an opaqueanyhow::Error. The leafComponentBuilder::buildstays onanyhowbecause the backends fail for heterogeneous reasons (I/O for the store, network for the chain), so a single typed cause there would be dishonest. Callers that propagate intoanyhowkeep working through thestd::error::Errorconversionthiserrorderives.run_from_confignow passes.with_executor(&TokioExecutor)in the builder chain rather than relying on the builder's implicit tokio default. This names the launch root as the point where an embedder or a non-tokio target substitutes its own executor. Behaviour-preserving: the binary still spawns on tokio.Why
Both were recognized during the epic train review as realizable clean-ups that were deferred to keep that PR focused. The typed error makes a build failure self-describing at the boundary; the explicit executor call turns an implicit default into a decision made where the launch is composed. Neither changes runtime behaviour.
Testing
cargo clippy -p nexum-runtime -p nexum-cli --all-targetsclean, zero warnings (pinned nix toolchain, rustc 1.94.0).cargo test -p nexum-runtime host::component: 6 passed.cargo test -p nexum-runtime runtime::task: 4 passed.rustfmt --checkclean on all touched files.AI Assistance
AI Assistance: Claude Code (Opus 4.8) used for implementing both commits, verification, and drafting this PR body.