-
Notifications
You must be signed in to change notification settings - Fork 1.3k
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
upgrade to wasm-tools 210 #8772
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
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 |
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<_>>>()?, | ||
) |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
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.
.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(), |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
With bytecodealliance/wasm-tools#1611 this'll ferry along the pkgs
argument to select_world
which is what we want here.
Lets wait to upgrade until 211 is out. |
@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.