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".
Alex Crichton [Sun, 29 Jun 2014 04:30:44 +0000 (21:30 -0700)]
Implement parallel compilation
This commit implements the -j flag in the `cargo_rustc` module, using the
primitives from the previous 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".
Alex Crichton [Sun, 29 Jun 2014 18:03:15 +0000 (11:03 -0700)]
Add a dependency queue abstraction
This data structure is used to track when packages should be built and when they
become buildable. Additionally, it is used to propagate dirtiness throughout the
dependency graph.
Alex Crichton [Sun, 29 Jun 2014 04:23:50 +0000 (21:23 -0700)]
Add a task-pool abstraction
The standard library also provides a task pool, but it's scheduling is not quite
the desired semantics. This task pool instead has all workers contend on a
shared queue to take work from rather than assigning new jobs to specific
workers for forever.
Alex Crichton [Sat, 28 Jun 2014 23:55:02 +0000 (16:55 -0700)]
Make CargoError inherit from Send
Due to a bug in the compiler, this also requires adding `+ Send` any time that
CargoError is mentioned. This change will allow errors to be sent across tasks.
bors [Fri, 27 Jun 2014 21:12:07 +0000 (21:12 +0000)]
auto merge of #78 : huonw/cargo/minor-de-.unwrapping, r=alexcrichton
I don't think any of the `.unwrap`s I touched can actually be hit since they all seem to have checks earlier, but reducing the number of calls is always nice and makes the code easier to verify.
I'm not sure if the `,` -> `:` commit is actually correct, I was just working from the surrounding context.
Huon Wilson [Fri, 27 Jun 2014 11:55:11 +0000 (21:55 +1000)]
Remove/refactor some .unwraps.
Many of these had some precondition being changed that guaranteed they'd
never happen, but could be expressed to just avoid the `.unwrap`
entirely (easier to check).
Other `Option` unwraps were changed to have a mildly more informative
error message by using `.expect`.
bors [Fri, 27 Jun 2014 03:36:24 +0000 (03:36 +0000)]
auto merge of #70 : alexcrichton/cargo/buildbot, r=wycats
* The installation script was modified to recognize when its running on windows,
as well as tweaking how it downloads and installs snapshots. The goal here was
to make the script runnable on buildbot for mac/linux/windows with 32/64 bit
options on mac/linux.
* The installation script now install rustc to `rustc/bin` in the local
directory to have parallel builds on buildbot.
* The tests now store all their temporary state locally in the build directory
to enable parallel builds on buildbot.
* A shell test is ignored which assumed the presence of a TTY output.
Alex Crichton [Wed, 25 Jun 2014 23:31:57 +0000 (16:31 -0700)]
Prepare for buildbot automation
* The installation script was modified to recognize when its running on windows,
as well as tweaking how it downloads and installs snapshots. The goal here was
to make the script runnable on buildbot for mac/linux/windows with 32/64 bit
options on mac/linux.
* The installation script now install rustc to `rustc/bin` in the local
directory to have parallel builds on buildbot.
* The tests now store all their temporary state locally in the build directory
to enable parallel builds on buildbot.
* A shell test is ignored which assumed the presence of a TTY output.
Alex Crichton [Wed, 25 Jun 2014 18:53:19 +0000 (11:53 -0700)]
Don't recompile nested deps too frequently
When compiling a package with a nested dependency, any modification to the outer
package would trigger a recompilation of the inner package. This commit alters
the fingerprint() method to take a PackageId to query about the location of a
package and only lookup the files relevant to that package.
The dependency structure of a PathSource is now everything rooted at the
original Cargo.toml minus all subdirectories which contain a Cargo.toml
Alex Crichton [Wed, 25 Jun 2014 05:09:23 +0000 (22:09 -0700)]
Ignore \r in output matching
Windows occasionally has \r\n while everywhere else has \n. Instead of worrying
about the difference, just replace all instances of \r with nothing and rely on
matching against \n.