Skip to content
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

unable to install #178

Closed
dominikwilkowski opened this issue Jun 1, 2022 · 6 comments
Closed

unable to install #178

dominikwilkowski opened this issue Jun 1, 2022 · 6 comments
Labels
C-question Category: A question

Comments

@dominikwilkowski
Copy link

Following the instructions I'm getting an error on macOS 12.4 ARM

λ rustup component add llvm-tools-preview
info: downloading component 'llvm-tools-preview'
info: installing component 'llvm-tools-preview'
 42.0 MiB /  42.0 MiB (100 %)  20.7 MiB/s in  2s ETA:  0s
λ cargo install cargo-llvm-cov
    Updating crates.io index
  Downloaded cargo-llvm-cov v0.4.4
  Downloaded 1 crate (63.9 KB) in 0.94s
  Installing cargo-llvm-cov v0.4.4
  Downloaded cargo-platform v0.1.2
  Downloaded os_pipe v0.9.2
  Downloaded shared_child v0.3.5
  Downloaded shell-escape v0.1.5
  Downloaded proc-macro-error-attr v1.0.4
  Downloaded regex-syntax v0.6.26
  Downloaded is_executable v1.0.1
  Downloaded once_cell v1.12.0
  Downloaded indexmap v1.8.2
  Downloaded proc-macro-error v1.0.4
  Downloaded os_str_bytes v6.1.0
  Downloaded home v0.5.3
  Downloaded fs-err v2.7.0
  Downloaded duct v0.13.5
  Downloaded cargo_metadata v0.14.2
  Downloaded camino v1.0.9
  Downloaded regex v1.5.6
  Downloaded rustc-demangle v0.1.21
  Downloaded semver v1.0.9
  Downloaded clap_derive v3.1.18
  Downloaded 20 crates (899.6 KB) in 0.88s
   Compiling proc-macro2 v1.0.39
   Compiling unicode-ident v1.0.0
   Compiling syn v1.0.95
   Compiling version_check v0.9.4
   Compiling serde_derive v1.0.137
   Compiling serde v1.0.137
   Compiling libc v0.2.126
   Compiling memchr v2.5.0
   Compiling autocfg v1.1.0
   Compiling camino v1.0.9
   Compiling semver v1.0.9
   Compiling serde_json v1.0.81
   Compiling anyhow v1.0.57
   Compiling hashbrown v0.11.2
   Compiling os_str_bytes v6.1.0
   Compiling heck v0.4.0
   Compiling ryu v1.0.10
   Compiling itoa v1.0.2
   Compiling lazy_static v1.4.0
   Compiling regex-syntax v0.6.26
   Compiling once_cell v1.12.0
   Compiling termcolor v1.1.3
   Compiling strsim v0.10.0
   Compiling same-file v1.0.6
   Compiling bitflags v1.3.2
   Compiling textwrap v0.15.0
   Compiling opener v0.5.0
   Compiling fs-err v2.7.0
   Compiling glob v0.3.0
   Compiling home v0.5.3
   Compiling is_executable v1.0.1
   Compiling rustc-demangle v0.1.21
   Compiling shell-escape v0.1.5
   Compiling proc-macro-error-attr v1.0.4
   Compiling proc-macro-error v1.0.4
   Compiling indexmap v1.8.2
   Compiling clap_lex v0.2.0
   Compiling walkdir v2.3.2
   Compiling aho-corasick v0.7.18
   Compiling regex v1.5.6
   Compiling atty v0.2.14
   Compiling os_pipe v0.9.2
   Compiling shared_child v0.3.5
   Compiling duct v0.13.5
   Compiling quote v1.0.18
   Compiling clap_derive v3.1.18
   Compiling clap v3.1.18
   Compiling cargo-platform v0.1.2
   Compiling cargo_metadata v0.14.2
   Compiling cargo-llvm-cov v0.4.4
    Finished release [optimized] target(s) in 23.01s
  Installing /Users/dominik/.cargo/bin/cargo-llvm-cov
   Installed package `cargo-llvm-cov v0.4.4` (executable `cargo-llvm-cov`)
λ cargo llvm-cov
error: failed to find llvm-tools-preview, please install llvm-tools-preview with `rustup component add llvm-tools-preview --toolchain local`
λ rustup component add llvm-tools-preview --toolchain local
error: local is a custom toolchain
λ rustc -V
rustc 1.60.0

Trying to install it via brew also fails:

