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] Add compiler-message-format-json experiment value to aptos move compile and aptos move lint #15540

Merged
merged 18 commits into from
Dec 23, 2024

Conversation

mkurnikov
Copy link
Collaborator

@mkurnikov mkurnikov commented Dec 8, 2024

Description

Adds an compiler experiment flag compiler-message-format-json to replace codespan formatted compiler errors with structured unformatted JSON.

aptos move compile --experiments compiler-message-format-json

It's supposed to only be consumed by the other tools like IDEs.

How Has This Been Tested?

Added a couple of tests to move-compiler-v2/tests/compiler-message-format-json.

Key Areas to Review

Adds Emitter trait, which has two impls, HumanEmitter and JsonEmitter. HumanEmitter just wraps the existing codespan_reporting::term::emit() calls, and it's a default, so there should be no changes to the existing tests.
JsonEmitter serializes compiler errors in the json format for external tools (i.e. Move on Aptos Intellij plugin) to use. It's enabled with the Experiment::MESSAGE_FORMAT_JSON.

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 Dec 8, 2024

⏱️ 11s total CI duration on this PR

Job Cumulative Duration Recent Runs
permission-check 6s 🟥🟥
permission-check 5s 🟥🟥

settingsfeedbackdocs ⋅ learn more about trunk.io

@mkurnikov mkurnikov marked this pull request as ready for review December 18, 2024 15:23
@mkurnikov mkurnikov requested a review from vineethk December 18, 2024 15:39
@mkurnikov mkurnikov changed the title [CLI] Add --message-format to aptos move compile and aptos move lint [CLI] Add message-format-json experiment value to aptos move compile and aptos move lint Dec 18, 2024
@mkurnikov mkurnikov changed the title [CLI] Add message-format-json experiment value to aptos move compile and aptos move lint [CLI] Add compiler-message-format-json experiment value to aptos move compile and aptos move lint Dec 19, 2024
@mkurnikov mkurnikov changed the title [CLI] Add compiler-message-format-json experiment value to aptos move compile and aptos move lint [WIP][CLI] Add compiler-message-format-json experiment value to aptos move compile and aptos move lint Dec 19, 2024
@mkurnikov mkurnikov changed the title [WIP][CLI] Add compiler-message-format-json experiment value to aptos move compile and aptos move lint [CLI] Add compiler-message-format-json experiment value to aptos move compile and aptos move lint Dec 19, 2024
Copy link
Contributor

@vineethk vineethk left a comment

Choose a reason for hiding this comment

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

I have left some more comments, but this is looking good in general.

Could you please update the PR description regarding whether this is still a WIP, and any notes on testing?

@mkurnikov
Copy link
Collaborator Author

@vineethk Thanks for the review! I addressed your comments, changed the description and added some tests.

@vineethk vineethk self-requested a review December 23, 2024 14:03
Copy link
Contributor

@vineethk vineethk left a comment

Choose a reason for hiding this comment

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

LGTM!

@vineethk
Copy link
Contributor

@mkurnikov Looks like the lint checks are failing because of missing license headers: https://github.com/aptos-labs/aptos-core/actions/runs/12445881990/job/34799996744?pr=15540. Could you please add the following to the top of the newly added source files:

// Copyright © Aptos Foundation
// SPDX-License-Identifier: Apache-2.0

@vineethk vineethk added the CICD:run-e2e-tests when this label is present github actions will run all land-blocking e2e tests from the PR label Dec 23, 2024
@vineethk vineethk enabled auto-merge (squash) December 23, 2024 16:31

This comment has been minimized.

This comment has been minimized.

Copy link
Contributor

✅ Forge suite compat success on 6593fb81261f25490ffddc2252a861c994234c2a ==> 8aa53e8937a4b027fe226b65d57e6524db308188

Compatibility test results for 6593fb81261f25490ffddc2252a861c994234c2a ==> 8aa53e8937a4b027fe226b65d57e6524db308188 (PR)
1. Check liveness of validators at old version: 6593fb81261f25490ffddc2252a861c994234c2a
compatibility::simple-validator-upgrade::liveness-check : committed: 18333.54 txn/s, latency: 1903.25 ms, (p50: 1800 ms, p70: 2100, p90: 2400 ms, p99: 2700 ms), latency samples: 594800
2. Upgrading first Validator to new version: 8aa53e8937a4b027fe226b65d57e6524db308188
compatibility::simple-validator-upgrade::single-validator-upgrading : committed: 8235.59 txn/s, latency: 3678.33 ms, (p50: 3700 ms, p70: 3900, p90: 4200 ms, p99: 4300 ms), latency samples: 149020
compatibility::simple-validator-upgrade::single-validator-upgrade : committed: 8320.61 txn/s, latency: 3954.24 ms, (p50: 4200 ms, p70: 4300, p90: 4300 ms, p99: 4600 ms), latency samples: 286440
3. Upgrading rest of first batch to new version: 8aa53e8937a4b027fe226b65d57e6524db308188
compatibility::simple-validator-upgrade::half-validator-upgrading : committed: 8444.80 txn/s, latency: 3534.54 ms, (p50: 3900 ms, p70: 4200, p90: 4600 ms, p99: 4700 ms), latency samples: 157020
compatibility::simple-validator-upgrade::half-validator-upgrade : committed: 8456.58 txn/s, latency: 3955.58 ms, (p50: 4300 ms, p70: 4400, p90: 4500 ms, p99: 4900 ms), latency samples: 281060
4. upgrading second batch to new version: 8aa53e8937a4b027fe226b65d57e6524db308188
compatibility::simple-validator-upgrade::rest-validator-upgrading : committed: 12624.25 txn/s, latency: 2325.96 ms, (p50: 2600 ms, p70: 2800, p90: 2900 ms, p99: 2900 ms), latency samples: 218480
compatibility::simple-validator-upgrade::rest-validator-upgrade : committed: 5511.70 txn/s, submitted: 5511.85 txn/s, expired: 0.15 txn/s, latency: 2600.07 ms, (p50: 2700 ms, p70: 2800, p90: 2900 ms, p99: 2900 ms), latency samples: 403749
5. check swarm health
Compatibility test for 6593fb81261f25490ffddc2252a861c994234c2a ==> 8aa53e8937a4b027fe226b65d57e6524db308188 passed
Test Ok

Copy link
Contributor

✅ Forge suite realistic_env_max_load success on 8aa53e8937a4b027fe226b65d57e6524db308188

two traffics test: inner traffic : committed: 15378.04 txn/s, latency: 2588.29 ms, (p50: 2600 ms, p70: 2700, p90: 2700 ms, p99: 3600 ms), latency samples: 5847040
two traffics test : committed: 99.97 txn/s, latency: 1307.75 ms, (p50: 1300 ms, p70: 1300, p90: 1400 ms, p99: 1700 ms), latency samples: 1800
Latency breakdown for phase 0: ["MempoolToBlockCreation: max: 1.520, avg: 1.485", "ConsensusProposalToOrdered: max: 0.280, avg: 0.279", "ConsensusOrderedToCommit: max: 0.289, avg: 0.285", "ConsensusProposalToCommit: max: 0.568, avg: 0.563"]
Max non-epoch-change gap was: 0 rounds at version 0 (avg 0.00) [limit 4], 0.52s no progress at version 2875 (avg 0.19s) [limit 15].
Max epoch-change gap was: 0 rounds at version 0 (avg 0.00) [limit 4], 0.57s no progress at version 1077991 (avg 0.55s) [limit 16].
Test Ok

@vineethk vineethk merged commit f5d0131 into aptos-labs:main Dec 23, 2024
118 of 136 checks passed
georgemitenkov pushed a commit that referenced this pull request Jan 6, 2025
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
CICD:run-e2e-tests when this label is present github actions will run all land-blocking e2e tests from the PR
Projects
None yet
Development

Successfully merging this pull request may close these issues.

3 participants