Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

[CLI] Set Move 2 as default in Aptos CLI and add move-1 flag #15431

Open
wants to merge 2 commits into
base: main
Choose a base branch
from

Conversation

rahxephon89
Copy link
Contributor

@rahxephon89 rahxephon89 commented Nov 30, 2024

Description

This PR

  • sets Compiler v2 as the default compiler and Move 2 as the default language version except for aptos governance.
  • adds new --move-1 flag to use Compiler v1 and Move 1.

Note that for the command aptos governance, --move-2 is still required for using Move 2.

Close #14441

How Has This Been Tested?

Manually test aptos move compile and aptos move publish will compile and publish modules generated by compiler v2.

Manually test aptos move compile --move-1 and aptos move publish --move-1 will compile and publish modules generated by compiler v1.

Manually test aptos move compile --move-2 and aptos move publish --move-2 will compile and publish modules generated by compiler v2.

Manually test aptos move test with: (a) --move-2, (b) --move-1, (c) neither. (a) and (c) does not panic on MVC_BLOCK_V1=1 while (b) does.

Key Areas to Review

Whether this change covers all the use cases of using the compiler except for governance.

Type of Change

  • New feature
  • Bug fix
  • Breaking change
  • Performance improvement
  • Refactoring
  • Dependency update
  • Documentation update
  • Tests

Which Components or Systems Does This Change Impact?

  • Validator Node
  • Full Node (API, Indexer, etc.)
  • Move/Aptos Virtual Machine
  • Aptos Framework
  • Aptos CLI/SDK
  • Developer Infrastructure
  • Move Compiler
  • Other (specify)

Checklist

  • I have read and followed the CONTRIBUTING doc
  • I have performed a self-review of my own code
  • I have commented my code, particularly in hard-to-understand areas
  • I identified and added all stakeholders and component owners affected by this change as reviewers
  • I tested both happy and unhappy path of the functionality
  • I have made corresponding changes to the documentation

Copy link

trunk-io bot commented Nov 30, 2024

⏱️ 1h 13m total CI duration on this PR
Job Cumulative Duration Recent Runs
rust-move-tests 13m 🟩
rust-move-tests 12m 🟩
rust-move-tests 12m 🟩
rust-cargo-deny 9m 🟩🟩🟩🟩 (+1 more)
check-dynamic-deps 9m 🟩🟩🟩🟩🟩 (+1 more)
rust-move-tests 6m
rust-move-tests 4m
general-lints 3m 🟩🟩🟩🟩🟩 (+1 more)
semgrep/ci 2m 🟩🟩🟩🟩🟩 (+1 more)
file_change_determinator 1m 🟩🟩🟩🟩🟩 (+1 more)
rust-move-tests 46s
permission-check 20s 🟩🟩🟩🟩🟩 (+2 more)
permission-check 18s 🟩🟩🟩🟩🟩 (+2 more)

settingsfeedbackdocs ⋅ learn more about trunk.io

@rahxephon89 rahxephon89 force-pushed the teng/add-move-1-flags branch 3 times, most recently from f2cbfa0 to 66949be Compare November 30, 2024 05:52
@rahxephon89 rahxephon89 changed the title [CLI][WIP] Set Move 2 as default in Aptos CLI and add move-1 flag [CLI] Set Move 2 as default in Aptos CLI and add move-1 flag Nov 30, 2024
@rahxephon89 rahxephon89 marked this pull request as ready for review November 30, 2024 08:01
@@ -1163,25 +1164,33 @@ pub struct MovePackageDir {

/// ...or --compiler COMPILER_VERSION
/// Specify the version of the compiler.
/// Defaults to `1`, unless `--move-2` is selected.
/// Defaults to the latest stable compiler version
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Perhaps note that this is (at least 2), since if you're not a compiler developer you don't know that 2 is stable.

verbatim_doc_comment)]
pub compiler_version: Option<CompilerVersion>,

/// ...or --language LANGUAGE_VERSION
/// Specify the language version to be supported.
/// Defaults to `1`, unless `--move-2` is selected.
/// Defaults to the latest stable language version
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Again here, note (at least 2).

#[clap(long, value_parser = clap::value_parser!(CompilerVersion),
alias = "compiler",
default_value = LATEST_STABLE_COMPILER_VERSION,
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

You may want to address #14441 and close it with this PR.

default_value_if("move_2", "true", LATEST_STABLE_COMPILER_VERSION),
default_value_if("move_1", "true", "1"),
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Could we also (at least manually) test: aptos move test and coverage, with: (a) --move-2, (b) --move-1, (c) neither. (a) and (c) should not panic on `MVC_BLOCK_V1=1, whereas (b) should.

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

done

@@ -909,7 +909,6 @@ impl IncludedArtifacts {
experiments.append(&mut move_options.experiments.clone());
experiments.append(&mut more_experiments);

// TODO(#14441): Remove `None |` here when we update default CompilerVersion
Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

This comment is removed because LATEST_STABLE_COMPILER_VERSION is set as the default value cc @brmataptos @vineethk

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

[Bug][move-compiler-v2] Updates needed when we change compiler default to V2
3 participants