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

fix some warnings #4174

Merged
merged 2 commits into from
Aug 6, 2024
Merged

fix some warnings #4174

merged 2 commits into from
Aug 6, 2024

Conversation

simonjiao
Copy link
Collaborator

@simonjiao simonjiao commented Aug 6, 2024

Silence warnings like below:

/home/ubuntu//.cargo/bin/cargo fmt -- --check

warning: /home/ubuntu/actions-runner/_work/starcoin/starcoin/.cargo/config is deprecated in favor of config.toml

Warning: note: if you need to support cargo 1.38 or earlier, you can symlink config to config.toml

Pull request type

Please check the type of change your PR introduces:

  • Bugfix
  • Feature
  • Code style update (formatting, renaming)
  • Refactoring (no functional changes, no api changes)
  • Build related changes
  • Documentation content changes
  • Other (please describe):

What is the current behavior?

Issue Number: N/A

What is the new behavior?

Other information

Summary by CodeRabbit

Summary by CodeRabbit

  • Chores
    • Updated the installation script for the Mold linker to append configuration to a standardized .cargo/config.toml file, improving alignment with common Rust practices.
    • Corrected test functions to accurately target .cargo/config.toml in version control checks, ensuring proper functionality in handling configuration file paths.

Copy link

coderabbitai bot commented Aug 6, 2024

Walkthrough

The update refines the configuration management in the setup script by directing output to .cargo/config.toml, aligning with Rust's standard practices for configuration files. Additionally, similar adjustments are made across test files to ensure consistency in handling the configuration file path. These modifications uphold the existing logic while enhancing clarity and correctness in the codebase.

Changes

Files Change Summary
scripts/dev_setup.sh Changed output redirection from .cargo/config to .cargo/config.toml for Mold linker installation.
genesis/tests/generated_files.rs, rpc/api/src/tests.rs, vm/stdlib/tests/generated_files.rs Updated string replacement from "M .cargo/config" to "M .cargo/config.toml" in version control checks.

Poem

In the burrow deep and bright,
A script now shines, oh what a sight!
Configs change with great delight,
Rusty paths, all set just right.
Hops of joy, the code will flow,
With every change, we learn and grow! 🐇✨


Thank you for using CodeRabbit. We offer it for free to the OSS community and would appreciate your support in helping us grow. If you find it useful, would you consider giving us a shout-out on your favorite social media?

Share
Tips

Chat

There are 3 ways to chat with CodeRabbit:

  • Review comments: Directly reply to a review comment made by CodeRabbit. Example:
    • I pushed a fix in commit <commit_id>.
    • Generate unit testing code for this file.
    • Open a follow-up GitHub issue for this discussion.
  • Files and specific lines of code (under the "Files changed" tab): Tag @coderabbitai in a new review comment at the desired location with your query. Examples:
    • @coderabbitai generate unit testing code for this file.
    • @coderabbitai modularize this function.
  • PR comments: Tag @coderabbitai in a new PR comment to ask questions about the PR branch. For the best results, please provide a very specific query, as very limited context is provided in this mode. Examples:
    • @coderabbitai generate interesting stats about this repository and render them as a table.
    • @coderabbitai show all the console.log statements in this repository.
    • @coderabbitai read src/utils.ts and generate unit testing code.
    • @coderabbitai read the files in the src/scheduler package and generate a class diagram using mermaid and a README in the markdown format.
    • @coderabbitai help me debug CodeRabbit configuration file.

Note: Be mindful of the bot's finite context window. It's strongly recommended to break down tasks such as reading entire modules into smaller chunks. For a focused discussion, use review comments to chat about specific files and their changes, instead of using the PR comments.

CodeRabbit Commands (invoked as PR comments)

  • @coderabbitai pause to pause the reviews on a PR.
  • @coderabbitai resume to resume the paused reviews.
  • @coderabbitai review to trigger an incremental review. This is useful when automatic reviews are disabled for the repository.
  • @coderabbitai full review to do a full review from scratch and review all the files again.
  • @coderabbitai summary to regenerate the summary of the PR.
  • @coderabbitai resolve resolve all the CodeRabbit review comments.
  • @coderabbitai configuration to show the current CodeRabbit configuration for the repository.
  • @coderabbitai help to get help.

Additionally, you can add @coderabbitai ignore anywhere in the PR description to prevent this PR from being reviewed.

CodeRabbit Configuration File (.coderabbit.yaml)

  • You can programmatically configure CodeRabbit by adding a .coderabbit.yaml file to the root of your repository.
  • Please see the configuration documentation for more information.
  • If your editor has YAML language server enabled, you can add the path at the top of this file to enable auto-completion and validation: # yaml-language-server: $schema=https://coderabbit.ai/integrations/schema.v2.json

Documentation and Community

  • Visit our Documentation for detailed information on how to use CodeRabbit.
  • Join our Discord Community to get help, request features, and share feedback.
  • Follow us on X/Twitter for updates and announcements.

Copy link

@coderabbitai coderabbitai bot left a comment

Choose a reason for hiding this comment

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

Actionable comments posted: 0

Review details

Configuration used: CodeRabbit UI
Review profile: CHILL

