Closed brmataptos closed 1 day ago
I've managed to see this problem intermittently but can't reproduce it reliably. I think that (1) the libraries are being built without #[test_only]
code, but then a user #[test]
function which includes module aptos_framework::function_info
may wind up parsing the #[test_only] friend ...
at the end of that module which refers to a module (function_info_tests
) which doesn't exist in the current compilation environment. The right solution may be to fix the compiler to silently ignore a friend declaration referring to an unknown module.
File aptos-move/framework/aptos/framework/tests/function_info_tests_.move
has:
#[test_only]
module aptos_framework::function_info_tests {
...
}
and file aptos-move/framework/aptos-framework/sources/function_info.move
has:
/// The `function_info` module defines the `FunctionInfo` type which simulates a function pointer.
module aptos_framework::function_info {
...
// Test only dependencies so we can invoke those friend functions.
#[test_only]
friend aptos_framework::function_info_tests;
}
I think the problem is that (1) the #[test_only]
code is excluded from the compiled Aptos Framework, but the
This has been hard to reproduce, but I found it happening in a case where I had files from a previous build/tool left behind in a Move package build/ directory, which were found by the move-package mechanism to search for dependency source files.
We'll close this with 3 followup issues:
aptos move clean
if they have strange problems [#13320],
🐛 Bug
@movekevin reports that a user reports: