fix: wasmer-cli - panic when command name shadows dependency entry#6563
Merged
Arshia001 merged 3 commits intowasmerio:mainfrom May 6, 2026
Merged
fix: wasmer-cli - panic when command name shadows dependency entry#6563Arshia001 merged 3 commits intowasmerio:mainfrom
Arshia001 merged 3 commits intowasmerio:mainfrom
Conversation
Contributor
There was a problem hiding this comment.
Pull request overview
This PR addresses a wasmer run failure mode in WASIX package loading where a root command can shadow a dependency command name, yet still point at the dependency’s atom. The change updates package-tree loading and tests so shadowed dependency-backed commands are handled as errors instead of panicking.
Changes:
- Replaced unchecked package/command map indexing in package loading with contextual
get(...).with_context(...)error paths. - Added
packages_needed_for_load()and updated dependency fetching so command owners’ direct dependencies are considered during load. - Re-enabled the resolver shadowing test and added a regression-oriented package-loader test for the shadowed-command scenario.
Reviewed changes
Copilot reviewed 2 out of 2 changed files in this pull request and generated 2 comments.
| File | Description |
|---|---|
lib/wasix/src/runtime/resolver/resolve.rs |
Re-enables and updates the resolver test for root-command shadowing behavior, including entrypoint expectations. |
lib/wasix/src/runtime/package_loader/load_package_tree.rs |
Changes dependency selection and command loading error handling, and adds a regression test around shadowed dependency commands. |
Arshia001
reviewed
May 5, 2026
Member
Arshia001
left a comment
There was a problem hiding this comment.
I'll hold out on reviewing this until the comments from Copilot receive responses, since I find them valid but I'm not immediately super-familiar with this part of the code so I may be wrong.
Arshia001
approved these changes
May 6, 2026
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.
Description
When a package defines a command whose name matches a command exposed by one of its dependencies, Wasmer can resolve the root command correctly but fail later while loading the package tree. In that case, the dependency package may not be fetched even though the root command’s atom annotation points into that dependency, causing the CLI to panic with a missing map entry instead of returning a normal error.
Reproduce with:
Run:
wasmer run .Changes
Updated
load_binary_commandto return user friendly error when command resolving fails due to shadowingReplaced unchecked map indexing with contextual errors to avoid panics
Added a regression test for the dependency command shadowing
Re-enabled and updated the existing resolver test for shadowing