7275 Commits

Author SHA1 Message Date
bors
91453d1ffa auto merge of #238 : alexcrichton/cargo/cstr-builder, r=wycats
At the same time, remove a bunch of `path.display().to_string()` and friends.
2014-07-22 15:44:51 +00:00
Alex Crichton
e670203261 Add a test for closed issue #111
This was fixed when rustc properly added extra-filename to all temp outputs as
opposed to just libraries.

Closes #111
2014-07-22 07:45:46 -07:00
bors
6ff9baed25 auto merge of #235 : rust-lang/cargo/better-test-output, r=alexcrichton
@alexcrichton r?
2014-07-22 05:22:22 +00:00
Alex Crichton
4f9d67bce0 Fix windows tests 2014-07-21 22:21:22 -07:00
Alex Crichton
b30892fc01 Use Path::display().to_string() less often
Unfortunately this cannot yet have a test for it as rustc itself does not work
if it is run on non-utf8 paths.
2014-07-21 19:34:17 -07:00
Alex Crichton
73049b3868 Move git macros to using arg() 2014-07-21 19:34:17 -07:00
Christoph Burgdorf
c0d2b79ef1 kill unnecessary lifetime annotations
This commit removes lifetime annotations
that are now automatically inferred by
the compiler.
2014-07-22 00:08:06 +02:00
Yehuda Katz
51432d488a Improve test output 2014-07-21 12:23:01 -07:00
Yehuda Katz
4e6c3bd10a Improve error message on failed compile 2014-07-21 10:38:31 -07:00
bors
3a2a8205da auto merge of #222 : alexcrichton/cargo/no-cargo-toml-in-target, r=wycats
When cargo is building itself, it just ends up getting confused because the test
directory is in this location.
2014-07-21 15:59:39 +00:00
Brian Koropoff
895f541192 Add regression test for running cargo test twice 2014-07-20 17:33:08 -07:00
Alex Crichton
5e1c31d52d Don't look inside target/ for sub-packages
When cargo is building itself, it just ends up getting confused because the test
directory is in this location.
2014-07-19 21:50:53 -07:00
Alex Crichton
c2b23512d5 House all native build output in a per-package dir
In order to ensure there are no stale artifacts as part of a build, this commit
houses all output of native build commands in their own directories. Each
directory is on a per-package basis, and the output is preserved if the package
is fresh or discarded if it is not.

This does not remove the DEPS_DIR environment variable, it just wires it to the
same value as OUT_DIR.
2014-07-18 18:04:47 -07:00
Alex Crichton
9f5d9b8166 Blow away all directories/files on each build
And aftewards selectively move them back into place if they're fresh. This
prevents stale files from showing up from old builds.

This currently breaks anyone build `build=` scripts, the fix is coming in the
next commit.

Closes #205
2014-07-18 15:56:16 -07:00
bors
7a2aa75414 auto merge of #212 : fhahn/cargo/version, r=alexcrichton
This PR adds a rustc style version command
2014-07-18 14:53:17 +00:00
Alex Crichton
aaaf9dbf1e Update to master 2014-07-18 07:40:15 -07:00
Florian Hahn
fc9825318f Add version command, closes #201 2014-07-18 14:42:26 +02:00
Florian Hahn
c4710b74e7 Use indexing instead of get() function to access Vec 2014-07-17 22:27:02 +02:00
Alex Crichton
835e5ac1ac Fix inferred name of src/main.rs
The crate name should be the package name, not `main`.

Closes #207
2014-07-16 18:44:30 -07:00
Alex Crichton
3608fd4892 Update toml-rs
TOML recently grew multiline string literals as well as literal strings with no
escaping, which can be used instead of the hokey escape_path() function.
2014-07-16 08:08:55 -07:00
Alex Crichton
12af54e17a Allow configuratin ar/ld for rustc
This adds a new .cargo/config option which allows configuring the ar and linker
tools that rustc invokes. This should aid in any cross-compilation attempts.
2014-07-14 11:28:40 -07:00
bors
811d70d148 auto merge of #190 : alexcrichton/cargo/cargo-run, r=wycats
This currently only supports executing the `src/main.rs` convention, no other.

