dhuseby / cargo-bootstrap

Bootstrapping script for Rust Cargo when cross-compilation is difficult or impossible.
BSD 2-Clause "Simplified" License
37 stars 9 forks source link

Use crate name as library name if none is explicitly set #14

Closed zofrex closed 8 years ago

zofrex commented 8 years ago

Running cargo-bootstrap fails for me when it reaches the regex crate:

Exception:
 from ./bootstrap.py, line 913:
 'name'

After looking into it, it's complaining about a missing name because the Cargo.toml for the regex crate does not explicitly set a name for the library:

[lib]
# There are no benchmarks in the library code itself
bench = false

According to the Cargo docs if a library name is not set it defaults to the name of the crate. This patch makes cargo-bootstrap observe that behaviour, and with it I can continue past this stage of the build.