aptos-core
aptos-core copied to clipboard
[Bug][move-compiler-v2] compiler-v2 fails vm_test_harness/example.move test
See
third_party/move/testing-infra/transactional-test-runner/tests/vm_test_harness/example.v2_exp
in #13216 .
There might be some problem with the test harness, but task 4
of the test case fails compilation with MOVE_COMPILER_V2=true
.
This is related to #13392. Namely, the problem is that the transactional tests just simulate publishing code, but don't really publish it anywhere. This means we have to treat the previous code as a "to be compiled" source, but if there is a conflict with the later source we have a problem.
@wrwg @brmataptos, this error happens because when running expansion phase in V2, all modules lib_definitions
are moved to source_definitions
. If a module in lib_definitions
has the same address and same name as an existing module in source_definitions
, the error Duplicate definition for module
will be raised.
We need to test this case when building a new module when there is an existing module of the same name and address on-chain already. Maybe this just works due to the package builder, but we need to test module upgrade cases as would be done by real users.