-
Notifications
You must be signed in to change notification settings - Fork 1.4k
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
[14.0.0] Bindgen multi-version support (#7212)
* Support multiple versions in `bindgen!` (#7172) This commit fixes a bug in the `bindgen!` macro where when faced with multiple packages that differ only in version number invalid bindings were generated. The fix here is to add version number information to package module names if necessary in situations such as this. This required some refactoring internally to have a single source of truth for what the name of a module should be and avoid having it implicitly calculated in two locations. * Ensure exports are properly namespaced (#7196) Continuation of #7172 where imports and export _definitions_ are properly namespaced by version by the usage of exports was not. --------- Co-authored-by: Alex Crichton <[email protected]>
- Loading branch information
1 parent
e746081
commit c796ce7
Showing
5 changed files
with
151 additions
and
105 deletions.
There are no files selected for viewing
This file contains 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
5 changes: 5 additions & 0 deletions
5
crates/component-macro/tests/codegen/multiversion/deps/v1/root.wit
This file contains 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
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,5 @@ | ||
package my:dep@0.1.0; | ||
|
||
interface a { | ||
x: func(); | ||
} |
5 changes: 5 additions & 0 deletions
5
crates/component-macro/tests/codegen/multiversion/deps/v2/root.wit
This file contains 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
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,5 @@ | ||
package my:dep@0.2.0; | ||
|
||
interface a { | ||
x: func(); | ||
} |
This file contains 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
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,7 @@ | ||
package foo:bar; | ||
|
||
world foo { | ||
import my:dep/a@0.1.0; | ||
import my:dep/a@0.2.0; | ||
export my:dep/a@0.2.0; | ||
} |
This file contains 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