Skip to content

Commit

Permalink
set default as v2
Browse files Browse the repository at this point in the history
  • Loading branch information
rahxephon89 committed Jan 7, 2025
1 parent f47a384 commit 9b6983d
Show file tree
Hide file tree
Showing 3 changed files with 35 additions and 12 deletions.
6 changes: 4 additions & 2 deletions crates/aptos/src/governance/mod.rs
Original file line number Diff line number Diff line change
Expand Up @@ -983,8 +983,10 @@ impl CompileScriptFunction {
&self.framework_package_args,
prompt_options,
self.bytecode_version,
self.language_version,
self.compiler_version,
self.language_version
.or_else(|| Some(LanguageVersion::latest_stable())),
self.compiler_version
.or_else(|| Some(CompilerVersion::latest_stable())),
)
}
}
Expand Down
9 changes: 7 additions & 2 deletions crates/aptos/src/move_tool/coverage.rs
Original file line number Diff line number Diff line change
Expand Up @@ -16,6 +16,7 @@ use move_coverage::{
summary::summarize_inst_cov,
};
use move_disassembler::disassembler::Disassembler;
use move_model::metadata::{CompilerVersion, LanguageVersion};
use move_package::{compilation::compiled_package::CompiledPackage, BuildConfig, CompilerConfig};

/// Display a coverage summary for all modules in a package
Expand Down Expand Up @@ -175,8 +176,12 @@ fn compile_coverage(
move_options.bytecode_version,
move_options.language_version,
),
compiler_version: move_options.compiler_version,
language_version: move_options.language_version,
compiler_version: move_options
.compiler_version
.or_else(|| Some(CompilerVersion::latest_stable())),
language_version: move_options
.language_version
.or_else(|| Some(LanguageVersion::latest_stable())),
experiments: experiments_from_opt_level(&move_options.optimize),
},
..Default::default()
Expand Down
32 changes: 24 additions & 8 deletions crates/aptos/src/move_tool/mod.rs
Original file line number Diff line number Diff line change
Expand Up @@ -564,8 +564,14 @@ impl CliCommand<&'static str> for TestPackage {
self.move_options.bytecode_version,
self.move_options.language_version,
),
compiler_version: self.move_options.compiler_version,
language_version: self.move_options.language_version,
compiler_version: self
.move_options
.compiler_version
.or_else(|| Some(CompilerVersion::latest_stable())),
language_version: self
.move_options
.language_version
.or_else(|| Some(LanguageVersion::latest_stable())),
experiments: experiments_from_opt_level(&self.move_options.optimize),
},
..Default::default()
Expand Down Expand Up @@ -717,8 +723,12 @@ impl CliCommand<&'static str> for DocumentPackage {
move_options.bytecode_version,
move_options.language_version,
),
compiler_version: move_options.compiler_version,
language_version: move_options.language_version,
compiler_version: move_options
.compiler_version
.or_else(|| Some(CompilerVersion::latest_stable())),
language_version: move_options
.language_version
.or_else(|| Some(LanguageVersion::latest_stable())),
skip_attribute_checks: move_options.skip_attribute_checks,
check_test_code: move_options.check_test_code,
known_attributes: extended_checks::get_all_attribute_names().clone(),
Expand Down Expand Up @@ -900,8 +910,12 @@ impl IncludedArtifacts {
let override_std = move_options.override_std.clone();
let bytecode_version =
fix_bytecode_version(move_options.bytecode_version, move_options.language_version);
let compiler_version = move_options.compiler_version;
let language_version = move_options.language_version;
let compiler_version = move_options
.compiler_version
.or_else(|| Some(CompilerVersion::latest_stable()));
let language_version = move_options
.language_version
.or_else(|| Some(LanguageVersion::latest_stable()));
let skip_attribute_checks = move_options.skip_attribute_checks;
let check_test_code = move_options.check_test_code;
let optimize = move_options.optimize.clone();
Expand All @@ -910,8 +924,10 @@ impl IncludedArtifacts {
experiments.append(&mut more_experiments);

if matches!(
move_options.compiler_version,
Option::None | Some(CompilerVersion::V1)
move_options
.compiler_version
.or_else(|| Some(CompilerVersion::latest_stable())),
Some(CompilerVersion::V1)
) {
if !matches!(optimize, Option::None | Some(OptimizationLevel::Default)) {
return Err(CliError::CommandArgumentError(
Expand Down

0 comments on commit 9b6983d

Please sign in to comment.