Skip to content

Support explicit names in pkgid attributes #10972

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

Merged
merged 2 commits into from
Dec 17, 2013

Conversation

metajack
Copy link
Contributor

This change extends the pkgid attribute to allow of explicit crate names, instead of always inferring them based on the path. This means that if your GitHub repo is called rust-foo, you can have your pkgid set your library name to foo. You'd do this with a pkgid attribute like github.com/somewhere/rust-foo#foo:1.0.

This is half of the fix for #10922.

@alexcrichton
Copy link
Member

Is it still possible to identify packages via github.com/foo/bar#version? Does this basically leave all existing logic as-is and simply provide a way to install a package with a repo name of rust-foo but an actual crate name of bar?

@metajack
Copy link
Contributor Author

@alexcrichton Yes. The old behavior is preserved. The old unit tests are still there, though they were modified because the way pkgid.path is handled is changed. This is fine since nothing in rustc uses this yet.

@metajack
Copy link
Contributor Author

@alexcrichton Rebased. re-r? Did I answer your questions?

@metajack
Copy link
Contributor Author

Removed new syntax in crates since that won't bootstrap. Doh!

Previously the a pkgid of `foo/rust-bar#1.0` implied a crate name of
`rust-bar` and didn't allow this to be overridden. Now you can override the
inferred crate name with `foo/rust-bar#bar:1.0`.
@metajack
Copy link
Contributor Author

Removed some stray trailing whitespace.

bors added a commit that referenced this pull request Dec 17, 2013
This change extends the pkgid attribute to allow of explicit crate names, instead of always inferring them based on the path. This means that if your GitHub repo is called `rust-foo`, you can have your pkgid set your library name to `foo`. You'd do this with a pkgid attribute like `github.com/somewhere/rust-foo#foo:1.0`.

This is half of the fix for #10922.
@bors bors closed this Dec 17, 2013
@bors bors merged commit 262cc4a into rust-lang:master Dec 17, 2013
flip1995 pushed a commit to flip1995/rust that referenced this pull request Jan 9, 2025
`asked to assemble constituent types of unexpected type: Binder(Foo, [])`

Fixes rust-lang#10972
flip1995 pushed a commit to flip1995/rust that referenced this pull request Jan 9, 2025
`asked to assemble constituent types of unexpected type: Binder(Foo,
[])`

Fixes rust-lang#10972

changelog: none
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

3 participants