-
Notifications
You must be signed in to change notification settings - Fork 8
Conversation
Testing in progress |
wasm-rpc-stubgen/src/lib.rs
Outdated
@@ -295,6 +310,7 @@ pub fn add_stub_dependency(args: AddStubDependencyArgs) -> anyhow::Result<()> { | |||
// If stub generated world points to the destination world (meaning the destination still owns the world for which the stub is generated), | |||
// we re-generation of stub with inlined types and copy the inlined stub to the destination | |||
if dest_owns_stub_world(&world_name, &destination_wit_root) { | |||
dbg!("Is destination owning stub world"); |
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.
Will remove once testing is finished
wasm-rpc-stubgen/src/lib.rs
Outdated
|
||
if internal::is_invalid_dependency(&destination_wit_root, &parsed) { | ||
println!( | ||
"Skipping the copy of cyclic dependencies {} to the the same as {}", |
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.
Fix this message
wasm-rpc-stubgen/src/lib.rs
Outdated
|
||
// For those dependencies we add to the source, if they, by any chance, imports from the skipped/invalid dependencies (basically they are destination_wit package itself) | ||
// we simply replace. This is the reasoning | ||
// The dependencies we import never logically end up using these imports in the WIT files. |
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.
Make the comment more clear
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.
Minor comment
Ok(re.replace_all(&read_data, "").to_string()) | ||
} | ||
|
||
pub fn get_file_name(path: &PathBuf) -> anyhow::Result<String> { |
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.
Not blocking at all, but there's no need to use String here, we can just use the PathBuf. I think we'd need to update the enum case WitAction::WriteWit
to use PathBuf as a field instead of String.
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.
and take &Path
as input
https://github.com/afsalthaj/testwasmrpc/tree/transitive_dependency
The above tested code has
caller
,callee
(and acallee2
which isn't significant here)And the following scenarios have been tested with this change
caller
depends oncallee-stub
callee
in turn depends oncaller-stub
caller
depends oncaller-stub
itself (just to see we are not regressing this fix that was done earlier - it shouldn't)cargo make build-flow
after code changes (i.e, adding imports and adding actual usage) is also done. Multiple runs are important as there are state changes after the first run.The PR #42 hasn't tried to solve transitive dependency case, and it looks like much more easier than the direct-cyclic dependency case. There is no logical intervention into the direct cyclic dependency fix in this PR, still I have included that in the test case.