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

Require Cargo.lock matches Cargo.toml in CI #290

Merged
merged 2 commits into from
Sep 26, 2023

Conversation

huonw
Copy link
Contributor

@huonw huonw commented Sep 26, 2023

This blocks the mistake I made in #288 / #289, where I updated Cargo.toml and forgot to run a command to update Cargo.lock.

huonw added a commit that referenced this pull request Sep 26, 2023
This was missed from #288, oops!

In #290, I add the appropriate check to CI, to avoid this happening
again.
@huonw
Copy link
Contributor Author

huonw commented Sep 26, 2023

Validating that this does what we expect:

@huonw huonw merged commit bf60d11 into pantsbuild:main Sep 26, 2023
8 checks passed
@huonw huonw deleted the huonw/locked branch September 26, 2023 22:27
huonw added a commit to pantsbuild/pants that referenced this pull request Sep 27, 2023
This passes `--locked` to the first interesting cargo invocations, to
ensure that the `Cargo.lock` file is up to date with `Cargo.toml`.
Without this, if there's been changes to `Cargo.toml` and the user
hasn't run a cargo command locally afterwards, those invocation might
change the `Cargo.lock` file (e.g. bump versions, add packages) and thus
CI runs with an unexpected configuration, that's not recorded in the
repo.

(This came up in pantsbuild/scie-pants#290 and I
thought to check other Rust repos that are tangentially related.)
huonw added a commit to a-scie/jump that referenced this pull request Sep 27, 2023
This passes `--locked` to the first interesting cargo invocation, to
ensure that the `Cargo.lock` file is up to date with `Cargo.toml`.
Without this, if there's been changes to `Cargo.toml` and the user
hasn't run a cargo command locally afterwards, the invocation might
change the `Cargo.lock` file (e.g. bump versions, add packages) and thus
CI runs with an unexpected configuration, that's not recorded in the
repo.

(This came up in pantsbuild/scie-pants#290 and I
thought to check other Rust repos that are tangentially related.)
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