Open posaune0423 opened 1 month ago
Can you assign this one to me?
Hey @posaune0423 thanks for this well described issue.
I think in the case you expose here we're in the 2
solution you propose. When you have a package that depends on an other package dojo-dependent
, your package must also explicitly use dojo, due to the compiler plugin requirement.
That's the main reason why the parsing was done from the Scarb.toml
, so you're right enforcing it should be better in this case. And to enforce, using the Scarb.lock
is definitely the easiest way.
@jancris100 you're feeling ok working on that?
Hello if it's okay, only that I'm on vacations I can start working on it next week
Hello, I'm already here. Do I work on it?
Describe the bug
The
dojo_metadata_from_package
function incrates/dojo-world/src/metadata.rs
fails to detect Dojo dependencies for projects that indirectly depend on Dojo through other packages. This causes issues with projects like application project that use Dojo indirectly through dependencies such as protocol that uses dojo.The current implementation only checks for direct dependencies on
dojo
ordojo_plugin
, missing indirect dependencies and returning default metadata for projects that should have Dojo metadata.To Reproduce
Steps to reproduce the behavior:
sozo print-env
and this just return default value (onlyRPC URL: http://localhost:5050/
)dojo = { git = "https://github.com/dojoengine/dojo", tag = "v1.0.0-alpha.11" }
toScarb.toml
explicitlysozo print-env
, and it output correct metadataExpected behavior
The
dojo_metadata_from_package
function should recursively check for Dojo dependencies in all direct and indirect dependencies of a package. It should correctly identify and process Dojo metadata for projects with indirect Dojo dependencies.Screenshots
None
Additional context
Here, this condition just look at the dependency section in
Scarb.toml
so can't detect indirect dependency right now.https://github.com/dojoengine/dojo/blob/069bc1af6c071f10185c758615f80e631938a741/crates/dojo-world/src/metadata.rs#L75-L84
Proposed solutions:
Use
Scarb.lock
instead ofScarb.toml
for dependency resolution:Scarb.lock
file and checking for anydojo
-related packages.Require explicit declaration of Dojo dependency:
Scarb.toml
.