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

Crate name of executable projects is set to "main" #207

Closed
japaric opened this issue Jul 16, 2014 · 1 comment · Fixed by #208
Closed

Crate name of executable projects is set to "main" #207

japaric opened this issue Jul 16, 2014 · 1 comment · Fixed by #208

Comments

@japaric
Copy link
Member

japaric commented Jul 16, 2014

STR

$ cat Cargo.toml
[package]
authors = ["Me"]
name = "hello"
version = "0.0.0"
$ cat src/main.rs
#![feature(phase)]

#[phase(link, plugin)] extern crate log;

fn main() {
    info!("Hello log!");
    println!("Hello world!");
}
$ cargo build
Compiling hello v0.0.0 (file:/home/japaric/Downloads/hello)
$ tree target
target
|-- deps
`-- main

1 directory, 1 file
$ RUST_LOG=hello=info target/main
Hello world!
$ RUST_LOG=main=info target/main
INFO:main: Hello log!
Hello world!

I expected the crate name of my project to be "hello" (like it does with projects that are libraries). Did I miss an option to do this?

@japaric
Copy link
Member Author

japaric commented Jul 16, 2014

Adding a #![crate_name = "hello"] to src/main.rs doesn't change the crate name either.

alexcrichton added a commit to alexcrichton/cargo that referenced this issue Jul 17, 2014
The crate name should be the package name, not `main`.

Closes rust-lang#207
bors added a commit that referenced this issue Jul 17, 2014
The crate name should be the package name, not `main`.

Closes #207
@bors bors closed this as completed in #208 Jul 17, 2014
alexcrichton added a commit to alexcrichton/cargo that referenced this issue Sep 2, 2014
The crate name should be the package name, not `main`.

Closes rust-lang#207
bors added a commit to alexcrichton/cargo that referenced this issue Sep 2, 2014
The crate name should be the package name, not `main`.

Closes rust-lang#207
ehuss pushed a commit to ehuss/cargo that referenced this issue Nov 19, 2023
Make Diagnostic::is_primary public
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 a pull request may close this issue.

1 participant