λ brew install taiki-e/tap/cargo-llvm-cov
==> Tapping taiki-e/tap
Cloning into '/opt/homebrew/Library/Taps/taiki-e/homebrew-tap'...
remote: Enumerating objects: 371, done.
remote: Counting objects: 100% (59/59), done.
remote: Compressing objects: 100% (43/43), done.
remote: Total 371 (delta 23), reused 22 (delta 12), pack-reused 312
Receiving objects: 100% (371/371), 46.00 KiB | 1.09 MiB/s, done.
Resolving deltas: 100% (192/192), done.
Error: Invalid formula: /opt/homebrew/Library/Taps/taiki-e/homebrew-tap/Formula/cargo-llvm-cov.rb
formulae require at least a URL
Error: Invalid formula: /opt/homebrew/Library/Taps/taiki-e/homebrew-tap/Formula/cargo-minimal-versions.rb
formulae require at least a URL
Error: Invalid formula: /opt/homebrew/Library/Taps/taiki-e/homebrew-tap/Formula/cargo-hack.rb
formulae require at least a URL
Error: Invalid formula: /opt/homebrew/Library/Taps/taiki-e/homebrew-tap/Formula/parse-changelog.rb
formulae require at least a URL
Error: Cannot tap taiki-e/tap: invalid syntax in tap!
@taiki-e
Copy link
Owner

taiki-e commented Jun 2, 2022

Following the instructions I'm getting an error on macOS 12.4 ARM

One possibility is that you have set the RUSTC_WRAPPER, RUSTC, or similar environment variable or config and cargo-llvm-cov is ignoring it. In this case, this patch may fix the problem.

Otherwise, the problem seems to be either you are using a custom toolchain and have not been able to install llvm-tools-preview in the custom toolchain, or the custom toolchain has a different directory structure than the regular toolchain. Try the regular toolchain installed by rustup.

(Note: It is very hard to fully support RUSTC_WRAPPER or custom toolchains because they allow cargo/rustc/rustup to do things that are very different from its default behavior.)


Trying to install it via brew also fails:

This error is because we do not distribute prebuilt binaries for aarch64 macOS. It should be fixed in the next release including #179.

@taiki-e taiki-e added the C-question Category: A question label Jun 2, 2022
@dominikwilkowski
Copy link
Author

Thanks for the details.
I'll look out for the next release and close this issue if it resolves the problem.

@taiki-e
Copy link
Owner

taiki-e commented Jun 2, 2022

Published 0.4.5 which includes the RUSTC_WRAPPER-related fix and aarch64 macOS binary distribution.

@dominikwilkowski
Copy link
Author

brew install works now but when I run cargo llvm-cov I still get this error:

λ cargo llvm-cov
error: failed to find llvm-tools-preview, please install llvm-tools-preview with `rustup component add llvm-tools-preview --toolchain local`

And I have llvm-tools-preview installed:

λ rustup component add llvm-tools-preview
info: downloading component 'llvm-tools-preview'
info: installing component 'llvm-tools-preview'
 42.0 MiB /  42.0 MiB (100 %)  20.9 MiB/s in  2s ETA:  0s

How do I debug this? I installed rust via rustup recently (when changing laptops) and haven't made any changes to it.

@taiki-e
Copy link
Owner

taiki-e commented Jun 3, 2022

How do I debug this?

First, could you confirm that rust is not installed by package managers such as homebrew or MacPorts?

For homebrew:

brew list | grep rust

The package manager installs specific versions of rustc, rustdoc, and cargo instead of rustup, and those binaries may take precedence over binaries installed by rustup. AFAIK, they basically do not work as the rust developer expects and it is recommended to uninstall or at least remove them from the path.

If you have not installed anything via package managers, can you tell me what custom toolchain is installed?

rustup toolchain list

@dominikwilkowski
Copy link
Author

Hey @taiki-e
Thanks for the details and effort you put into this. It helped me pinpoint what the issue was and fix it.
I will close this issue now...

For those who happen to come upon this, this was the issue:
I had tried ages ago to install rustup via brew and then installed it via that rustup installation. Which means I had a custom toolchain installed.
Now getting rid of that all was hard as I was unable to use rustup self uninstall.

λ rustup self uninstall
error: self-uninstall is disabled for this build of rustup
error: you should probably use your system package manager to uninstall rustup

So I had to remove the dir ~/.cargo and a couple bins from /opt/local/bin/ and remove it from PATH.
Once that was done I reinstalled rust via the shell script given by the docs site and it all worked.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
C-question Category: A question
Projects
None yet
Development

No branches or pull requests

2 participants