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

Cargo config flag not getting evaluated #13866

Open
PoisonPhang opened this issue May 6, 2024 · 1 comment
Open

Cargo config flag not getting evaluated #13866

PoisonPhang opened this issue May 6, 2024 · 1 comment
Labels
C-bug Category: bug S-needs-info Status: Needs more info, such as a reproduction or more background for a feature request.

Comments

@PoisonPhang
Copy link

PoisonPhang commented May 6, 2024

Problem

When passing Cargo config values via the --config flag, they don't seem to be getting evaluated.

For example, running:

cargo --config net.git-fetch-with-cli=true clippy --all

while working on a private repository results in:

    Updating git repository `https://github.com/unionlabs/ethers-rs`
error: failed to get `ethers` as a dependency of package `unionlabs v0.1.0 (/home/poisonphang/projects/github/unionlabs/union/lib/unionlabs)`

Caused by:
  failed to load source for dependency `ethers`

Caused by:
  Unable to update https://github.com/unionlabs/ethers-rs?branch=ethers-core-wasm#fd10abba

Caused by:
  failed to fetch into: /home/poisonphang/.cargo/git/db/ethers-rs-efea9688c919e664

Caused by:
  failed to authenticate when downloading repository: ssh://git@github.com/unionlabs/ethers-rs

  * attempted ssh-agent authentication, but no usernames succeeded: `git`

  if the git CLI succeeds then `net.git-fetch-with-cli` may help here
  https://doc.rust-lang.org/cargo/reference/config.html#netgit-fetch-with-cli

Caused by:
  no authentication methods succeeded

Steps

No response

Possible Solution(s)

For this specific instance, using environment variables (such as CARGO_NET_GIT_FETCH_WITH_CLI=true sufficed), but the --config flag was still not functioning.

Notes

Additionally, trying to provide invalid keys for the --config flag did not result in any errors.

Version

cargo 1.79.0-nightly (c93926759 2024-04-23)
release: 1.79.0-nightly
commit-hash: c9392675917adc2edab269eea27c222b5359c637
commit-date: 2024-04-23
host: x86_64-unknown-linux-gnu
libgit2: 1.7.2 (sys:0.18.3 vendored)
libcurl: 8.6.0-DEV (sys:0.4.72+curl-8.6.0 vendored ssl:OpenSSL/1.1.1w)
ssl: OpenSSL 1.1.1w  11 Sep 2023
os: NixOS 23.11.0 [64-bit]
@PoisonPhang PoisonPhang added C-bug Category: bug S-triage Status: This issue is waiting on initial triage. labels May 6, 2024
@weihanglo
Copy link
Member

cargo-clippy is exactly implemented as a custom subcommand, so this might be considered as a duplicate of #11031.

The reason environment variables work is that clippy later calls cargo check, which would pick up those envs I believe.

@weihanglo weihanglo added S-needs-info Status: Needs more info, such as a reproduction or more background for a feature request. and removed S-triage Status: This issue is waiting on initial triage. labels May 6, 2024
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
C-bug Category: bug S-needs-info Status: Needs more info, such as a reproduction or more background for a feature request.
Projects
None yet
Development

No branches or pull requests

2 participants