Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Rename rustc_unicode to std_unicode #36806

Closed
wants to merge 1 commit into from

Conversation

brson
Copy link
Contributor

@brson brson commented Sep 28, 2016

All other cases of the rustc "namespace" identify crates that are part
of the compiler, whereas this one is part of the standard library. By
changing the name of this crate one can count on all "librustc"
directories being part of the compiler.

This has long bugged me.

r? @alexcrichton cc @rust-lang/libs

All other cases of the rustc "namespace" identify crates that are part
of the compiler, whereas this one is part of the standard library.  By
changing the name of this crate one can count on all "librustc"
directories being part of the compiler.
@brson
Copy link
Contributor Author

brson commented Sep 28, 2016

cc @SimonSapin

@alexcrichton alexcrichton added the T-libs-api Relevant to the library API team, which will review and decide on the PR/issue. label Sep 28, 2016
@alexcrichton
Copy link
Member

So long as it's always super private with tons of red tape saying "please don't use this" I'm pretty much fine with w/e name. I think rustc_unicode had the connotation of "private" due to the rustc namespace, but agreed that it's not appropriate for this lib itself.

I'll give it a bit though to see if anyone objects.

@japaric
Copy link
Member

japaric commented Sep 28, 2016

This is going to annoying to deal with in Xargo. It currently builds the sysroot by creating an empty sysroot crate that depends on all the C-free crates and rustc_unicode is one of those dependencies. I'd have to add some logic (probably date based) to build std_unicode instead of rustc_unicode or simply stop building the unicode crate; I have no idea if anyone actually uses it.

If not a priority, I'd prefer if this rename landed after std-aware Cargo becomes a thing and Xargo is no longer necessary but perhaps that would be too late? I don't what's the stability policy around the standard crates Cargo could access to. As in: are renames possible after std-aware Cargo comes into existence?

@FenrirWolf
Copy link
Contributor

FenrirWolf commented Sep 28, 2016

Uh-oh. I'm using rustc_unicode in ctru-rs because the Nintendo 3DS uses UTF-16 filepaths and encode_utf16() isn't available in collections::string::String (or maybe it was the lack of decode_utf16() on core::char, I forget which). So if you can keep it working in Xargo, I'd love that <3

@japaric
Copy link
Member

japaric commented Sep 28, 2016

@FenrirWolf Noted! Since there's at least one user, Xargo will continue to supported the unicode crate.

@alexcrichton
Copy link
Member

I think we're fine wrt renaming crates like this. We obviously can't rename a stable crate, but unstable crates can't be stably depended on anyway so I'd be fine considering this "acceptable breakage" under that banner.

@SimonSapin
Copy link
Contributor

Renaming sounds fine to me, modulo xargo concerns.

@FenrirWolf can you confirm what API is missing? Sounds like we should add something to libcore or libstd.

@FenrirWolf
Copy link
Contributor

FenrirWolf commented Sep 28, 2016

Looks like it's char::decode_utf16() that I'm using from rustc_unicode. It's available in the standard library, but I'm limited to freestanding crates for this project.

Either way, will renaming the unicode crate really keep Xargo from building it? looks like it's still freestanding even with these changes.

@aturon
Copy link
Member

aturon commented Sep 29, 2016

I'm also fine with renaming.

@SimonSapin
Copy link
Contributor

As far as I understand, the issue with xargo is to decide which sysroot crates to build. But I suppose it could check whether a std_unicode directory exists?


Taking another look at the naming convention: if we’re going with a std_ prefix, shouldn’t all in-tree recursive dependencies of std have it?

@japaric
Copy link
Member

japaric commented Sep 29, 2016

But I suppose it could check whether a std_unicode directory exists?

Sure, it can be done. It's just annoying to keep adding ad hoc logic to Xargo.

@bors
Copy link
Contributor

bors commented Sep 29, 2016

☔ The latest upstream changes (presumably #36377) made this pull request unmergeable. Please resolve the merge conflicts.

@brson
Copy link
Contributor Author

brson commented Sep 30, 2016

Since there's no pressing need to do this, I'm going to close, but we are going to rename this crate someday. Unstable things are unstable for a reason.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
T-libs-api Relevant to the library API team, which will review and decide on the PR/issue.
Projects
None yet
Development

Successfully merging this pull request may close these issues.

7 participants