-
Notifications
You must be signed in to change notification settings - Fork 8
Support Circular dependency case by inlining the definitions in the stub generator #40
Comments
Thanks for getting on this! I am trying to do a big refactor right now and having this working will be a big help. I built wasm-rpc-stubgen from the latest git sha, and I'm running into this problem: When I run
and when I run
accountant/wit does have a valid I pushed a PR that has my relevant changes but it seems like I have some other changes mixed in by mistake. Will update with a clean PR once I've cleaned that up. I'm wondering if this is because
I will continue to investigate as I have time. Thanks! |
I've fixed up and cleaned the PR, it is here: sameerparekh/sputnik-golem#18 I ran
running a second time gives me the same error but this time at the
|
If workers are spawn from the same component, and these workers need to communicate with each other,
it ends up in a circular dependency case where in each generated stub which depends on the original wit (from which the stub was generated), becomes a dependency to the original wit.
For example, the original wit here is called
timeline-processor.wit
and the generated stub will be_stub.wit
The corresponding generated stub wit will be (obviously)
Now we add this stub as dependency to timeline-processor itself (because we need the communication between workers that were spawned from timeline-processor template)
However whe using the current
golem-cli stubgen add-stub-dependency
(0.62 version), we end up havingtimeline_processor.wit
along with_stub.wit
into the wit dependencies oftimeline-processor
itself, making it a redundant circular dependency.The subsequent
cargo component build
will result in the following errorSolution
The solution is to basically inline the definitions in the original wit (timeline_processor.wit) into the
_stub.wit
that is underwit/deps
in timeline-processor.i.e,
And thereby, not ending up having to paste
timeline-processor.wit
itself in wit/deps, and things will compileThe text was updated successfully, but these errors were encountered: