rust-lang / wg-cargo-std-aware

Repo for working on "std aware cargo"
133 stars 8 forks source link

Possibly support `-p` for standard library dependencies. #26

Open ehuss opened 4 years ago

ehuss commented 4 years ago

Commands like cargo build can take the -p flag to build any dependency. The current implementation does not support doing this for standard library dependencies. Should this be supported?

Ericson2314 commented 4 years ago

Yes I think it should; anything to make stdlib deps more normal is good.

c272 commented 4 months ago

One possible implementation of this, which I have been testing as a patch, could work something like this:

With the standard library occupying its own workspace currently, however, this does bring to mind a few implementation snags:

Thinking further ahead, this could be one possible avenue of stabilising build-std into a standard command line option in place of -Zbuild-std, if there is a replacement for the .cargo/config.toml field in some form. This is obviously a slightly larger scoped discussion, though.

What are people's opinions on this approach? This would allow for user and stdlib packages to appear in the same space to the end user, however I would be interested in any alternative suggestions.

Related: https://github.com/rust-lang/wg-cargo-std-aware/issues/21