-
Notifications
You must be signed in to change notification settings - Fork 1k
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
chore(ci): Add --locked
flag to cargo install
step
#3129
Conversation
Installing binaries with their locked dependency versions makes it less likely that you might run into issues caused by bugs in dependency libraries, since your installed dependency versions match the versions used in the binary's own test environment. This is a recommendation that applies to most Rust binary tools. For example, here's cargo-nextest recommending the same: https://nexte.st/book/installing-from-source.html#installing-from-cratesio
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Thanks for sending this patch!
We don't have a Cargo.lock
file in this repository but I guess we would restore one from cache but in that case, we would be restoring the binary too.
Is this flag going to make a difference in that case?
I believe this is asking cargo to use the
So I believe it's still desirable, it doesn't matter that this repo doesn't have a |
Awesome, thanks for pointing this out! TIL :) |
--locked
flag to cargo install
step.--locked
flag to cargo install
step
Should I be worried that the crates.io-published It seems that |
No need to worry, that is a different issue I am fixing: #3131
Interesting. We do intend to publish it with the next release. The way I am intending to workaround this at the moment is: https://github.com/libp2p/rust-libp2p/blob/6d61142007165132e74ee437f3c9c9c41598b125/.github/workflows/ci.yml#LL71C9-L71C9 |
obi1kenobi/cargo-semver-checks#146 is a tricky one, and I'm not sure what the right answer is at the moment. On one hand, obviously it's unfortunate that this use case needs the workaround. On the other, It's impossible in So making obi1kenobi/cargo-semver-checks#146 just pass (even while logging a warning) doesn't quite seem to live up to the user's expectations just as much as not passing fails to live up to them as well. |
@thomaseizinger based you adding the |
This pull request has merge conflicts. Could you please resolve them @obi1kenobi? 🙏 |
|
||
test "$ALL_FEATURES = $FULL_FEATURE" | ||
|
||
echo "$ALL_FEATURES"; | ||
echo "$FULL_FEATURE"; | ||
|
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Sorry, these are just my editor stripping trailing whitespace. If they bother you, I can look into making it not do this for this file.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
That is fine, thanks! :)
I was wondering why it didn't do it yet haha |
Description
This PR tweaks the installation of
cargo-semver-checks
to make it use the--locked
flag.Installing binaries with their locked dependency versions makes it less likely that you might run into issues caused by bugs in dependency libraries, since your installed dependency versions match the versions used in the binary's own test environment.
This is a recommendation that applies to most Rust binary tools. For example, here's cargo-nextest recommending the same: https://nexte.st/book/installing-from-source.html#installing-from-cratesio
Notes
I don't think this should have any immediate impact on the project one way or another. It's primarily about protecting from possible future issues that could manifest as "
cargo-semver-checks
is misbehaving" and may be tedious to debug, hence best avoided altogether.Links to any relevant issues
Open Questions
Change checklist