Commit graph

678 commits

Author SHA1 Message Date
bors b750ef2b51 auto merge of #421 : alexcrichton/cargo/issue-418, r=wycats 2014-08-27 01:13:22 +00:00
bors 89ad2e3305 auto merge of #419 : alexcrichton/cargo/issue-406, r=brson
This allows tests to be built, but not run.

Closes #406
2014-08-27 01:04:59 +00:00
Alex Crichton 92eed92a24 Fix cargo run for renamed bin targets 2014-08-26 17:57:01 -07:00
Alex Crichton 05bdddaa7b Add a --no-run option to cargo test
This allows tests to be built, but not run.
2014-08-26 17:45:49 -07:00
bors d9d16a8878 auto merge of #450 : alexcrichton/cargo/fix-cargo, r=alexcrichton 2014-08-27 00:24:01 +00:00
Alex Crichton 5bc5439d1c Fix a flaky test while the compiler is changing 2014-08-26 17:21:45 -07:00
Alex Crichton 976f255517 Print out the rustc version before each build 2014-08-26 17:21:15 -07:00
Björn Steinbrink 1804feedcb Fix building with current rust 2014-08-26 20:55:39 +02:00
bors bd2fd92e9f auto merge of #434 : alexcrichton/cargo/issue-433, r=huonw
All subprocesses will now be invoked with CARGO_MANIFEST_DIR pointing at the root of the
source directory that they are working on (compiling). This commit also
reorganizes the version environment variables to use the new infrastructure.

Closes #433
2014-08-25 13:44:11 +00:00
Alex Crichton 9732133133 Add a new CARGO_MANIFEST_DIR environment variable
All subprocesses will now be invoked with CARGO_MANIFEST_DIR pointing at the
root of the source directory that they are working on (compiling). This commit
also reorganizes the version environment variables to use the new
infrastructure.

Closes #433
2014-08-25 05:48:51 -07:00
bors 6a57afff49 auto merge of #430 : aochagavia/cargo/mod, r=alexcrichton
Example:

```
use std::fmt;
use std::fmt::Show;
```

becomes

```
use std::fmt::{mod, Show};
```
2014-08-24 20:59:09 +00:00
Adolfo Ochagavía 1679210e08 Use mod where possible
Example:

```
use std::fmt;
use std::fmt::Show;
```

becomes

```
use std::fmt::{mod, Show};
```
2014-08-23 21:06:04 +02:00
bors 3b0983c094 auto merge of #428 : garrison/cargo/patch-3, r=alexcrichton
travis-ci now supports "language: rust", which eliminates the need to call rustup.sh in .travis.yml. See http://www.reddit.com/r/rust/comments/2ecocp/travis_ci_supports_rust/ for details.

This is the same change as #425, but on the master branch in guide.md, not guide.html.
2014-08-23 18:29:10 +00:00
Jim Garrison 15732c335d Update guide.md to use "language: rust" in .travis.yml
travis-ci now supports "language: rust", which eliminates the need to call rustup.sh in .travis.yml. See http://www.reddit.com/r/rust/comments/2ecocp/travis_ci_supports_rust/ for details.
2014-08-23 11:18:03 -07:00
bors 7563fba5c3 auto merge of #415 : alexcrichton/cargo/in-tree-docs, r=wycats
There's a bunch of travis config now to rebuild the website whenever something is merged into master.
2014-08-21 17:20:50 +00:00
Alex Crichton 5ac705151a Add all docs in-tree 2014-08-21 10:12:35 -07:00
bors 19b4833fc0 auto merge of #410 : alexcrichton/cargo/fix-doctest-with-dep, r=wycats
The movement of tests to the main `target` directory forgot to update a spot
where rustdoc used a -L flag.

Closes #411
2014-08-20 18:29:03 +00:00
bors 02ace347a2 auto merge of #412 : ScriptDevil/cargo/default-help, r=alexcrichton
Most modern command line utilities print usage/help when invoked without any arguments. 

cargo (prior to this patch) defaults to saying "no such subcommand" when invoked without arguments. 
> $ cargo
> No such subcommand

