Skip to content

Handle source replacement separately for [dependencies] and [dev-dependencies] #7679

Open
@mssun

Description

@mssun

Describe the problem you are trying to solve

I understand that cargo has a feature to replace dependency source to self-hosted: https://doc.rust-lang.org/cargo/reference/source-replacement.html

However, it seems that I cannot do source replacement of source.crates-io only for [dependencies] but not for [build-dependencies]?

Describe the solution you'd like

Handle source replacement separately like this:

[source.dependencies.crates-io]
replace-with = "my-vendor-source-for-build-deps"

[source.dev-dependencies.crates-io]
replace-with = "my-vendor-source-for-dev-deps"

Notes

This issue has been discussed here: https://users.rust-lang.org/t/source-replacement-for-dependencies-only-but-not-for-build-dependencies/35411

Metadata

Metadata

Assignees

No one assigned

    Labels

    A-build-dependenciesArea: [build-dependencies]A-source-replacementArea: [source] replacementC-feature-requestCategory: proposal for a feature. Before PR, ping rust-lang/cargo if this is not `Feature accepted`S-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