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

tests: Install tools with --locked option #4462

Merged
merged 1 commit into from
Feb 19, 2024

Conversation

zulinx86
Copy link
Contributor

@zulinx86 zulinx86 commented Feb 19, 2024

Changes

Install cargo tools with --locked option.

Reason

Without --locked option, installation cargo tools may fail for some reasons. --locked option is useful for reproducible installation since it ensures to use the exact same set of dependencies.
https://doc.rust-lang.org/cargo/commands/cargo-install.html#dealing-with-the-lockfile

For example, on v1.5 and v1.6, the installation failed due to an older rustc version.

error: failed to compile `cargo-audit v0.20.0`, intermediate artifacts can be found at `/tmp/cargo-installORO8R6`
--
  |  
  | Caused by:
  | package `clap_derive v4.5.0` cannot be built because it requires rustc 1.74 or newer, while the currently active rustc version is 1.70.0
  | Try re-running cargo install with `--locked`
  | error: failed to compile `cargo-deny v0.14.11`, intermediate artifacts can be found at `/tmp/cargo-installioMzbq`
  |  
  | Caused by:
  | package `clap_builder v4.5.1` cannot be built because it requires rustc 1.74 or newer, while the currently active rustc version is 1.70.0
  | Try re-running cargo install with `--locked`
  | error: failed to compile `grcov v0.8.19`, intermediate artifacts can be found at `/tmp/cargo-installOqwGlC`
  |  
  | Caused by:
  | package `clap_derive v4.5.0` cannot be built because it requires rustc 1.74 or newer, while the currently active rustc version is 1.70.0
  | Try re-running cargo install with `--locked`
  | error: failed to compile `cargo-sort v1.0.9`, intermediate artifacts can be found at `/tmp/cargo-install8DeK7Q`
  |  
  | Caused by:
  | package `clap_lex v0.7.0` cannot be built because it requires rustc 1.74 or newer, while the currently active rustc version is 1.70.0
  | Try re-running cargo install with `--locked`
  | Summary Failed to install cargo-audit, cargo-deny, grcov, cargo-sort (see error(s) above).
  | error: some crates failed to install


This is to be backported to v1.5 and v1.6.

License Acceptance

By submitting this pull request, I confirm that my contribution is made under
the terms of the Apache 2.0 license. For more information on following Developer
Certificate of Origin and signing off your commits, please check
CONTRIBUTING.md.

PR Checklist

  • [ ] If a specific issue led to this PR, this PR closes the issue.
  • The description of changes is clear and encompassing.
  • [ ] Any required documentation changes (code and docs) are included in this
    PR.
  • [ ] API changes follow the Runbook for Firecracker API changes.
  • [ ] User-facing changes are mentioned in CHANGELOG.md.
  • All added/changed functionality is tested.
  • [ ] New TODOs link to an issue.
  • Commits meet
    contribution quality standards.

  • This functionality cannot be added in rust-vmm.

@zulinx86 zulinx86 self-assigned this Feb 19, 2024
@zulinx86 zulinx86 added the Status: Awaiting review Indicates that a pull request is ready to be reviewed label Feb 19, 2024
@zulinx86 zulinx86 force-pushed the install_with_locked branch from 1be8016 to 9f8eec4 Compare February 19, 2024 14:58
Copy link

codecov bot commented Feb 19, 2024

Codecov Report

All modified and coverable lines are covered by tests ✅

Comparison is base (c403628) 81.54% compared to head (75afd10) 81.56%.

Additional details and impacted files
@@            Coverage Diff             @@
##             main    #4462      +/-   ##
==========================================
+ Coverage   81.54%   81.56%   +0.02%     
==========================================
  Files         243      243              
  Lines       29542    29542              
==========================================
+ Hits        24089    24095       +6     
+ Misses       5453     5447       -6     
Flag Coverage Δ
4.14-c5n.metal 78.86% <ø> (?)
4.14-c7g.metal ?
4.14-m5d.metal ?
4.14-m5n.metal 78.85% <ø> (?)
4.14-m6a.metal 77.98% <ø> (ø)
4.14-m6g.metal 76.96% <ø> (ø)
4.14-m6i.metal 78.85% <ø> (ø)
4.14-m7g.metal 76.96% <ø> (?)
5.10-c5n.metal 81.52% <ø> (?)
5.10-c7g.metal ?
5.10-m5d.metal ?
5.10-m5n.metal 81.51% <ø> (?)
5.10-m6a.metal 80.74% <ø> (ø)
5.10-m6g.metal 79.85% <ø> (ø)
5.10-m6i.metal 81.51% <ø> (ø)
5.10-m7g.metal 79.85% <ø> (?)
6.1-c5n.metal 81.52% <ø> (?)
6.1-c7g.metal ?
6.1-m5d.metal ?
6.1-m5n.metal 81.51% <ø> (?)
6.1-m6a.metal 80.74% <ø> (ø)
6.1-m6g.metal 79.85% <ø> (ø)
6.1-m6i.metal 81.51% <ø> (ø)
6.1-m7g.metal 79.85% <ø> (?)

Flags with carried forward coverage won't be shown. Click here to find out more.

☔ View full report in Codecov by Sentry.
📢 Have feedback on the report? Share it here.

Copy link
Contributor

@wearyzen wearyzen left a comment

Choose a reason for hiding this comment

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

nit: commit message is missing something either : installation of cargo tools or installing cargo tools

Without `--locked` option, installing cargo tools may fail for some
reasons. `--locked` option is useful for reproducible installation since
it ensures to use the exact same set of dependencies.

Signed-off-by: Takahiro Itazuri <[email protected]>
@zulinx86 zulinx86 force-pushed the install_with_locked branch from 9f8eec4 to 75afd10 Compare February 19, 2024 16:19
@zulinx86 zulinx86 merged commit 8bb8831 into firecracker-microvm:main Feb 19, 2024
7 checks passed
@zulinx86 zulinx86 deleted the install_with_locked branch March 19, 2024 12:07
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Status: Awaiting review Indicates that a pull request is ready to be reviewed
Projects
None yet
Development

Successfully merging this pull request may close these issues.

3 participants