Skip to content

upgrade to wasm-tools 210#8772

Closed
pchickey wants to merge 1 commit intomainfrom
pch/bump_wasm_tools_210
Closed

upgrade to wasm-tools 210#8772
pchickey wants to merge 1 commit intomainfrom
pch/bump_wasm_tools_210

Conversation

@pchickey
Copy link
Contributor

@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.

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
@pchickey pchickey requested review from a team as code owners June 11, 2024 02:48
@pchickey pchickey requested review from elliottt and removed request for a team June 11, 2024 02:48
@alexcrichton
Copy link
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 wit_component::resolve_world_from_name is the rough equivalent of what to do but I'd like to change that too.

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<_>>>()?,
)
Copy link
Member

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.

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(),
Copy link
Member

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.

@pchickey
Copy link
Contributor Author

Lets wait to upgrade until 211 is out.

@pchickey pchickey closed this Jun 11, 2024
@alexcrichton alexcrichton deleted the pch/bump_wasm_tools_210 branch October 21, 2025 22:22
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants