Skip to content

.github: Install cargo tools with --locked - #178

Merged
makubacki merged 1 commit into
OpenDevicePartnership:mainfrom
makubacki:rust_tool_cache_install_locked
Jul 21, 2026
Merged

.github: Install cargo tools with --locked#178
makubacki merged 1 commit into
OpenDevicePartnership:mainfrom
makubacki:rust_tool_cache_install_locked

Conversation

@makubacki

Copy link
Copy Markdown
Collaborator

As noted in the cargo-install documentation at:

https://doc.rust-lang.org/cargo/commands/cargo-install.html#dealing-with-the-lockfile

By default, the Cargo.lock file that is included with the package
will be ignored. This means that Cargo will recompute which versions
of dependencies to use, possibly using newer versions that have been
released since the package was published. The --locked flag can be
used to force Cargo to use the packaged Cargo.lock file if it is
available.

This may be useful for ensuring reproducible builds, to use the
exact same set of dependencies that were available when the package
was published. It may also be useful if a newer version of a
dependency is published that no longer builds on your system, or
has other problems. The downside to using --locked is that you will
not receive any fixes or updates to any dependency.

Tool installation has started failing in CI recently because of the reasons noted above. In the current case, a crate is being picked up that requires Rust 1.96.0 while Patina is on 1.95.0.

This change adds the --locked flag to fix the current issue and prevent similar issues in the future.

As noted in the cargo-install documentation at:

https://doc.rust-lang.org/cargo/commands/cargo-install.html#dealing-with-the-lockfile

> By default, the Cargo.lock file that is included with the package
> will be ignored. This means that Cargo will recompute which versions
> of dependencies to use, possibly using newer versions that have been
> released since the package was published. The --locked flag can be
> used to force Cargo to use the packaged Cargo.lock file if it is
> available.
>
> This may be useful for ensuring reproducible builds, to use the
> exact same set of dependencies that were available when the package
> was published. It may also be useful if a newer version of a
> dependency is published that no longer builds on your system, or
> has other problems. The downside to using --locked is that you will
> not receive any fixes or updates to any dependency.

Tool installation has started failing in CI recently because of the
reasons noted above. In the current case, a crate is being picked up
that requires Rust 1.96.0 while Patina is on 1.95.0.

This change adds the `--locked` flag to fix the current issue and
prevent similar issues in the future.

Signed-off-by: Michael Kubacki <michael.kubacki@microsoft.com>
@makubacki
makubacki merged commit 36d8748 into OpenDevicePartnership:main Jul 21, 2026
1 check passed
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.

3 participants