With this patch, it will instead print the help message
> $ cargo
> Rust's package manager
>
> Usage:
> ...
2014-08-20 17:44:04 +00:00
Ashok Gautham 6968611fe1 Print help message if cargo is invoked with no arguments 2014-08-20 22:34:39 +05:30
Alex Crichton 2ead380f76 Fix doc tests for libs with deps
The movement of tests to the main `target` directory forgot to update a spot
where rustdoc used a -L flag.
2014-08-19 13:13:13 -07:00
bors 7c0e8c1c9d auto merge of #409 : alexcrichton/cargo/snapshots, r=alexcrichton 2014-08-19 19:55:37 +00:00
Alex Crichton 4628670560 Register new snapshots 2014-08-19 12:52:41 -07:00
bors db03659782 auto merge of #408 : alexcrichton/cargo/fix-master, r=alexcrichton 2014-08-19 18:54:07 +00:00
Alex Crichton 1aeebfd71f Fix some flaky tests on the buildbots 2014-08-19 11:52:34 -07:00
bors cc4dadfebe auto merge of #390 : alexcrichton/cargo/revert-libgit2, r=wycats
It has been discovered that the windows builders aren't building a libgit2 with support for SSL, so cloning https repos on windows is broken with libgit2. It doesn't look easy to sort out, so in the meantime this PR reverts the switch to libgit2 and adds @wycats's fixes from the related PR.
2014-08-19 16:21:40 +00:00
Tim Carey-Smith 2c12269e20 Syncs submodules after remote update (closes #370)
Previously, the Git code avoided cloning a local copy of the local
database for a repository if the repo already existed (and instead tried
to fetch). However, fetching does not sync and reinitialize submodules,
which would require more work.

To avoid this problem, and possibly other subtle updating issues in the
future, the code now wipes the local clone whenever it detects that the
HEAD of a particular branch has changed. This avoids subtle
inconsistencies between fresh clones and updates.

Note: This only affects local-to-local clones. It does not initiate any
new network activity. It may require some additional disk usage, but
only when a remote fetch that was already happening discovers new
commits on the checked-out branch.
2014-08-19 09:10:15 -07:00
Alex Crichton c9e0863137 Revert "Use libgit2 for driving git instead of the CLI"
This reverts commit 3cd82ed7a1.

Conflicts:
	src/cargo/sources/git/utils.rs
2014-08-19 09:10:14 -07:00
bors cbb9207d75 auto merge of #384 : alexcrichton/cargo/issue-379, r=wycats
Mainly targeted at incremental build times.
2014-08-19 06:49:09 +00:00
Alex Crichton fff5de375a Make a timing test a little less flaky 2014-08-18 23:47:57 -07:00
Alex Crichton ae1962d759 Allow updating transitive deps
Previously `cargo update foo` would only update the package `foo` if it were a
direct dependency of the local package. This meant that to update a transitive
dependency you would have to update the top-level dependency.

This commit adds the ability to update any dependency by name, regardless of
where it is in the dependency graph. This commit is a bit lossy in terms of
behavior. We are guaranteed that the set of immediate dependencies for any one
package have unique names, but not for the entire package graph. This means that
when you invoke `cargo update foo` it could possibly update two packages named
`foo`.

I believe this behavior to be acceptable for now and we can add a more stringent
update syntax later (something like `cargo update --namespace foo bar`). I
believe we'll always want this CLI usage, however.
2014-08-18 23:43:27 -07:00
Alex Crichton a216b9f7cd Preserve $OUT_DIR across rebuilds
The original choice for completely destroying $OUT_DIR was to focus on
repeatable builds to ensure that stale items in $OUT_DIR don't affect later
compilations. This commit moves this responsibility from cargo to the build
command itself.

Build commands are now responsible for cleaning out old artifacts and ensuring
that when invoked the state of $OUT_DIR is as it would be if it started with an
empty $OUT_DIR. This will allow for very long build commands based on `make` to
have a much faster incremental build time as they won't have to rebuild
everything when updated.

This can cause non-repeatable builds with build commands if stale artifacts are
never removed (but still used in the rust compilation step), but this will now
be considered a bug in the build command rather than for cargo itself.

Closes #382
2014-08-18 23:43:27 -07:00
Alex Crichton 0e8f8d50aa Add an exclude key to the manifest
This key is used to help determine the set of input files for a package. The
normal method (via walking or git ls-files) is filtered via all the patterns
provided in `exclude` of the project section.

The toml key is a string array corresponding to a set of glob patterns according
to the syntax of libglob (provided in the standard distribution). The set of
files normally found will be filtered by each pattern, and if any pattern
matches then the path is excluded.

This will later on be used for `cargo package` when generating a tarball to get
uploaded.
2014-08-18 23:43:27 -07:00
Alex Crichton 8a19eb7437 Factor in .gitignore for build cmd freshness
When testing the freshness of a build command, the fingerprint of an entire
package is generated. The current method of fingerprinting a path source is to
just stat() the entire tree and look at mtimes. This works fine when the build
command places *all* output in the build directory.

Some systems, like autotools, place *most* output in the build directory and
some output in the source directory, however (see spidermonkey). In this case
the coarse-grained "consider all files in a directory as input" is too painful
for the build command as the package will forever be rebuilt.

This commit adds support for filtering the list of files in a directory
considered to be part of a package by using `git ls-files`. This git-specific
logic can be extended to other VCSs when cargo grows support for them.

Closes #379
2014-08-18 23:43:27 -07:00
bors 35c1975e8b auto merge of #401 : alexcrichton/cargo/issue-348, r=wycats
This commit changes the hash of Profile to only take into account
flags/variables that affect the actual output file itself (as opposed to its
location), and then changes cargo {test, build, doc} to all use the same
directory of output (in order to share deps).

This will cause a `cargo build` to remove all of the tests generated by `cargo
test`, but it speeds up the cycle of `cargo test` followed by a `cargo build` by
not needing to rebuild all dependencies.

Additionally, `cargo bench` now shares the same directory as
`cargo build --release` for the same reasons as above.

Closes #348
2014-08-19 06:32:54 +00:00
Alex Crichton 37538a13ac Don't build docs/tests into separate dirs
This commit changes the hash of Profile to only take into account
flags/variables that affect the actual output file itself (as opposed to its
location), and then changes cargo {test, build, doc} to all use the same
directory of output (in order to share deps).

This will cause a `cargo build` to remove all of the tests generated by `cargo
test`, but it speeds up the cycle of `cargo test` followed by a `cargo build` by
not needing to rebuild all dependencies.

Additionally, `cargo bench` now shares the same directory as
`cargo build --release` for the same reasons as above.

Closes #348
2014-08-18 23:16:13 -07:00
bors 6a55dc850b auto merge of #389 : alexcrichton/cargo/dev-dependency-lockfile, r=wycats
Previously an invocation of `cargo build` would generate a lockfile *without*
dev dependencies, but an invocation of `cargo test` would generate a lockfile
*with* dependencies. This causes odd problems and diffs with the lockfile.

This commit switches the resolve-to-be-a-lockfile to using all dependencies of a
package, while the resolve-to-be-compiled continues to use just the dependencies
needed for the current build.
2014-08-19 05:56:43 +00:00
bors 9697847935 auto merge of #375 : wycats/cargo/doc-fewer-things, r=alexcrichton 2014-08-19 05:14:53 +00:00
bors 4c7fe13262 auto merge of #402 : alexcrichton/cargo/import-rename, r=alexcrichton 2014-08-19 05:02:35 +00:00
Alex Crichton 9886f1cb74 More import renaming fallout 2014-08-18 22:00:50 -07:00
bors cdaef90e4d auto merge of #399 : lucidd/cargo/master, r=alexcrichton 2014-08-19 00:14:11 +00:00
Kevin Walter c4d44eca50 Change all uses of use foo = bar to use bar as foo 2014-08-19 01:54:41 +02:00
bors bdf7a3e73e auto merge of #394 : colindean/cargo/fix-readme, r=alexcrichton
When a $ is present, it prevents someone from easily copying and pasting the whole block.
2014-08-18 16:14:13 +00:00
bors a30ebb3cfb auto merge of #395 : bkoropoff/cargo/import-shadow, r=alexcrichton
- Update toml-rs to version without import shadowing errors
- Fix some import shadowing errors in the tests
2014-08-18 04:44:14 +00:00
Brian Koropoff c6f0d28323 Fix import shadowing errors in tests 2014-08-17 18:34:50 -07:00
Brian Koropoff 15fbc117cf Upgrade to latest toml-rs
This version has a fix for an import shadowing error
2014-08-17 18:33:51 -07:00
Colin Dean a39a331a38 Remove $ from lines in readme to improve copyability
When a $ is present, it prevents someone from easily copying and
pasting the whole block.
2014-08-17 19:02:04 -04:00
Alex Crichton 8626fa725d Always generate a lockfile with dev-dependencies
Previously an invocation of `cargo build` would generate a lockfile *without*
dev dependencies, but an invocation of `cargo test` would generate a lockfile
*with* dependencies. This causes odd problems and diffs with the lockfile.

This commit switches the resolve-to-be-a-lockfile to using all dependencies of a
package, while the resolve-to-be-compiled continues to use just the dependencies
needed for the current build.
2014-08-16 22:38:32 -07:00
bors 4b9ca39778 auto merge of #388 : alexcrichton/cargo/fix-cross-builds, r=burningtree
0c834d7b accidentally broke this by favoring rustc's target triple over the
actual target triple.
2014-08-17 05:19:23 +00:00
Alex Crichton 51de050e6c If --target is specified, pass that to build commands
0c834d7b accidentally broke this by favoring rustc's target triple over the
actual target triple.
2014-08-16 22:17:55 -07:00
bors 8a28cb3e39 auto merge of #367 : alexcrichton/cargo/git2-rs, r=wycats
In general relying on external programs is dicey and tricky as they're very
different across systems in both how they're used as well as what versions
you'll find. Instead of binding to the least common denominator of CLI, we can
code against an exact version of libgit2.

This introduces a build-time dependency on cmake which libgit2 requires to build
itself, which is unfortunate, but thankfully it's only a build time dep. The
build process for libgit2 also automatically detects as many system libraries as
possible to use (if available), falling back to bundled versions if not
available. I have currently not figured how to control this, so the link-config
package is used to build libgit2 which requires that pkg-config be installed to
build cargo as well.

Closes #138
2014-08-16 23:18:45 +00:00