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

ci: use --locked while installing cargo-generate #4578

Merged
merged 1 commit into from
May 22, 2023
Merged

Conversation

kayagokalp
Copy link
Member

@kayagokalp kayagokalp commented May 22, 2023

Description

closes #4577.

Because of an upstream issue in cargo-generate, which can be seen from cargo-generate/cargo-generate#942, our CI is blocked. Until the fix lands we need the --locked flag added to install step.

@kayagokalp kayagokalp added bug Something isn't working ci labels May 22, 2023
@kayagokalp kayagokalp self-assigned this May 22, 2023
@kayagokalp kayagokalp changed the title ci: use --locked while installing cargo-generate ci: use --locked while installing cargo-generate May 22, 2023
@kayagokalp kayagokalp marked this pull request as ready for review May 22, 2023 12:17
@kayagokalp kayagokalp requested review from a team May 22, 2023 12:17
@kayagokalp kayagokalp enabled auto-merge (squash) May 22, 2023 12:18
Copy link
Contributor

@Braqzen Braqzen left a comment

Choose a reason for hiding this comment

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

Coolio, afaik this will throw an error to say that cargo update needs to be run because upstream dependencies have changed

@kayagokalp
Copy link
Member Author

Coolio, afaik this will throw an error to say that cargo update needs to be run because upstream dependencies have changed

Thanks for the ✅, we will remove the --locked once upstream issue is fixed

@kayagokalp kayagokalp merged commit bd31c91 into master May 22, 2023
26 checks passed
@kayagokalp kayagokalp deleted the kayagokalp/4577 branch May 22, 2023 12:32
@mitchmindtree
Copy link
Contributor

Good catch!

I'd recommend keeping the --locked flag going forward - all it does is make sure that the existing Cargo.lock file in our workspace is valid, which helps to make sure that we can build entirely from existing, pinned dependencies in a deterministic manner.

Without --locked, cargo will sometimes automatically update dependencies if e.g. a new dependency was added, but the lock file was not updated. This is a problem as it might end up pulling in a different version each time it gets run, leading to non-determinism in our CI checks.

I wonder if there's a way we can specify some global cargo configuration so that it uses --locked by default in our CI so that we don't have to remember to add --locked to just about every cargo invocation 🤔

@kayagokalp
Copy link
Member Author

Good catch!

I'd recommend keeping the --locked flag going forward - all it does is make sure that the existing Cargo.lock file in our workspace is valid, which helps to make sure that we can build entirely from existing, pinned dependencies in a deterministic manner.

Without --locked, cargo will sometimes automatically update dependencies if e.g. a new dependency was added, but the lock file was not updated. This is a problem as it might end up pulling in a different version each time it gets run, leading to non-determinism in our CI checks.

I wonder if there's a way we can specify some global cargo configuration so that it uses --locked by default in our CI so that we don't have to remember to add --locked to just about every cargo invocation 🤔

That would be superb, quick search yielded following issues:

  1. Cargo config option to default to locked/frozen rust-lang/cargo#8207
  2. Cargo config option to default to locked/frozen rust-lang/cargo#8207

Seems like we don't have a way to do that, but will keep an eye out for a solution we can use 👍

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug Something isn't working ci
Projects
None yet
Development

Successfully merging this pull request may close these issues.

ci: cargo-generate failing to install blocks CI
4 participants