taiki-e / cargo-llvm-cov

Cargo subcommand to easily use LLVM source-based code coverage (-C instrument-coverage).
Apache License 2.0
933 stars 57 forks source link

Rustup called to find rustc even when no rustup installed #264

Closed def- closed 1 year ago

def- commented 1 year ago

This is again on https://github.com/MaterializeInc/materialize/

$ CARGO_LLVM_COV_SETUP=no cargo llvm-cov run --bin clusterd --no-report -- --version
error: could not execute process `rustup run nightly rustc --version --verbose` (never executed): No such file or directory (os error 2)

This is on a setup without rustup installed, but with rustc and cargo available, so I'm wondering why rustup is still used to resolve rustc. I'm guessing it's somewhere in cargo-config2, but couldn't figure it out yet: https://github.com/taiki-e/cargo-config2/blob/6188f7a7218be1fe89b67652a8f9a7264e2fe60d/src/resolve.rs#L608 The goal is not to have rustup, but fixed versions of rustc and all dependencies. Can I tell cargo-llvm-cov to simply use the available versions instead of trying to use rustup?

taiki-e commented 1 year ago

Hmm, IIRC, since https://github.com/taiki-e/cargo-llvm-cov/commit/f0173f39ad28ead8ff98a0e53d9377f82060c19c (v0.3.0) we don't call nightly toolchain, and cargo-config2 doesn't call rustup.

Is there a way to reproduce the error?

def- commented 1 year ago

Oooh, it turns out I was accidentally using a super old version in CI. That also explains why I couldn't reproduce this locally. Thanks