Skip to content

Commit

Permalink
add flag (#15309)
Browse files Browse the repository at this point in the history
  • Loading branch information
rahxephon89 authored Nov 19, 2024
1 parent ef1b310 commit afd596e
Show file tree
Hide file tree
Showing 3 changed files with 12 additions and 2 deletions.
1 change: 1 addition & 0 deletions aptos-move/e2e-move-tests/src/lib.rs
Original file line number Diff line number Diff line change
Expand Up @@ -59,6 +59,7 @@ pub(crate) fn build_package_with_compiler_version(
compiler_version: CompilerVersion,
) -> anyhow::Result<BuiltPackage> {
let mut options = options;
options.language_version = Some(compiler_version.infer_stable_language_version());
options.compiler_version = Some(compiler_version);
BuiltPackage::build(package_path.to_owned(), options)
}
9 changes: 9 additions & 0 deletions third_party/move/move-model/src/metadata.rs
Original file line number Diff line number Diff line change
Expand Up @@ -171,6 +171,15 @@ impl CompilerVersion {
_ => Ok(()),
}
}

/// Infer the latest stable language version based on the compiler version
pub fn infer_stable_language_version(&self) -> LanguageVersion {
if *self == CompilerVersion::V1 {
LanguageVersion::V1
} else {
LanguageVersion::latest_stable()
}
}
}

// ================================================================================'
Expand Down
4 changes: 2 additions & 2 deletions third_party/move/scripts/move_pr.sh
Original file line number Diff line number Diff line change
Expand Up @@ -197,10 +197,10 @@ if [ ! -z "$COMPILER_V2_TEST" ]; then
echo "*************** [move-pr] Running integration tests with compiler v2"
(
cd $BASE
MVC_DOCGEN_OUTPUT_DIR=tests/compiler-v2-doc MOVE_COMPILER_V2=true cargo build $CARGO_OP_PARAMS \
MVC_DOCGEN_OUTPUT_DIR=tests/compiler-v2-doc MOVE_COMPILER_V2=true MOVE_LANGUAGE_V2=true cargo build $CARGO_OP_PARAMS \
$MOVE_CRATES_V2_ENV_DEPENDENT
MVC_DOCGEN_OUTPUT_DIR=tests/compiler-v2-doc \
MOVE_COMPILER_V2=true cargo nextest run $CARGO_NEXTEST_PARAMS \
MOVE_COMPILER_V2=true MOVE_LANGUAGE_V2=true cargo nextest run $CARGO_NEXTEST_PARAMS \
$MOVE_CRATES_V2_ENV_DEPENDENT
)
fi
Expand Down

0 comments on commit afd596e

Please sign in to comment.