Skip to content

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

@sunshowers

Description

@sunshowers

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]

Metadata

Metadata

Assignees

No one assigned

    Labels

    A-configurationArea: cargo config files and env varsA-custom-subcommandsArea: custom 3rd party subcommand pluginsC-bugCategory: bugS-needs-designStatus: Needs someone to work further on the design for the feature or fix. NOT YET accepted.

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions