Closed 0atman closed 1 year ago
I have installed cargo-shuttle
both from source and cargo binstall
no dice
inside the discord walled garden, we are talking about how this seems to be caused by sparse registries not playing well with cargo-edit. I've switched to stable
which I believe shouldn't have sparse enabled, but it's not worked either.
Debugging continues...!
Ah, so sparse registries are enabled by default on nightly? I'm not sure just switching it back to git will fix the bug either, I think the cache would still need to be updated. So I would try the suggestions from discord, running cargo update/upgrade/fetch in a crate which depends on shuttle-runtime v0.14.0. Unfortunately I still haven't reproduced the bug, so I can't test it myself
Trying those now.
I think you might be able to just rustup default nightly
to reproduce it?
I've tested this on both my aarch64 m1 machines, and my x86_64 surface pro, and I think because I always use nightly, this upstream bug happens on all of them, despite switching to stable.
The upstream problem seems to be caused by https://github.com/killercup/cargo-edit/issues/841
The fix recommended in the above, is to add this to your .cargo/config
[registries.crates-io]
protocol = "git"
In my experience, you then ALSO need to warm up the cache, which I can do repeatably with cargo install cargo-shuttle -f
After doing these two, it does indeed fix it, both on stable and on nightly
Thank you for getting to the bottom of this and finding a work-around! For visibility I'll reiterate what I said regarding this issue in our conversation on discord:
We have been planning a refactor of our init function to rather bootstrap projects from templates (e.g. our examples repo). That would resolve this issue as well, since we would no longer rely on cargo-edit
to fetch the latest version. We're about to start on this next week, and it should be good to go within a few weeks. Until them I'll look around for an intermediate solution, and I'll also add your work-around to our docs to minimize the time people need to spend debugging this.
The biggest problem I see is that Rocket has always (and still does today) recommend nightly
, and many projects have nice-to-have or quality-of-life features that they mention in their documentation, though not as strongly as Rocket. This will mean that a small number of users are using nightly
.
Nightly breaks shuttle init, and once broken it's not obvious how to un-break it, likely you'd have to come here to figure it out.
I look forward to the fix! Thank you for your work, team :-)
Oh, I just realised the beta
channel is 1.70.0, which would break this too.
I just added reproducible fix instructions to my comment here https://github.com/shuttle-hq/shuttle/issues/821#issuecomment-1525317860
Perfect, thanks! One of our contributors has volunteered to help out with the refactor of init
as well, so we should be able to get this resolved soon. :crossed_fingers:
Wonderful news! Thanks to everyone who is helping out :tada:
My extremely scientific poll of my audience suggest that this fix could improve the lives of 19% of your potential users!
@oddgrd can this be closed now? Not sure if the problems that @iamwacko referred to here are solved.
Yes, it was caused by cargo-edit trying to get_latest_version, so it should be fixed since we no longer rely on that.
What happened?
While running
cargo shuttle init
, after selecting the web framework it panics withCould not query the latest version of shuttle-runtime
Version
cargo-shuttle 0.14.0 (but I have also tested 0.13.0 with the same problem)
Which operating systems are you seeing the problem on?
Linux
Which CPU architectures are you seeing the problem on?
ARM64 (specifically I'm running asahi linux on mac mini)
6.2.0-asahi-11-1-edge-ARCH aarch64 GNU/Linux
Relevant log output
Duplicate declaration