-
Notifications
You must be signed in to change notification settings - Fork 152
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
Query crate versions from local registry index rather than HTTP API #317
Conversation
@ordian Hi, since your last comment, I did a lot of changes, would you mind review again? recommend: review one commit by one commit. |
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.
This is great work, @DCjanus, thank you!
Looks good overalls, but the thing that worries me here is a lack of tests. Do you think it would be possible to add some?
force push: resolve conflict |
It seems like appveyor CI is failing because The code looks ok, but I'd like get more reviews on this. @killercup @bjgill |
(I'll put this on my list of things to review; will try and take a look this week) |
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.
Done a brief first pass. I really like the idea of speeding cargo-edit up and stopping using the HTTP API. Do you know how big the speed-up is?
A few smaller comments below.
As Appveyor identified, this change means that cargo-edit
will no longer work with pc-windows-gnu. Is this acceptable/is the number of users small? I'm a bit nervous about dropping support for a tier 1 toolchain.
I believe the problem on Windows-gnu could be resolved, I'm going to try this in this week. |
My friend has told me how to fix this problem: rust-lang/rust#53454 And maybe, we could query registry index via git-cli rather than libgit2, with this, I believe that cost less compile time. But this requires the user to have to install git, I am not sure if this is acceptable. For example: $ git rev-parse refs/remotes/origin/master
e000bd939a83dfbb64da285425186af30178042b
$ git ls-tree e000bd939a83dfbb64da285425186af30178042b
040000 tree 2e03f39bea7b299346dd61f76223b0622a5c3ca5 1
040000 tree 766307154d671917d2ae02ca00035e7d7a96b711 2
040000 tree 62382fdc0c2d60f11eb1ffb4c9382bd360415625 3
040000 tree ea15ada1fa58ff60180e5768fc096279038d0fab a-
040000 tree 669a2b1afa7d00b43c2e0eb72af40f85d6608993 aa
040000 tree d10ac8d5d8de21947dcd5a8bf7b19203480a80c1 ab
.... # some output
$ git cat-file -p 999e8ba108a3d80be1c24a4323e05fce422e2533 # a blob object hash that I found in my registry index
{"name":"dargo","vers":"0.0.0","deps":[],"cksum":"25ccfb6ab26454d5bd4c6a1391bb97a920ad0bfef13a25d5125e3e2ba8a6ebb1","features":{},"yanked":false,"links":null}
{"name":"dargo","vers":"0.0.1","deps":[{"name":"cargo","req":"^0.35.0","features":[],"optional":false,"default_features":true,"target":null,"kind":"normal"},{"name":"colored","req":"^1.8.0","features":[],"optional":false,"default_features":true,"target":null,"kind":"normal"},{"name":"failure","req":"^0.1.5","features":[],"optional":false,"default_features":true,"target":null,"kind":"normal"},{"name":"flexi_logger","req":"^0.13.1","features":[],"optional":false,"default_features":true,"target":null,"kind":"normal"},{"name":"log","req":"^0.4.6","features":[],"optional":false,"default_features":true,"target":null,"kind":"normal"},{"name":"semver","req":"^0.9.0","features":[],"optional":false,"default_features":true,"target":null,"kind":"normal"},{"name":"structopt","req":"^0.2.16","features":[],"optional":false,"default_features":true,"target":null,"kind":"normal"},{"name":"tabwriter","req":"^1.1.0","features":[],"optional":false,"default_features":true,"target":null,"kind":"normal"},{"name":"toml_edit","req":"^0.1.3","features":[],"optional":false,"default_features":true,"target":null,"kind":"normal"}],"cksum":"babf4f39a8d8e51ce26cca6f3481401a7db37b3c8944f07407b69aaab9d0ce2e","features":{},"yanked":false,"links":null}
{"name":"dargo","vers":"0.0.2","deps":[{"name":"cargo","req":"^0.35.0","features":[],"optional":false,"default_features":true,"target":null,"kind":"normal"},{"name":"colored","req":"^1.8.0","features":[],"optional":false,"default_features":true,"target":null,"kind":"normal"},{"name":"failure","req":"^0.1.5","features":[],"optional":false,"default_features":true,"target":null,"kind":"normal"},{"name":"flexi_logger","req":"^0.13.1","features":[],"optional":false,"default_features":true,"target":null,"kind":"normal"},{"name":"log","req":"^0.4.6","features":[],"optional":false,"default_features":true,"target":null,"kind":"normal"},{"name":"semver","req":"^0.9.0","features":[],"optional":false,"default_features":true,"target":null,"kind":"normal"},{"name":"structopt","req":"^0.2.16","features":[],"optional":false,"default_features":true,"target":null,"kind":"normal"},{"name":"tabwriter","req":"^1.1.0","features":[],"optional":false,"default_features":true,"target":null,"kind":"normal"},{"name":"toml_edit","req":"^0.1.3","features":[],"optional":false,"default_features":true,"target":null,"kind":"normal"}],"cksum":"c499b31da448619f627099e8f9951d49d80639f5e622d73832f86ad899454953","features":{},"yanked":false,"links":null}
{"name":"dargo","vers":"0.0.3","deps":[{"name":"cargo","req":"^0.35.0","features":[],"optional":false,"default_features":true,"target":null,"kind":"normal"},{"name":"colored","req":"^1.8.0","features":[],"optional":false,"default_features":true,"target":null,"kind":"normal"},{"name":"failure","req":"^0.1.5","features":[],"optional":false,"default_features":true,"target":null,"kind":"normal"},{"name":"flexi_logger","req":"^0.13.1","features":[],"optional":false,"default_features":true,"target":null,"kind":"normal"},{"name":"log","req":"^0.4.6","features":[],"optional":false,"default_features":true,"target":null,"kind":"normal"},{"name":"semver","req":"^0.9.0","features":[],"optional":false,"default_features":true,"target":null,"kind":"normal"},{"name":"structopt","req":"^0.2.16","features":[],"optional":false,"default_features":true,"target":null,"kind":"normal"},{"name":"tabwriter","req":"^1.1.0","features":[],"optional":false,"default_features":true,"target":null,"kind":"normal"},{"name":"toml_edit","req":"^0.1.3","features":[],"optional":false,"default_features":true,"target":null,"kind":"normal"}],"cksum":"769f10a0e29b4a97e81555d06b2dae04e80d0cf76911c37609a938f35259f8be","features":{},"yanked":false,"links":null}
{"name":"dargo","vers":"0.0.4","deps":[{"name":"cargo","req":"^0.36.0","features":[],"optional":false,"default_features":true,"target":null,"kind":"normal"},{"name":"colored","req":"^1.8.0","features":[],"optional":false,"default_features":true,"target":null,"kind":"normal"},{"name":"failure","req":"^0.1.5","features":[],"optional":false,"default_features":true,"target":null,"kind":"normal"},{"name":"flexi_logger","req":"^0.13.2","features":[],"optional":false,"default_features":true,"target":null,"kind":"normal"},{"name":"log","req":"^0.4.6","features":[],"optional":false,"default_features":true,"target":null,"kind":"normal"},{"name":"semver","req":"^0.9.0","features":[],"optional":false,"default_features":true,"target":null,"kind":"normal"},{"name":"structopt","req":"^0.2.17","features":[],"optional":false,"default_features":true,"target":null,"kind":"normal"},{"name":"tabwriter","req":"^1.1.0","features":[],"optional":false,"default_features":true,"target":null,"kind":"normal"},{"name":"toml_edit","req":"^0.1.3","features":[],"optional":false,"default_features":true,"target":null,"kind":"normal"}],"cksum":"a4f5474ec1099fc7a8f57632027c8f3f42edbba9f5bfd83fa7894361d5aaa991","features":{},"yanked":false,"links":null}
{"name":"dargo","vers":"0.0.5","deps":[{"name":"cargo","req":"^0.36.0","features":[],"optional":false,"default_features":true,"target":null,"kind":"normal"},{"name":"colored","req":"^1.8.0","features":[],"optional":false,"default_features":true,"target":null,"kind":"normal"},{"name":"failure","req":"^0.1.5","features":[],"optional":false,"default_features":true,"target":null,"kind":"normal"},{"name":"flexi_logger","req":"^0.13.2","features":[],"optional":false,"default_features":true,"target":null,"kind":"normal"},{"name":"log","req":"^0.4.6","features":[],"optional":false,"default_features":true,"target":null,"kind":"normal"},{"name":"semver","req":"^0.9.0","features":[],"optional":false,"default_features":true,"target":null,"kind":"normal"},{"name":"structopt","req":"^0.2.16","features":[],"optional":false,"default_features":true,"target":null,"kind":"normal"},{"name":"tabwriter","req":"^1.1.0","features":[],"optional":false,"default_features":true,"target":null,"kind":"normal"},{"name":"toml_edit","req":"^0.1.3","features":[],"optional":false,"default_features":true,"target":null,"kind":"normal"}],"cksum":"670e5c55a81f5693c33360d8fb84b4f1a0f166aceea977cb571142e2f0f283b2","features":{},"yanked":true,"links":null}
{"name":"dargo","vers":"0.0.6","deps":[{"name":"cargo","req":"^0.36.0","features":[],"optional":false,"default_features":true,"target":null,"kind":"normal"},{"name":"colored","req":"^1.8.0","features":[],"optional":false,"default_features":true,"target":null,"kind":"normal"},{"name":"failure","req":"^0.1.5","features":[],"optional":false,"default_features":true,"target":null,"kind":"normal"},{"name":"flexi_logger","req":"^0.13.2","features":[],"optional":false,"default_features":true,"target":null,"kind":"normal"},{"name":"log","req":"^0.4.6","features":[],"optional":false,"default_features":true,"target":null,"kind":"normal"},{"name":"semver","req":"^0.9.0","features":[],"optional":false,"default_features":true,"target":null,"kind":"normal"},{"name":"structopt","req":"^0.2.16","features":[],"optional":false,"default_features":true,"target":null,"kind":"normal"},{"name":"tabwriter","req":"^1.1.0","features":[],"optional":false,"default_features":true,"target":null,"kind":"normal"},{"name":"toml_edit","req":"^0.1.3","features":[],"optional":false,"default_features":true,"target":null,"kind":"normal"}],"cksum":"12675eb23f091fcc331d58bb0a6dc84702a2529fd333456db5d86d33e8aaafda","features":{},"yanked":false,"links":null} |
This is a valid concern, but I think the number of |
Fair enough to me, maybe we should recommend Windows users to install with msvc. And before upstream fix this problem, and if I have enough free time, I'd like to try parse If I have enough free time…… |
OK, thanks. I'm happy for this to go in as-is, then. You'll just need to remove the gnu targets from https://github.com/killercup/cargo-edit/blob/master/appveyor.yml#L12 to get CI to pass. |
…local registry' or 'registry index in local filesystem'
… future maintainers
remove windows-gnu targets in CI; add missing doc for foreign_links errors; upgrade dependencies;
@ordian Hi, I just resloved some conflict and force pushed, would you mind take a look. |
@DCjanus hey, thank you! Travis CI failure on beta seems spurious, so let's get this merged. |
Close #311