Close #149
2014-07-14 18:16:57 +00:00
Alex Crichton
a64b9073f4 Add a cargo run command
This currently only supports executing the `src/main.rs` convention, no other.

Close #149
2014-07-14 06:40:51 -07:00
Alex Crichton
8defed6160 Pass all formats via --extern for libs
While we support the `crate_type` key in the manifest, we need to pass through
all crate types to the `--extern` flag.

Closes #177
2014-07-13 11:33:11 -07:00
bors
ec0895b460 auto merge of #188 : huonw/cargo/remove-src-test, r=wycats
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`.

Closes #187.
2014-07-13 15:48:50 +00:00
Huon Wilson
22c254af74 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`.

Closes #187.
2014-07-13 22:48:45 +10:00
bors
2f60ba328b auto merge of #180 : sfackler/cargo/ndebug, r=wycats
This will disable debug!() and debug_assert!() statements.
2014-07-13 05:44:50 +00:00
Steven Fackler
a12a909c04 Pass --cfg ndebug when debug = false
This will disable debug!() and debug_assert!() statements.
2014-07-12 20:46:11 -07:00
Alex Crichton
a70be72342 Pass through extra arguments to cargo test
This allows `cargo test` usage to filter test being run, use --nocapture, etc.
2014-07-12 20:29:51 -07:00
bors
9d13d8a184 auto merge of #170 : alexcrichton/cargo/same-name, r=wycats
This allows the dependency queue to properly handle packages with the same
name but from different sources.

A test was added which exercieses this functionality by depending on two
different revs of the same git repo.
2014-07-12 03:59:51 +00:00
Alex Crichton
f6d22b64b9 Use PackageId in the DependencyQueue
This allows the dependency queue to properly handle packages with the same
name but from different sources.

A test was added which exercieses this functionality by depending on two
different revs of the same git repo.
2014-07-11 14:20:24 -07:00
Ben Longbons
2e90972004 Do not run examples during 'cargo test' 2014-07-11 13:41:26 -07:00
Ben Longbons
b7379e51b4 Add support for external tests 2014-07-11 13:41:26 -07:00
Ben Longbons
246c9e2a55 Add support for examples 2014-07-11 13:41:26 -07:00
Alex Crichton
ff19a48290 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.
2014-07-11 12:20:25 -07:00
Alex Crichton
685f2b4ee7 Add some simple tests for cross compilation 2014-07-11 09:08:51 -07:00
Alex Crichton
662b8553d6 Fix some tests 2014-07-10 12:51:13 -07:00
Alex Crichton
16df1ab41e Tighten up some tests 2014-07-10 12:08:13 -07:00
Alex Crichton
d29910068c Fix filtering for test deps
This fixes `cargo test` to only test the *local* package
2014-07-10 11:50:03 -07:00
Michael Gehring
139e81ea82 ToStr::to_str -> ToString::to_string
Conflicts:
	src/cargo/core/resolver.rs
	src/cargo/ops/cargo_rustc.rs
2014-07-10 08:37:57 -07:00
Yehuda Katz
215ae2f9a1 Remove hardcoding 2014-07-10 01:26:51 -07:00
Yehuda Katz
7eb5ea543d Fixed a number of bugs related to rustc building
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).
2014-07-10 00:27:40 -07:00
Yehuda Katz + Carl Lerche
e143491356 Resolve more correctly and add --extern
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.
2014-07-09 20:17:08 -07:00
Alex Crichton
558e75347e 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.
2014-07-09 13:55:00 -07:00
Alex Crichton
3550dd5040 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.
2014-07-09 13:08:44 -07:00
Yehuda Katz + Carl Lerche
59bc9adb29 Refactor PackageId.namespace -> source_id 2014-07-08 14:58:56 -07:00
Joshua DeSeno
0025dbde64 cargo clean. resolves #51 2014-07-08 21:54:15 +09:00
bors
a6061db0d0 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.
2014-07-08 06:14:56 +00:00
Yehuda Katz + Carl Lerche
ee1a81a801 This updates Cargo for #[crate_name] 2014-07-07 21:42:34 -07:00
Alex Crichton
03ccdd8169 Warn about missing [[lib]] and [[bin]] sections
Closes #120
2014-07-07 20:59:47 -07:00