-
Notifications
You must be signed in to change notification settings - Fork 143
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
feat(cargo): remove dependence on install-update #796
Conversation
Codecov ReportAttention: Patch coverage is
Additional details and impacted files@@ Coverage Diff @@
## main #796 +/- ##
========================================
+ Coverage 6.60% 6.86% +0.25%
========================================
Files 37 37
Lines 12199 11743 -456
========================================
Hits 806 806
+ Misses 11393 10937 -456 ☔ View full report in Codecov by Sentry. |
@SteveLauC can you tell me what the failing test means? Because I cannot even understand what it is doing |
No worries about it, the test coverage CI is simply broken |
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.
Hi, thanks for your interest in contributing to Topgrade!
Fixes the dependency of cargo update on
cargo-install-update
binary
Well, I do think it is good to get rid of an external dependency, but cargo-install-update
has been pretty much the defacto option to update binaries installed through cargo
, for Topgrade, using cargo-install-update
makes us:
- Easy to maintain
- No need to reinvent the wheel
so I am not quite sure we should remove it.
For the impl of this PR, it checks the cargo version and only does a manual update if the version is greater than or equal to 1.77, so I am guessing the cargo folks have done something great to make cargo more like a package manager in that release?
And it seems that the current impl does not handle those binaries installed from git.
fixes the issue where packages are installed without the relevant features.
So IIUC, this is a bug of cargo-install-update
, I think we should file an issue in the upstream repo.
Prior to that version, cargo would error out on reinstalling a package. Now it will cleanly exit and upgrade the package if needed. In that regard this is a massive improvement. See this commit and this addition in cargo-update's README.
This is a WIP PR, sorry I should have made it clear.
Actually not! (kinda yes but also no). So Apart from that, the imported dependencies are very standard and relatively small, so it did not bother me much to personally import them. |
One argument made against this could be that if you have multiple packages with feature flags installed in your system, you'd spawn multiple cargo commands from within topgrade to install them but the bottleneck is the compilation anyways if only cargo step is run and topgrade in general prompts users for manual intervention if multiple steps are being run. |
Sorry for the late response, quite busy with my work on workdays.
The CI has been fixed, you can rebase your branch.
Thanks for showing me this! I tested this locally and it was indeed changed. Though the linked commit is relatively old, would you like to show me the exact commit that made this change to 1.77? I try to find it in the CHANGELOG, but no luck.
Well, I see this as a bug and it is a fair reason to me to implement this in Topgrade. So I am ok with the PR.
I think we should not spawn multiple child processes unless we find a good way to handle errors that happens in child processes. And, IMHO, Topgrade is not something that needs to be performant, so I think we can do the update sequentially. |
One question I have in my mind, is the JSON defined in this |
Fixes the dependency of cargo update on cargo-install-update binary and also fixes the issue where packages are installed without the relevant features. Signed-off-by: innocentzero <[email protected]>
Signed-off-by: innocentzero <[email protected]>
Signed-off-by: innocentzero <[email protected]>
BTW, looks like cargo-update #251 has just been fixed, see comments of that issue for more information. |
Oh, if that is the case, then idt we need to have this PR anymore since just using that would be better. I'd have tested the latest PR but I don't have any outdated binaries that need feature flags either. |
So closing:) |
Weird, because I'm pretty sure one of my packages got updated with less features (via topgrade) and I have: ❯ cargo install-update -V |
Hmm, that's weird, per the upstream issue, this should be fixed in cargo-install-update 14.0.0, if you can reproduce it, please report it to the upstream repo. |
Fixes the dependency of cargo update on cargo-install-update binary and also fixes the issue where packages are installed without the relevant features.
Standards checklist:
CONTRIBUTING.md
cargo build
)cargo fmt
)cargo clippy
)cargo test
)For new steps
--dry-run
option works with this step--yes
option works with this step if it is supported bythe underlying command
If you developed a feature or a bug fix for someone else and you do not have the
means to test it, please tag this person here.