Skip to content

Tracking issue for config-cli #7722

Closed

Description

@ehuss

Implementation: #7649
Original proposal: #6699
Documentation: https://doc.rust-lang.org/nightly/cargo/reference/unstable.html#config-cli

Summary

Adds --config CLI option to pass config options to any command.

Unresolved issues

Activity

  1. added
    C-tracking-issueCategory: A tracking issue for something unstable.
    A-config-cliArea: --config CLI option
    on Dec 19, 2019
  2. added a commit that references this issue on Feb 18, 2020
  3. jyn514 commented on Sep 19, 2020

    @jyn514
    Member

    A use case for this: docs.rs wants to pass RUSTFLAGS without having the spacing interpreted by the shell: rust-lang/docs.rs#1057

  4. Nemo157 commented on Dec 1, 2020

    @Nemo157
    Contributor

    Is it not possible to specify registry sources via this? I wanted to migrate from using registry-index sources in Publishing crates to IPFS so that I could test it with #8890, but trying to use this flag to define the registries it doesn't seem to be picked up:

    > cargo -Zunstable-options '--config=source.bs58_cli_0_1_0_anyhow.registry="http://127.0.0.1:8080/ifps/QmP6KmpjQrYpYyeXGqAvmrw45dPoKvmKeTqTanmSqJGJKz"' '--config=source.bs58_cli_0_1_0_bs58.registry="http://127.0.0.1:8080/ifps/Qmb2PJ9vMALRFmQjLDQbcNHYUvcFc96XzKMwAhBMEECxzb"' '--config=source.bs58_cli_0_1_0_paw.registry="http://127.0.0.1:8080/ifps/QmNkJbrmpjJErbX9fTpSSQYb7Ky1Qnpg47QptfMcVQUwBx"' '--config=source.bs58_cli_0_1_0_structopt.registry="http://127.0.0.1:8080/ifps/Qmbh5sZbKezvYq2ESVhbnymqs7VKMTaz7yXUaoMi9tBjJp"' update --manifest-path /tmp/ipfs-registry.bs58-cli-0.1.0.yIgXKp/bs58-cli-0.1.0/Cargo.toml
    error: failed to parse manifest at `/tmp/ipfs-registry.bs58-cli-0.1.0.yIgXKp/bs58-cli-0.1.0/Cargo.toml`
    
    Caused by:
      no index found for registry: `bs58_cli_0_1_0_anyhow`
  5. Nemo157 commented on Dec 1, 2020

    @Nemo157
    Contributor

    🤦 ignore that, I was using the wrong config key.

  6. dancrossnyc commented on Jul 1, 2021

    @dancrossnyc

    Curious if there's any updated status on this? It would be really great to get stabilized!

  7. ehuss commented on Jul 1, 2021

    @ehuss
    ContributorAuthor

    There's no update. There's still an unresolved issue noted above that needs someone to work on it.

  8. jonhoo commented on Nov 23, 2021

    @jonhoo
    Contributor

    I'll add what I think is a pretty compelling use-case for this: passing -Zinstrument-coverage for coverage testing (which is stabilizing in rust-lang/rust#90132). It requires leaving any existing rustflags intact since things like linker flags (-Clink-args) may be required for the crate to build in the first place, which using RUSTFLAGS doesn't do (#5376) but --config='build.rustflags = ["-Zinstrument-coverage"]' does (#5376 (comment)).

    For the unresolved issue, some guidance on exactly what you're imagining would be helpful @ehuss. Specifically, why do you think that restriction is necessary in the first place? Alternatively, could we just parse into a toml::Value and then check that it only contains one actual entry?

  9. ehuss commented on Nov 29, 2021

    @ehuss
    ContributorAuthor

    The restriction is to just constrain the format so that it has a straightforward syntax. That way, someone wouldn't be able to pass in comments or [bracketed.tables] or newlines or anything like that. It already parses to a toml::Value and checks for one value.

  10. jonhoo commented on Dec 6, 2021

    @jonhoo
    Contributor

    👍
    Implemented in #10176

  11. added a commit that references this issue on Dec 6, 2021
  12. added a commit that references this issue on Jan 25, 2022
  13. jonhoo commented on Jan 25, 2022

    @jonhoo
    Contributor

    Now that #10176 has been merged, I think the unchecked box can be ticked!

  14. 40 remaining items

  15. added a commit that references this issue on Jun 22, 2022
  16. moved this to Done in Cargo Roadmapon Sep 5, 2023
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

No one assigned

    Type

    No type

    Projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions