Hey everyone, I’m running into an annoying issue when using Automated Address Management in combination with package dependencies.
Suppose you have two packages, package_A and package_B, both using Automated Address Management. Hence, both packages will have their address set to “0x0” in Move.toml and the package addresses will be tracked automatically in Move.lock.
If you then create a dependency from package_A->package_B, either locally or using git, then everything should still work and you can start importing package_B modules using the “use” statement. e.g. “use package_B::module_name”.
However, this stops working if you have the same module names in package_A and package_B. In my use case, both packages have a module called “state”. You would expect that you can simply use “package_A::state” and “package_B::state” but this is not the case. Instead, the compiler throws an error “error[E02001]: duplicate declaration, item, or annotation”. And the VScode extension simply stops working altogether.
As a workaround I can set one of my packages to another address, e.g. “0x123”, do the development, and then set it back to “0x0” when I’m ready to deploy. However, as you can imagine, this is quite a hassle.
Alternatively I can rename one of the modules to avoid the name clash altogether. However, this does not seem like a scalable solution.
This issue can become very frustrating when working with a larger number of dependencies, or dependencies that you cannot control. Anyone else having these issues or has a better work-around than I do?