Skip to content
This repository has been archived by the owner on Dec 11, 2024. It is now read-only.

Cyclic dependency from x->y->x returning is_none error #44

Closed
sameerparekh opened this issue Jun 2, 2024 · 1 comment
Closed

Cyclic dependency from x->y->x returning is_none error #44

sameerparekh opened this issue Jun 2, 2024 · 1 comment

Comments

@sameerparekh
Copy link

As a followup to the comments on #40, I created a repro for the x->y->x dependency case using testwasmrpc and I am seeing the is_none error crop up again:

cargo make build-flow
[cargo-make] INFO - cargo make 0.36.3
[cargo-make] INFO - Build File: Makefile.toml
[cargo-make] INFO - Task: build-flow
[cargo-make] INFO - Profile: development
[cargo-make] INFO - Running Task: legacy-migration
[cargo-make] INFO - Execute Command: "cargo-component" "clean"
  Generating bindings for callee (/Users/sameer/workspace/testwasmrpc/callee/src/bindings.rs)
warning: profiles for the non root package will be ignored, specify profiles at the workspace root:
package:   /Users/sameer/workspace/testwasmrpc/callee-stub/Cargo.toml
workspace: /Users/sameer/workspace/testwasmrpc/Cargo.toml
warning: profiles for the non root package will be ignored, specify profiles at the workspace root:
package:   /Users/sameer/workspace/testwasmrpc/caller-stub/Cargo.toml
workspace: /Users/sameer/workspace/testwasmrpc/Cargo.toml
     Removed 840 files, 213.9MiB total
[cargo-make] INFO - Execute Command: "/Users/sameer/workspace/golem/target/debug/golem-cli" "stubgen" "generate" "-s" "callee/wit" "-d" "callee-stub" "--wasm-rpc-path-override" "/Users/sameer/workspace/wasm-rpc/wasm-rpc"
[/Users/sameer/workspace/wasm-rpc/wasm-rpc-stubgen/src/wit.rs:172:5] "The exported world is the selected world for the stub {}." = "The exported world is the selected world for the stub {}."
[/Users/sameer/workspace/wasm-rpc/wasm-rpc-stubgen/src/wit.rs:172:5] world.name.clone() = "callee"
Generating stub WIT to callee-stub/wit/_stub.wit
Copying root package test:callee
  .. callee/wit/callee.wit to callee-stub/wit/deps/test_callee/callee.wit
Writing wasm-rpc.wit to callee-stub/wit/deps/wasm-rpc
Generating Cargo.toml to callee-stub/Cargo.toml
Generating stub source to callee-stub/src/lib.rs
Done
[cargo-make] INFO - Execute Command: "/Users/sameer/workspace/golem/target/debug/golem-cli" "stubgen" "add-stub-dependency" "--stub-wit-root" "callee-stub/wit" "--dest-wit-root" "caller/wit" "--overwrite" "--update-cargo-toml"
Overwriting caller/wit/deps/test_callee
Copying "callee-stub/wit/deps/test_callee" to "caller/wit/deps/test_callee"
Copying "callee-stub/wit/deps/wasm-rpc" to "caller/wit/deps/wasm-rpc"
Writing updated Cargo.toml to "caller/Cargo.toml"
Done
[cargo-make] INFO - Execute Command: "/Users/sameer/workspace/golem/target/debug/golem-cli" "stubgen" "generate" "-s" "caller/wit" "-d" "caller-stub" "--wasm-rpc-path-override" "/Users/sameer/workspace/wasm-rpc/wasm-rpc"
[/Users/sameer/workspace/wasm-rpc/wasm-rpc-stubgen/src/wit.rs:172:5] "The exported world is the selected world for the stub {}." = "The exported world is the selected world for the stub {}."
[/Users/sameer/workspace/wasm-rpc/wasm-rpc-stubgen/src/wit.rs:172:5] world.name.clone() = "caller"
Generating stub WIT to caller-stub/wit/_stub.wit
Copying package golem:[email protected]
  .. caller/wit/deps/wasm-rpc/wasm-rpc.wit to caller-stub/wit/deps/wasm-rpc/wasm-rpc.wit
Copying package test:callee
  .. caller/wit/deps/test_callee/callee.wit to caller-stub/wit/deps/test_callee/callee.wit
Copying package test:callee-stub
  .. caller/wit/deps/test_callee-stub/_stub.wit to caller-stub/wit/deps/test_callee-stub/_stub.wit
Copying package test:caller-stub
Skipping copying stub package test:caller-stub
Copying root package test:caller
  .. caller/wit/caller.wit to caller-stub/wit/deps/test_caller/caller.wit
