Skip to content

Rename built-in crates #24853

Closed
Closed
@emberian

Description

@emberian
Member

rand etc conflict with crates.io crates and causes confusion. We should rename them private_rand or rustc_rand etc.

Activity

emberian

emberian commented on Apr 27, 2015

@emberian
MemberAuthor

I think we should rename:

  • libc
  • num
  • rand
  • log
  • rbml
  • term
  • syntax
  • serialize
  • graphviz
  • getopts
  • flate
  • arena
  • alloc
huonw

huonw commented on May 8, 2015

@huonw
Member

I'm in favour. It seems like this might be something good to do for 1.0, since hitting errors about them can be quite confusing (especially without reasons, cc #25211).

steveklabnik

steveklabnik commented on May 10, 2015

@steveklabnik
Member

I'm 👍 to this, and backporting to 1.0

SiegeLord

SiegeLord commented on Aug 31, 2015

@SiegeLord
Contributor

This hasn't been done, and still results in bad user experience. Can this still be fixed post 1.0?

steveklabnik

steveklabnik commented on Feb 7, 2017

@steveklabnik
Member

Status update: this still isn't done. We do have some errors on the rustc_private feature saying "please use the crate from crates.io", which is helpful.

@rust-lang/compiler is this something we ever intend to do?

SiegeLord

SiegeLord commented on Feb 8, 2017

@SiegeLord
Contributor

The errors I hit happen way before that is hit. Here's an example error:

error[E0464]: multiple matching crates for `getopts`
 --> /home/siege/Projects/RustGnuplot/examples/common.rs:3:1
  |
3 | extern crate getopts;
  | ^^^^^^^^^^^^^^^^^^^^^
  |
  = note: candidates:
  = note: path: /home/siege/Projects/RustGnuplot/build2/getopts_dep/target/debug/deps/libgetopts-3facdbd0235704b0.rlib
  = note: crate name: getopts
  = note: path: /usr/local/lib/rustlib/x86_64-unknown-linux-gnu/lib/libgetopts-9f0027fbffa38971.so
  = note: path: /usr/local/lib/rustlib/x86_64-unknown-linux-gnu/lib/libgetopts-9f0027fbffa38971.rlib
  = note: crate name: getopts

You hit this when you use rustc directly without cargo, as cargo will disambiguate using the --extern flag for you. Doing it as a non-cargo user is a pain, however, since --extern takes the filename, and if the filename contains a hash created by cargo which changes at the drop of a hat, it's just a big pain to even construct the correct --extern argument.

nikomatsakis

nikomatsakis commented on Feb 22, 2017

@nikomatsakis
Contributor

I'd be in favor of doing this rename, I think. It seems odd to have the same crates in two places. But maybe @alexcrichton has plans to just move us over to the crates.io crates eventually or something?

steveklabnik

steveklabnik commented on Feb 22, 2017

@steveklabnik
Member

plans to just move us over to the crates.io crates eventually or something?

I think so, or at least, I'd be a big 👍 there

alexcrichton

alexcrichton commented on Feb 23, 2017

@alexcrichton
Member

Yes for any relevant crates I'd like to move to using the crates.io versions, but I don't think we'll ever get around to moving everything out of tree, just support libs and such.

added
T-libs-apiRelevant to the library API team, which will review and decide on the PR/issue.
and removed on Mar 24, 2017
steveklabnik

steveklabnik commented on Sep 15, 2017

@steveklabnik
Member

Update: we can now use crates.io crates, but not all crates that are on crates.io have been updated to those versions.

cyplo

cyplo commented on Apr 20, 2018

@cyplo
Contributor

Heya ! Hope you're having a beautiful day !

Any updates on this one ?

Mark-Simulacrum

Mark-Simulacrum commented on Aug 31, 2019

@Mark-Simulacrum
Member

I personally think this isn't really something we can/want to do anymore today, we depend on dozens of crates.io crates and place those in the sysroot today. Error messages on attempted use aren't great but that's an orthogonal issue.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

No one assigned

    Labels

    C-enhancementCategory: An issue proposing an enhancement or a PR with one.T-libs-apiRelevant to the library API team, which will review and decide on the PR/issue.

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

      Development

      No branches or pull requests

        Participants

        @steveklabnik@alexcrichton@nikomatsakis@cyplo@SiegeLord

        Issue actions

          Rename built-in crates · Issue #24853 · rust-lang/rust