aptos-labs / aptos-core

Aptos is a layer 1 blockchain built to support the widespread use of blockchain through better technology and user experience.
https://aptosfoundation.org
Other
5.89k stars 3.56k forks source link

[Bug][move-compiler-v2] tests don't report errors in same order as real compiler #13790

Open brmataptos opened 1 week ago

brmataptos commented 1 week ago

🐛 Bug

third_party/move/move-compiler-v2/tests/testsuite.rs checks for fatal errors periodically using check_diags(), dumping accumulated errors.

third_party/move/move-compiler-v2/src/lib.rs checks for errors periodically using check-errors(), dumping accumulated errors.

These checks happen at different intervals in the 2 frameworks, leading to different warning/error output ordering for tests versus real compiler/transactional-tests.

Users benefit from warnings/errors that are more in program order, so delaying output until an error is actually found may allow us to generate more warnings/errors in an ordering that is better for the user.

brmataptos commented 1 week ago

It might be worth also considering https://github.com/aptos-labs/aptos-core/issues/11760 when fixing this problem.