aptos-core icon indicating copy to clipboard operation
aptos-core copied to clipboard

[Bug][move-compiler-v2] compiler-v2 fails vm_test_harness/example.move test

Open brmataptos opened this issue 9 months ago • 1 comments

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.

brmataptos avatar May 11 '24 02:05 brmataptos

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.

brmataptos avatar May 23 '24 18:05 brmataptos

@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.

rahxephon89 avatar Jun 02 '24 23:06 rahxephon89

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.

brmataptos avatar Jun 11 '24 22:06 brmataptos