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

Normalize hyphens to underscores in crate names #1443

Merged
merged 1 commit into from
Mar 25, 2015

Conversation

alexcrichton
Copy link
Member

This change allows packages to have hyphens in them, but they are always
translated to underscores when translated to a crate name. This means that all
crates are compiled with a --crate-name that has no hyphens (as well as
--extern directives having no hyphens).

Binaries and examples, however, are allowed to contain
hyphens in their name. The "crate name" will still have an underscore, but the
output will be in the same dasherized name.

Explicitly named targets are not allowed to have hyphens in them as well.

@rust-highfive
Copy link

r? @wycats

(rust_highfive has picked a reviewer for you, use r? to override)

@alexcrichton
Copy link
Member Author

Note that the massive diff is because this is rebased on #1441 which has some necessary internal fixes for this patch to work properly. Only the last commit is part of this PR.

exec_engine: None,
release: true,
mode: ops::CompileMode::Bench,
filter: if benches.len() == 0 {
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

.is_empty

Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

looks like there are about 4 more occurrences of this

Copy link
Member Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

These are actually from #1441 (this PR is just rebased on that one currently)

Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

oh, yep, missed that. Thanks, and sorry!

Copy link
Member Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

no worries :)

@brson
Copy link
Contributor

brson commented Mar 24, 2015

r=me

@alexcrichton
Copy link
Member Author

@bors: r=brson

@bors
Copy link
Collaborator

bors commented Mar 24, 2015

📌 Commit 9e35e19 has been approved by brson

@bors
Copy link
Collaborator

bors commented Mar 24, 2015

⌛ Testing commit 9e35e19 with merge a9d1044...

@bors
Copy link
Collaborator

bors commented Mar 24, 2015

💔 Test failed - cargo-win-32

@alexcrichton
Copy link
Member Author

@bors: r=brson c9b4fdd

@bors
Copy link
Collaborator

bors commented Mar 24, 2015

⌛ Testing commit c9b4fdd with merge 6e7d552...

@bors
Copy link
Collaborator

bors commented Mar 24, 2015

💔 Test failed - cargo-linux-32

@alexcrichton
Copy link
Member Author

@bors: r=brson

@bors
Copy link
Collaborator

bors commented Mar 25, 2015

📌 Commit b2acc24 has been approved by brson

@bors
Copy link
Collaborator

bors commented Mar 25, 2015

⌛ Testing commit b2acc24 with merge 21540a6...

bors added a commit that referenced this pull request Mar 25, 2015
This change allows *packages* to have hyphens in them, but they are always
translated to underscores when translated to a crate name. This means that all
crates are compiled with a `--crate-name` that has no hyphens (as well as
`--extern` directives having no hyphens).

Binaries and examples, however, are allowed to contain
hyphens in their name. The "crate name" will still have an underscore, but the
output will be in the same dasherized name.

Explicitly named targets are not allowed to have hyphens in them as well.
@bors
Copy link
Collaborator

bors commented Mar 25, 2015

💔 Test failed - cargo-win-32

@alexcrichton
Copy link
Member Author

@bors: retry

On Tue, Mar 24, 2015 at 7:02 PM, bors notifications@github.com wrote:

[image: 💔] Test failed - cargo-win-32
http://buildbot.rust-lang.org/builders/cargo-win-32/builds/918


Reply to this email directly or view it on GitHub
#1443 (comment).

@bors
Copy link
Collaborator

bors commented Mar 25, 2015

⚡ Previous build results for cargo-linux-32, cargo-linux-64, cargo-mac-32, cargo-mac-64 are reusable. Rebuilding only cargo-win-32, cargo-win-64...

@bors
Copy link
Collaborator

bors commented Mar 25, 2015

💔 Test failed - cargo-win-32

This change allows *packages* to have hyphens in them, but they are always
translated to underscores when translated to a crate name. This means that all
crates are compiled with a `--crate-name` that has no hyphens (as well as
`--extern` directives having no hyphens).

Binaries, examples, benchmarks, and tests, however, are allowed to contain
hyphens in their name. The "crate name" will still have an underscore, but the
output will be in the same dasherized name.

Explicitly named targets are not allowed to have hyphens in them as well.
@alexcrichton
Copy link
Member Author

@bors: r+

On Tue, Mar 24, 2015 at 7:19 PM, bors notifications@github.com wrote:

[image: 💔] Test failed - cargo-win-32
http://buildbot.rust-lang.org/builders/cargo-win-32/builds/919


Reply to this email directly or view it on GitHub
#1443 (comment).

@bors
Copy link
Collaborator

bors commented Mar 25, 2015

📌 Commit afe88e0 has been approved by alexcrichton

@bors
Copy link
Collaborator

bors commented Mar 25, 2015

⌛ Testing commit afe88e0 with merge 0e42b4d...

bors added a commit that referenced this pull request Mar 25, 2015
…hton

This change allows *packages* to have hyphens in them, but they are always
translated to underscores when translated to a crate name. This means that all
crates are compiled with a `--crate-name` that has no hyphens (as well as
`--extern` directives having no hyphens).

Binaries and examples, however, are allowed to contain
hyphens in their name. The "crate name" will still have an underscore, but the
output will be in the same dasherized name.

Explicitly named targets are not allowed to have hyphens in them as well.
@bors
Copy link
Collaborator

bors commented Mar 25, 2015

☀️ Test successful - cargo-linux-32, cargo-linux-64, cargo-mac-32, cargo-mac-64, cargo-win-32, cargo-win-64

@bors bors merged commit afe88e0 into rust-lang:master Mar 25, 2015
@alexcrichton alexcrichton deleted the hyphens-to-underscores branch March 27, 2015 00:09
bdero added a commit to bdero/piston-examples that referenced this pull request Mar 29, 2015
Because Cargo now errors when explicitely named targets contain hyphens:
rust-lang/cargo#1443
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.

None yet

6 participants