Skip to content

Cargo standard library dependencies #5

Open
@ehuss

Description

@ehuss

This issue is for tracking the writing of an RFC for extending Cargo.toml to specify dependencies on standard library crates.

There are a few needs and requirements:

  • Opt-in to building the standard library instead of using pre-built artifacts.
  • Specifying alternate standard library implementations.
  • Create a way for Cargo to pass --extern=foo to rustc to specify explicit dependencies to add to the extern prelude, even for pre-built artifacts. This can help obviate the need for extern crate for crates like proc-macro.
    • We may also consider this to be implicit in some cases. For example, proc-macro could be automatically added with proc-macro = true.

There have been a few different proposals for syntax, please see the following:

Some issues to consider:

  • How does cargo treat multiple crates in a graph declaring dependencies on the standard library?
  • How to balance implicit vs explicit dependencies?
  • How to express a dependency on a pre-built artifact vs building one from source.

Metadata

Metadata

Assignees

No one assigned

    Labels

    RFCDiscussion for a possible new RFCstabilization blockerThis needs a resolution before stabilization

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions