Huon Wilson [Sun, 13 Jul 2014 12:45:26 +0000 (22:45 +1000)]
Remove the src/test.rs implicit test.
It's not unreasonable to have unittests in a separate submodule of the
crate (being called `test` or `tests`), and having them in their own
file can be very sensible. Thus, the `src/test.rs` implicit default is
likely to trip up some perfectly reasonable use-cases. There's already
the `tests/...` default, so repairing a codebase after this removal is
just moving `src/test.rs` to `tests/whatever_name_you_want.rs`.
auto merge of #163 : o11c/cargo/examples, r=wycats
This add support for `examples/*.rs` being built (as normal bin crates) during `cargo test`,
and `src/test.rs` and `tests/*.rs` being built and run (as test crates) during `cargo test`.
auto merge of #169 : cburgdorf/cargo/name_clean, r=alexcrichton
There are other unnamed commands like `verify-project` but I'm unsure if they are **not** listed on purpose because they should be used directly by the user less frequently. However, the clean command seems like a command that should be listed here.
Not sure about the wording though. It could be more abstract like *remove build artifacts* but given it's current behavior I think *remove target directory* is somehow straight forward, too.
Alex Crichton [Fri, 11 Jul 2014 18:22:07 +0000 (11:22 -0700)]
Finish plugin support
This commit implements full support for plugins by answering the question of
whether any target needed as a plugin or needed as a target dependency. This
commit builds on the previous abstractions to enable parallel compilation
wherever possible.
Alex Crichton [Fri, 11 Jul 2014 14:50:24 +0000 (07:50 -0700)]
Improve intra-target parallelism
With cross compilation soon on the horizon, it may be required to build a
library for both the host and target architectures. These two copies can
certainly be built in parallel. Additionally, all binaries produced by a package
can also be built in parallel, but are currently forced to be built
sequentially.
This commit improves this parallelism by allowing each job to create more work
before the package is considered built. Only after all targets have been built
is the new fingerprint written.
Alex Crichton [Thu, 10 Jul 2014 23:03:01 +0000 (16:03 -0700)]
Add bare-bones cross compilation support to cargo
This adds a new flag, --target, to the `cargo-build` command. This flag will
indicate that all output should be scoped under the `$triple` directory inside
of the output `target` directory. The compiler is invoked with `--target
$triple` and all custom build commands are passed `TRIPLE` if one is provided.
Most notably, `resolve` now takes the root, so it can properly link the
root package with its dependencies (which is required to build the
--externs for the root package).
This commit adds support for passing --extern to dependencies. It allows
multiple copies of the same named dependency in the system, as long as
they come from different repos.
Alex Crichton [Wed, 9 Jul 2014 20:55:00 +0000 (13:55 -0700)]
Fix --release not compiling upstream deps with -O3
This touches up the filtering logic to ensure that upstream dependencies as well
as local dependencies are built with optimizations when `cargo build --release`
is used.
Alex Crichton [Wed, 9 Jul 2014 20:08:44 +0000 (13:08 -0700)]
Fix testing bins with lib deps
If a package had both bin and lib deps, `cargo test` was not building the `lib`
dependency when building the bins with `--test`. This commit adds an extra
"test" profile (not compiled with --test) for situations such as this which is
filtered out normally but kept around for the `cargo test` case.
auto merge of #150 : rust-lang/cargo/source-id-cleanup, r=alexcrichton
This PR is a stepping stone towards eventual use of `--extern`, which will allow multiple packages with the same name to exist in the transitive dependency graph.
auto merge of #142 : rust-lang/cargo/new-names, r=alexcrichton
This PR moves Cargo over to the new naming based on [RFC 35](https://github.com/rust-lang/rfcs/blob/master/complete/0035-remove-crate-id.md).
* You should no longer use `#[crate_name]` or `#[crate_id]` in any crate managed by Cargo.
* You no longer need a `[[lib]]` section in your `Cargo.toml` if you name your library `src/lib.rs`.
* You no longer need a `[[bin]]` section in your `Cargo.toml` if you name your library `src/main.rs`.
* You can include multiple `[[bins]]` in `src/bin/*.rs` and Cargo will treat them as if they were specified via `[[bin]]`.
This commit does not yet add support for `-C metadata` or `-C extra-file-name`, but that is coming soon.
auto merge of #139 : tomjakubowski/cargo/fix-symlink-blowup, r=alexcrichton
Fingerprinting will fail at an `fs::stat()` call if there is a symlink in
a package's directory pointing to a non-existent file or directory.
This commit recovers from an `fs::stat(`) error on these bogus symlinks by
faking an mtime of 0, which should not affect the overall fingerprint.
Tom Jakubowski [Mon, 7 Jul 2014 21:46:03 +0000 (14:46 -0700)]
fingerprint: Recover from fs::stat errors
Fingerprinting will fail at an fs::stat() call if there is a broken
symlink in a package's directory. This commit recovers from fs::stat()
errors on broken symlinks by treating them as having mtime 0, which
should not affect the overall fingerprint.
auto merge of #129 : riccieri/cargo/no_more_crate_id, r=alexcrichton
This solves warnings about the use of the deprecated `#![crate_id]` attribute, as well as the deprecated `--crate-file-name` command line option. See rust-lang/rust@c3ef04be5589901e7f3d9428ebe8f1eb2bdca7e4 for details.
Note that this won't compile on the current master without #128 (or equivalent). I can rebase after a fix lands
auto merge of #123 : alexcrichton/cargo/canonicalize-github-urls, r=wycats
In addition to canonicalizing checkout locations, this canonicalizes packages
for the resolver. This allows two dependencies with slightly different urls
pointing to the same repository to resolve to the same location and package.
Alex Crichton [Sat, 5 Jul 2014 23:44:55 +0000 (16:44 -0700)]
Canonicalize github urls for the resolver
In addition to canonicalizing checkout locations, this canonicalizes packages
for the resolver. This allows two dependencies with slightly different urls
pointing to the same repository to resolve to the same location and package.
Development and test dependencies should not be transitively pulled in.
For example, if I use rust-curl, and it happens to use hamcrest for
testing, that does not mean I depend on hamcrest.
auto merge of #108 : jdeseno/cargo/clean-submodules, r=alexcrichton
Small change. Use git's `submodule` `foreach` command to cleanup dependencies. I think this way you won't have to remember to update the makefile when a dependency is added or removed.
auto merge of #100 : rust-lang/cargo/meta-packages, r=alexcrichton
This allows a single git repository to have multiple packages contained inside.
* Cargo will look for `Cargo.toml`s located anywhere inside the project.
* Cargo will stop searching once it reaches a submodule, to avoid accidentally exporting someone else's packages. It is still possible to explicitly depend on packages from a submodule using the `path=` syntax on dependencies.
auto merge of #101 : alexcrichton/cargo/fix-git-1.7, r=wycats
Apparently these versions of git are broken for `git fetch $url`, so we have to
resort to `git fetch origin` and then just pray that it hasn't changed in the
meantime.
Alex Crichton [Tue, 1 Jul 2014 02:37:55 +0000 (19:37 -0700)]
Fix fetch() on git < 1.7.3
Apparently these versions of git are broken for `git fetch $url`, so we have to
resort to `git fetch origin` and then just pray that it hasn't changed in the
meantime.
bors [Mon, 30 Jun 2014 23:15:02 +0000 (23:15 +0000)]
auto merge of #92 : alexcrichton/cargo/dash-j, r=wycats
This commit implements the -j flag in the `cargo_rustc` module, using the
primitives from the other commits. The default parllelism is `os::num_cpus()`.
This change also brings proper freshness propagation instead of the hokey logic
of once something is compiled, "compile everything to the right as well".