rust-lang / cargo

The Rust package manager
https://doc.rust-lang.org/cargo
Apache License 2.0
12.31k stars 2.33k forks source link

Implicit standard library dependencies #5003

Open Ericson2314 opened 6 years ago

Ericson2314 commented 6 years ago

(Split from of rust-lang/rfcs#1133)

Assuming https://github.com/rust-lang/cargo/issues/5002 shakes out in some fashion, we need to elaborate crates without explicit standard library dependencies to have them, so they can be practically used together with crates that do.

https://github.com/Ericson2314/rust-rfcs/blob/cargo-libstd/text/0000-cargo-libstd-awareness.md#implicit-dependencies was the section that covered this in my old RFC. I think it still reads fine but I'll double check and port over.

Key points to think about in any even

  1. Any explicit stdlib deps at all means no implicit deps. Otherwise hard to reason about / teach. This is a simplification of what I proposed in the RFC.
  2. Need additional way to opt-out for core, as it has no dependencies whatsoever.
  3. All components (library, exes, tests, benches) get an implicit std dependency. (That would be all 3 of [dependencies] [dev-dependencies] and [build-dependencies].
  4. Would be cleaner to to do explicit core deps, but our hands our probably tied by back-compat.
  5. test is a bit tricky because of the way it interacts with the built-in test harness. Ideally IMO they would both be normal crates, the harness a procedural macro of sorts. I don't want to grandfather in test being the only dep needed for both, precluding making the test-harness macro crate down the road.

CC @japaric @nrc

stale[bot] commented 5 years ago

As there hasn't been any activity here in over 6 months I've marked this as stale and if no further activity happens for 7 days I will close it.

I'm a bot so this may be in error! If this issue should remain open, could someone (the author, a team member, or any interested party) please comment to that effect?

The team would be especially grateful if such a comment included details such as:

Thank you for contributing!

(The cargo team is currently evaluating the use of Stale bot, and using #6035 as the tracking issue to gather feedback.)

If you're reading this comment from the distant future, fear not if this was closed automatically. If you believe it's still an issue please leave a comment and a team member can reopen this issue. Opening a new issue is also acceptable!

Ericson2314 commented 5 years ago

Last I heard this sort of work might get priorized after the 2018 edition crunch time, so I'm just waiting for that.