Conversation
I don't think that Resolve::select_world has an obvious way to work anymore - how do we select the default packageid when multiple packages can be defined? I used get(0) but this is an arbitrary choice
Member
|
Ah this is something I should have dealt with before publishing. There's some follow-up work to bytecodealliance/wasm-tools#1577 to improve world selection, so let me try to get that in today to update to that. Otherwise |
Comment on lines
-212
to
+226
| Some(resolve.push(UnresolvedPackage::parse("macro-input".as_ref(), inline)?)?) | ||
| let UnresolvedPackageGroup { | ||
| packages, | ||
| source_map, | ||
| } = UnresolvedPackageGroup::parse("macro-input".as_ref(), inline)?; | ||
| Some( | ||
| packages | ||
| .into_iter() | ||
| .map(|p| resolve.push(p, &source_map)) | ||
| .collect::<anyhow::Result<Vec<_>>>()?, | ||
| ) |
Member
There was a problem hiding this comment.
This can be simplified a bit by using Resolve::append instead of iterating over the packages and calling push manually, although that does the same thing too.
Comment on lines
-177
to
+181
| .select_world(pkg, world.as_deref()) | ||
| .select_world( | ||
| *pkgs | ||
| .get(0) | ||
| .ok_or_else(|| Error::new(call_site, "at least one package must be defined"))?, | ||
| world.as_deref(), |
Member
There was a problem hiding this comment.
With bytecodealliance/wasm-tools#1611 this'll ferry along the pkgs argument to select_world which is what we want here.
Contributor
Author
|
Lets wait to upgrade until 211 is out. |
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.
@alexcrichton I don't think that Resolve::select_world has an obvious way to work anymore - how do we select the default packageid when multiple packages can be defined? I used get(0) but this is an arbitrary choice. This comes up in the upgrade of wit-bindgen as well.