Commits

Files that changed from the base of the PR and between 3ba2211 and 3e120f1.

Files selected for processing (1)
  • scripts/dev_setup.sh (1 hunks)
Additional comments not posted (1)
scripts/dev_setup.sh (1)

571-571: LGTM! But verify the function usage in the codebase.

The change aligns with Rust's best practices for configuration file formats.

However, ensure that all references to .cargo/config have been updated to .cargo/config.toml in the codebase.

@simonjiao
Copy link
Collaborator Author

Silence warnings like below:

/home/ubuntu//.cargo/bin/cargo fmt -- --check

warning: /home/ubuntu/actions-runner/_work/starcoin/starcoin/.cargo/config is deprecated in favor of config.toml

Warning: note: if you need to support cargo 1.38 or earlier, you can symlink config to config.toml

@nkysg nkysg enabled auto-merge (squash) August 6, 2024 03:49
Copy link

github-actions bot commented Aug 6, 2024

Benchmark for ec0d042

Click to view benchmark
Test Base PR %
accumulator_append 799.3±144.51µs 767.9±83.82µs -3.93%
block_apply/block_apply_10 383.7±27.17ms 367.4±8.89ms -4.25%
block_apply/block_apply_1000 41.9±1.44s 39.4±1.30s -5.97%
get_with_proof/db_store 47.9±3.04µs 46.7±3.77µs -2.51%
get_with_proof/mem_store 39.0±6.90µs 36.1±0.81µs -7.44%
put_and_commit/db_store/1 117.9±7.52µs 122.5±11.74µs +3.90%
put_and_commit/db_store/10 1043.3±83.63µs 1024.0±54.20µs -1.85%
put_and_commit/db_store/100 9.3±0.54ms 9.4±0.60ms +1.08%
put_and_commit/db_store/5 544.3±54.28µs 547.4±50.83µs +0.57%
put_and_commit/db_store/50 5.0±0.59ms 4.9±0.43ms -2.00%
put_and_commit/mem_store/1 73.4±7.21µs 71.3±6.37µs -2.86%
put_and_commit/mem_store/10 679.5±60.86µs 692.6±95.24µs +1.93%
put_and_commit/mem_store/100 6.7±0.64ms 6.4±0.30ms -4.48%
put_and_commit/mem_store/5 336.8±28.67µs 350.1±50.20µs +3.95%
put_and_commit/mem_store/50 3.2±0.14ms 3.3±0.38ms +3.13%
query_block/query_block_in(10)_times(100) 5.2±0.98ms 4.5±0.15ms -13.46%
query_block/query_block_in(10)_times(1000) 46.9±5.17ms 46.3±3.14ms -1.28%
query_block/query_block_in(10)_times(10000) 454.7±31.56ms 454.6±14.53ms -0.02%
query_block/query_block_in(1000)_times(100) 1104.6±14.97µs 1184.4±86.91µs +7.22%
query_block/query_block_in(1000)_times(1000) 11.2±0.30ms 11.5±0.23ms +2.68%
query_block/query_block_in(1000)_times(10000) 114.1±3.91ms 119.2±8.32ms +4.47%
storage_transaction 1107.9±423.49µs 1132.4±448.58µs +2.21%
vm/transaction_execution/1 411.7±5.82ms 424.5±25.07ms +3.11%
vm/transaction_execution/10 133.8±9.89ms 151.0±8.78ms +12.86%
vm/transaction_execution/20 124.0±3.42ms 153.9±18.90ms +24.11%
vm/transaction_execution/5 168.6±9.79ms 172.0±21.36ms +2.02%
vm/transaction_execution/50 154.1±12.18ms 160.2±13.58ms +3.96%

@simonjiao simonjiao requested a review from jolestar as a code owner August 6, 2024 08:01
Copy link

@coderabbitai coderabbitai bot left a comment

Choose a reason for hiding this comment

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

Actionable comments posted: 0

Review details

Configuration used: CodeRabbit UI
Review profile: CHILL

Commits

Files that changed from the base of the PR and between 3e120f1 and 62bd426.

Files selected for processing (3)
  • genesis/tests/generated_files.rs (1 hunks)
  • rpc/api/src/tests.rs (1 hunks)
  • vm/stdlib/tests/generated_files.rs (1 hunks)
Files skipped from review due to trivial changes (1)
  • vm/stdlib/tests/generated_files.rs
Additional comments not posted (2)
genesis/tests/generated_files.rs (1)

14-15: LGTM! The change aligns with the deprecation warning.

The modification correctly updates the string replacement to "M .cargo/config.toml", addressing the deprecation warning.

rpc/api/src/tests.rs (1)

44-45: LGTM! The change aligns with the deprecation warning.

The modification correctly updates the string replacement to "M .cargo/config.toml", addressing the deprecation warning.

@nkysg nkysg removed the request for review from jolestar August 6, 2024 08:14
@nkysg nkysg merged commit 10da414 into dag-master Aug 6, 2024
4 of 5 checks passed
@nkysg nkysg deleted the fix-cargo-config-warning branch August 6, 2024 08:42
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.

2 participants