git-tidy icon indicating copy to clipboard operation
git-tidy copied to clipboard

cargo installation is failing

Open woodm1979 opened this issue 4 years ago • 17 comments

Hello!

First things first, THANK YOU SO MUCH for this excellent tool. I use it all the time.

I was trying to install the newer rust-based version of git-tidy and I'm hitting this issue:

▪ cargo install git-tidy
    Updating crates.io index
  Installing git-tidy v2.0.1
error: failed to compile `git-tidy v2.0.1`, intermediate artifacts can be found at `/tmp/cargo-installgtcftB`

Caused by:
  failed to select a version for the requirement `zeroize = "^0.9.3"`
  candidate versions found which didn't match: 1.3.0, 1.2.0, 1.1.1, ...
  location searched: crates.io index
  required by package `dialoguer v0.7.1`
      ... which is depended on by `git-tidy v2.0.1`

My rust is pretty poor. I'd love to help, but I don't have the skills. :-)

I'm strongly guessing that a newer version of dialoguer will solve the issue, but I genuinely don't know. (If this were python, I could help, but I haven't messed with rust at all.)

woodm1979 avatar May 27 '21 03:05 woodm1979

@drewwyatt samesies.

alexfornuto avatar Aug 05 '21 23:08 alexfornuto

@woodm1979 AH! Somehow I missed the notification when you originally posted this. @alexfornuto thank you for commenting to put this back in my inbox. I'll try to take a look this weekend!

(thank you for the kind words! ❤️)

drewwyatt avatar Aug 06 '21 22:08 drewwyatt

Well, now I feel a jerk for not also saying, it but at the time I hadn't yet installed your wonderful tool. Now I'm on the older version from Brew, and can echo the thanks for making it.

alexfornuto avatar Aug 07 '21 00:08 alexfornuto

@alexfornuto @woodm1979 Okay, so:

First: Thank you again for raising this issue! (I'll get the readme updated with these instructions too). ❤️

Second (the problem/fix/workaround): It looks like zeroize 1.4.1 now requires the "resolver" feature only available in newer versions of cargo. I tried fiddling with the dialoguer and indicatif versions to see if I could find a version that totally sidestepped this without requiring rewrites and sadly couldn't come up with anything.

The good news is that I was able to fix this by just updating cargo running rustup update. I think this should also work for y'all.

Longer term: I opened #46 and will try to update my home-brew tap this weekend.

drewwyatt avatar Aug 07 '21 16:08 drewwyatt

Update: readme has been updated

drewwyatt avatar Aug 07 '21 20:08 drewwyatt

Oh excellent. Thanks for checking in on this. I went ahead and updated everything using rustup update.

I seem to be having the same issue:

Warning: Giant wall of text incoming!

┌─[woodnt][hack][~]
└─▪ rustup update
info: syncing channel updates for 'stable-aarch64-apple-darwin'
info: latest update on 2021-07-29, rust version 1.54.0 (a178d0322 2021-07-26)
info: downloading component 'rust-src'
info: downloading component 'cargo'
info: downloading component 'clippy'
info: downloading component 'rust-std'
info: downloading component 'rustc'
 68.6 MiB /  68.6 MiB (100 %)  29.3 MiB/s in  2s ETA:  0s
info: downloading component 'rustfmt'
info: removing previous version of component 'rust-src'
info: removing previous version of component 'cargo'
info: removing previous version of component 'clippy'
info: removing previous version of component 'rust-std'
info: removing previous version of component 'rustc'
info: removing previous version of component 'rustfmt'
info: installing component 'rust-src'
info: installing component 'cargo'
info: installing component 'clippy'
info: installing component 'rust-std'
 20.0 MiB /  20.0 MiB (100 %)  19.2 MiB/s in  1s ETA:  0s
info: installing component 'rustc'
 68.6 MiB /  68.6 MiB (100 %)  21.4 MiB/s in  3s ETA:  0s
info: installing component 'rustfmt'
info: checking for self-updates
info: downloading self-update

  stable-aarch64-apple-darwin updated - rustc 1.54.0 (a178d0322 2021-07-26) (from rustc 1.52.1 (9bc8c42bb 2021-05-09))

info: cleaning up downloads & tmp directories
┌─[woodnt][hack][~]
└─▪ cargo install git-tidy
    Updating crates.io index
  Installing git-tidy v2.0.1
error: failed to compile `git-tidy v2.0.1`, intermediate artifacts can be found at `/tmp/cargo-installHGhwyH`

Caused by:
  failed to select a version for the requirement `zeroize = "^0.9.3"`
  candidate versions found which didn't match: 1.4.1, 1.4.0, 1.3.0, ...
  location searched: crates.io index
  required by package `dialoguer v0.7.1`
      ... which is depended on by `git-tidy v2.0.1`
┌─[woodnt][hack][~]
└─▪ rustup update stable
info: syncing channel updates for 'stable-aarch64-apple-darwin'

  stable-aarch64-apple-darwin unchanged - rustc 1.54.0 (a178d0322 2021-07-26)

info: checking for self-updates
┌─[woodnt][hack][~]
└─▪ rustc --version
rustc 1.54.0 (a178d0322 2021-07-26)
┌─[woodnt][hack][~]
└─▪ cargo --version
cargo 1.54.0 (5ae8d74b3 2021-06-22)

I wonder if this is somehow because I'm on apple-silicon. I'm looking into this but again, my rust is pretty weak.

woodm1979 avatar Aug 08 '21 23:08 woodm1979

My rust is non-existent, and I hope that this doesn't preclude me from using this tool.

❯ rustup update
info: syncing channel updates for 'stable-x86_64-unknown-linux-gnu'
info: checking for self-updates

  stable-x86_64-unknown-linux-gnu unchanged - rustc 1.54.0 (a178d0322 2021-07-26)

info: cleaning up downloads & tmp directories
❯ rustc --version
rustc 1.54.0 (a178d0322 2021-07-26)
❯ cargo update
error: could not find `Cargo.toml` in `/home/alex` or any parent directory
❯ cargo install git-tidy
    Updating crates.io index
  Installing git-tidy v2.0.1
error: failed to compile `git-tidy v2.0.1`, intermediate artifacts can be found at `/tmp/cargo-installWw6n2S`

Caused by:
  failed to select a version for the requirement `zeroize = "^0.9.3"`
  candidate versions found which didn't match: 1.4.1, 1.4.0, 1.3.0, ...
  location searched: crates.io index
  required by package `dialoguer v0.7.1`
      ... which is depended on by `git-tidy v2.0.1`
❯ uname -a
Linux $HOSTNAME 4.19.0-17-cloud-amd64 #1 SMP Debian 4.19.194-2 (2021-06-21) x86_64 GNU/Linux

I tried to research the error about Cargo.toml, but the threaded responses from project maintainers did not seem user-friendly. Is cargo only supposed to handle Rust dependencies on a project level, versus applications available at the user level or greater?

alexfornuto avatar Aug 09 '21 14:08 alexfornuto

@alexfornuto @woodm1979 🤔 weeeeeiiiiird.

I wasn't able to get the home-brew tap updated this weekend but I promise to do my best to get that knocked out tonight or tomorrow evening. Is home-brew a viable option for both of you?

drewwyatt avatar Aug 09 '21 14:08 drewwyatt

Homebrew is a viable option for me.

alexfornuto avatar Aug 09 '21 16:08 alexfornuto

I can absolutely use the homebrew solution. I'm just trying to help with feedback and bug reports.

I searched around and others needed to upgrade dialoguer. https://github.com/sdttttt/gcr/issues/63 I didn't see anything else and certainly nothing that pointed at apple-silicon.

woodm1979 avatar Aug 09 '21 19:08 woodm1979

@alexfornuto @woodm1979 just pushed an update to my homebrew tap. When y'all get a chance, can you give that a shot and report back? (I'm honestly not sure how home-brew caching works, you may need to run brew unstop dreww/att/tap, then brew tap drewwyatt/tap again or use flags when running upgrade like brew upgrade --force --fetch-HEAD git-tidy)

(that should install 2.0.1)

If it still doesn't work, I also pushed a Mac binary to the releases here if you are just looking to upgrade and need a workaround for now while I figure this out.

drewwyatt avatar Aug 10 '21 02:08 drewwyatt

Also, just in case it wasn't clear already: I really appreciate both of you! Thank you so much for using this, for helping with debugging, and for your patience while I figure this out! ❤️❤️❤️

drewwyatt avatar Aug 10 '21 02:08 drewwyatt

Here's hoping this update gets through, GitHub is currently having problems.

For context, the system I'm using is Debian Linux. I was able to get 2.0.1 installed, with a few extra steps:

❯ brew update
fatal: Couldn't find remote ref refs/heads/master
Error: Fetching /home/linuxbrew/.linuxbrew/Homebrew/Library/Taps/drewwyatt/homebrew-tap failed!
❯ brew unstop dreww/att/tap
Error: Unknown command: unstop
❯ brew untap dreww/att/tap
Error: Invalid tap name 'dreww/att/tap'
❯ brew tap drewwyatt/tap
❯ brew upgrade
❯ brew upgrade --force --fetch-HEAD git-tidy
Warning: drewwyatt/tap/git-tidy 1.0.0 already installed
❯ brew untap drewwyatt/tap
Error: Refusing to untap drewwyatt/tap because it contains the following installed formulae or casks:
git-tidy
❯ brew remove git-tidy
Uninstalling /home/linuxbrew/.linuxbrew/Cellar/git-tidy/1.0.0... (5 files, 3.8MB)
❯ brew untap drewwyatt/tap
Untapping drewwyatt/tap...
Untapped 2 formulae (58 files, 230.9KB).
❯ brew tap drewwyatt/tap
==> Tapping drewwyatt/tap
Cloning into '/home/linuxbrew/.linuxbrew/Homebrew/Library/Taps/drewwyatt/homebrew-tap'...
remote: Enumerating objects: 61, done.
remote: Counting objects: 100% (17/17), done.
remote: Compressing objects: 100% (12/12), done.
remote: Total 61 (delta 1), reused 17 (delta 1), pack-reused 44
Unpacking objects: 100% (61/61), done.
Tapped 1 formula (74 files, 296.6KB).
❯ brew install git-tidy
==> Installing git-tidy from drewwyatt/tap
==> Downloading https://github.com/drewwyatt/homebrew-tap/releases/download/git-tidy-2.0.1/git-tidy-2.0.1.x86_64_linux.bottle.t
==> Downloading from https://github-releases.githubusercontent.com/181093375/fcfb20ed-fde1-436e-a7a6-ceb94eb86c63?X-Amz-Algorit
######################################################################## 100.0%
==> Pouring git-tidy-2.0.1.x86_64_linux.bottle.tar.gz
🍺  /home/linuxbrew/.linuxbrew/Cellar/git-tidy/2.0.1: 7 files, 3MB
Removing: /home/alex/.cache/Homebrew/git-tidy--1.0.0.tar.gz... (8.0KB)
❯ git-tidy --version
git-tidy 2.0.1

alexfornuto avatar Aug 10 '21 18:08 alexfornuto

Hi, I'm on Ubuntu 21.10 and get this error with Rust 1.56.0:

❯ cargo install git-tidy
    Updating crates.io index
  Installing git-tidy v2.0.1
error: failed to compile `git-tidy v2.0.1`, intermediate artifacts can be found at `/tmp/cargo-installYlv8Ca`

Caused by:
  failed to select a version for the requirement `zeroize = "^0.9.3"`
  candidate versions found which didn't match: 1.4.3, 1.4.2, 1.4.1, ...
  location searched: crates.io index
  required by package `dialoguer v0.7.1`
      ... which satisfies dependency `dialoguer = "^0.7.1"` of package `git-tidy v2.0.1`

ehiggs avatar Nov 19 '21 22:11 ehiggs

@ehiggs I'm on vacation right now but can take a look ~the middle of next week. Sorry for the inconvenience!

drewwyatt avatar Nov 19 '21 23:11 drewwyatt

So I tried to install git-tidy in the Linux environment on my new Chromebook, and ended up back at this issue again through normal troubleshooting. I forgot where we left it here. Installation via cargo is still failing for the same reasons. What's the current status of the homebrew version?

alexfornuto avatar Jun 15 '22 16:06 alexfornuto

@alexfornuto so, i never got back to this 😬 . The good(?) news is that the homebrew version and the cargo version are functionally equivilant. The cargo version is (as you might expect) written in Rust, and the homebrew version is the previous version i wrote in Go. They both do exactly the same thing, though so installing from homebrew won't (yet) cause you to miss out on any features.

drewwyatt avatar Jun 15 '22 19:06 drewwyatt