Skip to content

fix(client): apply the package override before deriving identity - #250

Merged
mkatychev merged 1 commit into
bytecodealliance:mainfrom
salmans:fix-package-override
Aug 19, 2026
Merged

mkatychev merged 1 commit into
bytecodealliance:mainfrom
salmans:fix-package-override

Conversation

@salmans

@salmans salmans commented Aug 11, 2026

Copy link
Copy Markdown
Contributor

DecodedComponent::from_publishing_source_with_package extracted (package, version) from the decoded binary first and applied the override second, so publish_release_data failed for any binary without an embedded version before the override was consulted. A WIT package without a version that was published with PublishOpts { package: Some(..) } always failed with "version not found", even though that error's help text suggests supplying the identity explicitly.

The change derives the identity from the binary only when no override is supplied. The change left the no-override constructor without callers, so the two constructors are collapsed into one that takes Option<(PackageRef, Version)>; the module is crate-private, so there's no public API change.

@salmans
salmans force-pushed the fix-package-override branch 2 times, most recently from 5b34332 to 35bddb9 Compare August 11, 2026 22:37
The override was applied only after `(package, version)` had been
extracted from the binary, so it could never supply a missing identity —
and a compiled component never has one (it decodes as an unversioned
`root:component`). Extract only when no override is given. The
no-override constructor lost its callers and is folded into the
override-taking one; the module is crate-private, no public API change.
@salmans
salmans force-pushed the fix-package-override branch from 35bddb9 to 721945c Compare August 12, 2026 14:25
@salmans
salmans marked this pull request as ready for review August 18, 2026 19:42
@salmans
salmans requested a review from mkatychev as a code owner August 18, 2026 19:42

@mkatychev mkatychev left a comment

Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

LGTM, this will have to go in once 0.16.1 is released since it's a breaking change in the API

@mkatychev
mkatychev merged commit 5a4c2ab into bytecodealliance:main Aug 19, 2026
3 checks passed
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