Writing wasm-rpc.wit to caller-stub/wit/deps/wasm-rpc
Skipping updating WIT dependency for test:caller-stub
Generating Cargo.toml to caller-stub/Cargo.toml
Generating stub source to caller-stub/src/lib.rs
Done
[cargo-make] INFO - Execute Command: "/Users/sameer/workspace/golem/target/debug/golem-cli" "stubgen" "add-stub-dependency" "--stub-wit-root" "caller-stub/wit" "--dest-wit-root" "callee/wit" "--overwrite" "--update-cargo-toml"
Copying "caller-stub/wit/deps/test_callee" to "callee/wit/deps/test_callee"
Copying "caller-stub/wit/deps/wasm-rpc" to "callee/wit/deps/wasm-rpc"
Copying "caller-stub/wit/deps/test_caller" to "callee/wit/deps/test_caller"
Copying "caller-stub/wit/deps/test_callee-stub" to "callee/wit/deps/test_callee-stub"
Writing updated Cargo.toml to "callee/Cargo.toml"
Done
[cargo-make] INFO - Execute Command: "cargo-component" "build"
  Generating bindings for caller (/Users/sameer/workspace/testwasmrpc/caller/src/bindings.rs)
thread 'main' panicked at /Users/sameer/.cargo/registry/src/index.crates.io-6f17d22bba15001f/wit-parser-0.13.1/src/resolve.rs:1034:9:
assertion failed: prev.is_none()
stack backtrace:
   0:        0x102bb4ee4 - <std::sys_common::backtrace::_print::DisplayBacktrace as core::fmt::Display>::fmt::hb478ebbfb46e27ce
   1:        0x102bd6100 - core::fmt::write::he4d5fa2daff1f531
   2:        0x102bb1410 - std::io::Write::write_fmt::hc5a47a68eba63d9f
   3:        0x102bb4d18 - std::sys_common::backtrace::print::h79bd952cc5812e7a
   4:        0x102bb64c0 - std::panicking::default_hook::{{closure}}::h82301f6222887737
   5:        0x102bb6208 - std::panicking::default_hook::h1e49abbb3f1d7dbf
   6:        0x102bb6908 - std::panicking::rust_panic_with_hook::h1e70c5d905e30e9d
   7:        0x102bb67d0 - std::panicking::begin_panic_handler::{{closure}}::h399e32952efd26a4
   8:        0x102bb5368 - std::sys_common::backtrace::__rust_end_short_backtrace::h2ab87f841a2323e7
   9:        0x102bb6584 - _rust_begin_unwind
  10:        0x102c3fd2c - core::panicking::panic_fmt::h33e40d2a93cab78f
  11:        0x102c3fdb4 - core::panicking::panic::h57fd475c037a9df3
  12:        0x10292b3bc - wit_parser::resolve::Remap::append::hf0a4902c2e5efeb3
  13:        0x10293d6fc - wit_parser::ast::SourceMap::rewrite_error::h411a009861a15487
  14:        0x10291f85c - wit_parser::resolve::Resolve::push::h1a01cae65197fed0
  15:        0x10269aa04 - cargo_component::bindings::BindingsGenerator::create_target_world::h64849129f3cc8b9b
  16:        0x102696a54 - cargo_component::bindings::BindingsGenerator::new::h6efaa1a2ada9b9d3
  17:        0x1024b7cc4 - cargo_component::run_cargo_command::{{closure}}::h9a627e9877ab8633
  18:        0x1024ccdac - cargo_component::main::{{closure}}::hb955c16fd1ace6a5
  19:        0x1024c74e0 - tokio::runtime::park::CachedParkThread::block_on::ha1b8d054c8f2a772
  20:        0x1025b4ffc - tokio::runtime::context::runtime::enter_runtime::hea8bb7e9fd218a77
  21:        0x102586df0 - tokio::runtime::runtime::Runtime::block_on::h5494f2a473f673da
  22:        0x10255fdcc - cargo_component::main::h4b2437b0e35f78b7
  23:        0x102574844 - std::sys_common::backtrace::__rust_begin_short_backtrace::h322ab5ba4fd90cb7
  24:        0x10258b544 - std::rt::lang_start::{{closure}}::h99915cb0bfc2b2bb
  25:        0x102ba958c - std::rt::lang_start_internal::hf4f3eb1e51305b96
  26:        0x10255fed4 - _main
[cargo-make] ERROR - Error while executing command, exit code: 101
[cargo-make] WARN - Build Failed.

I made a PR into the testwasmrpc repo with my repro: afsalthaj/testwasmrpc#1

Thanks

@vigoo
Copy link
Contributor

vigoo commented Aug 21, 2024

Closed by #45

@vigoo vigoo closed this as completed Aug 21, 2024
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants