From 57efa0fd4020b82e7e12690008ab6603db60cbb8 Mon Sep 17 00:00:00 2001 From: Zhe Wu Date: Tue, 23 Jul 2024 23:17:27 -0700 Subject: [PATCH] Use absolute path --- crates/sui-proc-macros/src/lib.rs | 3 +-- scripts/simtest/cargo-simtest | 3 ++- 2 files changed, 3 insertions(+), 3 deletions(-) diff --git a/crates/sui-proc-macros/src/lib.rs b/crates/sui-proc-macros/src/lib.rs index e460debeae362..4cc49ce52e229 100644 --- a/crates/sui-proc-macros/src/lib.rs +++ b/crates/sui-proc-macros/src/lib.rs @@ -57,8 +57,7 @@ pub fn init_static_initializers(_args: TokenStream, item: TokenStream) -> TokenS use sui_simulator::move_package::package_hooks::register_package_hooks; register_package_hooks(Box::new(SuiPackageHooks {})); - let mut path = PathBuf::from(env!("CARGO_MANIFEST_DIR")); - path.push(env!("SIMTEST_STATIC_INIT_MOVE")); + let mut path = PathBuf::from(env!("SIMTEST_STATIC_INIT_MOVE")); let mut build_config = BuildConfig::default(); build_config.config.install_dir = Some(TempDir::new().unwrap().into_path()); diff --git a/scripts/simtest/cargo-simtest b/scripts/simtest/cargo-simtest index f9ce2ae27da80..57614f76405fe 100755 --- a/scripts/simtest/cargo-simtest +++ b/scripts/simtest/cargo-simtest @@ -98,7 +98,8 @@ export TMPDIR=$(mktemp -d) # Set the example move package for the simtest static initializer # https://github.com/MystenLabs/sui/blob/7bc276d534c6c758ac2cfefe96431c2b1318ca01/crates/sui-proc-macros/src/lib.rs#L52 -export SIMTEST_STATIC_INIT_MOVE="../../examples/move/basics" +root_dir=$(git rev-parse --show-toplevel) +export SIMTEST_STATIC_INIT_MOVE=$root_dir"/examples/move/basics" cargo ${CARGO_COMMAND[@]} \ --config "build.rustflags = [$RUST_FLAGS]" \