aptos-core
aptos-core copied to clipboard
[Bug] `aptos move compile` results in Rust panic
Repro
Clean everything up:
rm -rf .aptos
rm -rf ~/.move
Make a new directory with this Move.toml
in it:
[package]
name = "AptosInfiniteJukebox"
version = "0.2.1"
upgrade_policy = "compatible"
[dependencies.AptosFramework]
git = 'https://github.com/aptos-labs/aptos-core.git'
rev = 'testnet'
subdir = 'aptos-move/framework/aptos-framework'
[addresses]
AptosInfiniteJukebox = "c40f1c9b9fdc204cf77f68c9bb7029b0abbe8ad9e5561f7794964076a4fbdcfd"
Set sources/AptosInfiniteJukebox.move
to this: https://gist.github.com/banool/14f92342c3216a721959cff5fb911a8a.
You then get this error:
$ aptos move compile
Compiling, may take a little while to download git dependencies...
INCLUDING DEPENDENCY AptosFramework
INCLUDING DEPENDENCY AptosStdlib
INCLUDING DEPENDENCY MoveStdlib
BUILDING AptosInfiniteJukebox
thread 'main' panicked at 'assertion failed: !context.env.has_errors()', /Users/runner/.cargo/git/checkouts/move-0639dd674f581c30/6a32284/language/move-compiler/src/expansion/translate.rs:1190:13
note: run with `RUST_BACKTRACE=1` environment variable to display a backtrace
I'm aware in this case that code in the move file is very outdated. Despite that, I wouldn't expect a panic.
More info:
$ aptos info
{
"Result": {
"build_branch": "main",
"build_cargo_version": "cargo 1.63.0 (fd9c4297c 2022-07-01)",
"build_commit_hash": "01108a2345b87d539d54a67b32db55193f9ace40",
"build_is_release_build": "true",
"build_os": "macos-x86_64",
"build_pkg_version": "1.0.0",
"build_profile_name": "cli",
"build_rust_channel": "1.63.0-x86_64-apple-darwin",
"build_rust_version": "rustc 1.63.0 (4b91a6ea7 2022-08-08)",
"build_tag": "",
"build_time": "2022-10-17 15:45:32 +00:00",
"build_using_tokio_unstable": "true"
}
}
Making sure @runtian-zhou, @wrwg and @vgao1996 see this...
Okay once I just changed public(script)
to public entry
it fixed it, that should hopefully help you figure out how to fix the panic.
This issue is stale because it has been open 45 days with no activity. Remove the stale
label or comment - otherwise this will be closed in 15 days.