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 'k=v' <plugin> isn't passed down to the plugin #11031

Open
sunshowers opened this issue Aug 29, 2022 · 2 comments
Open

cargo --config 'k=v' <plugin> isn't passed down to the plugin #11031

sunshowers opened this issue Aug 29, 2022 · 2 comments
Labels
A-configuration Area: cargo config files and env vars A-custom-subcommands Area: custom 3rd party subcommand plugins C-bug Category: bug S-needs-design Status: Needs someone to work further on the design for the feature or fix. NOT YET accepted.

Comments

@sunshowers
Copy link
Contributor

sunshowers commented Aug 29, 2022

Problem

If someone runs the command:

cargo --config 'k=v' <plugin>

then the config isn't passed down to the plugin.

This was originally reported as nextest-rs/nextest#498.

Steps

  1. Install nextest: https://nexte.st/book/pre-built-binaries.html
  2. Run cargo --config 'build.target-dir="foo"' nextest run
  3. See that the target dir is still target/.

(Note that cargo nextest run --config 'build.target-dir="foo"' works correctly, because nextest passes through Cargo configs.)

Possible Solution(s)

Best solution might be to pass configs down as an environment variable that plugins can read.

Notes

No response

Version

cargo 1.63.0 (fd9c4297c 2022-07-01)
release: 1.63.0
commit-hash: fd9c4297ccbee36d39e9a79067edab0b614edb5a
commit-date: 2022-07-01
host: x86_64-unknown-linux-gnu
libgit2: 1.4.2 (sys:0.14.2 vendored)
libcurl: 7.83.1-DEV (sys:0.4.55+curl-7.83.1 vendored ssl:OpenSSL/1.1.1n)
os: Pop!_OS 22.04 (jammy) [64-bit]
@epage
Copy link
Contributor

epage commented Aug 30, 2022

If people are curious how git does this, https://github.com/gitext-rs/git-config-env/tree/main/src has a rough implementation of parts of it.

@epage epage added the A-configuration Area: cargo config files and env vars label Aug 30, 2022
@weihanglo
Copy link
Member

Semi-related:

I got an impression that cargo doesn't give external subcommands much info, even cargo-clippy can't inherit a jobserver from cargo today.

@epage epage added the A-custom-subcommands Area: custom 3rd party subcommand plugins label Jan 17, 2023
@weihanglo weihanglo added the S-needs-design Status: Needs someone to work further on the design for the feature or fix. NOT YET accepted. label Apr 24, 2023
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
A-configuration Area: cargo config files and env vars A-custom-subcommands Area: custom 3rd party subcommand plugins C-bug Category: bug S-needs-design Status: Needs someone to work further on the design for the feature or fix. NOT YET accepted.
Projects
None yet
Development

No branches or pull requests

3 participants