Brian Koropoff [Fri, 29 Aug 2014 06:36:28 +0000 (23:36 -0700)]
Fix build breakage due to generalized type parameter and object bounds
It is worth noting that cargo was actually creating trait boxes
that contain non-static references, so I couldn't just put 'static
everywhere to appease rustc.
bors [Thu, 28 Aug 2014 18:28:57 +0000 (18:28 +0000)]
auto merge of #465 : alexcrichton/cargo/update-git2, r=wycats
It turned out most of the methods in libgit2 don't actually require a Signature
structure, they're all mostly optional. This commit updates to this version of
libgit2 where the arguments are all optional.
Alex Crichton [Thu, 28 Aug 2014 18:10:10 +0000 (11:10 -0700)]
Update the git2 dependency
It turned out most of the methods in libgit2 don't actually require a Signature
structure, they're all mostly optional. This commit updates to this version of
libgit2 where the arguments are all optional.
bors [Wed, 27 Aug 2014 05:38:17 +0000 (05:38 +0000)]
auto merge of #446 : alexcrichton/cargo/libgit2-again, r=brson
I applied https://github.com/libgit2/libgit2/pull/2414 to a [local branch](https://github.com/alexcrichton/libgit2/tree/mingw-w64-winhttp) and then fixed the build for mingw-w64. The tests pass fine on mingw and I've used https successfully on windows with libgit2 on cargo now.
Alex Crichton [Tue, 26 Aug 2014 18:31:28 +0000 (11:31 -0700)]
Update git2-rs with mingw support
An upstream PR for libgit2 was applied locally, modified to build, and then
git2-rs was updated to use this small for of libgit2. This adds https support
via winhttp on mingw for windows users.
bors [Wed, 27 Aug 2014 02:51:45 +0000 (02:51 +0000)]
auto merge of #444 : alexcrichton/cargo/issue-54, r=brson
This generates errors for malformed semver versions during the decoding process
rather than later in the convertion to a package id. This also cuts down on the
large number of derived traits to only what's necessary.
bors [Wed, 27 Aug 2014 02:17:17 +0000 (02:17 +0000)]
auto merge of #423 : alexcrichton/cargo/cargo-package, r=brson
This command will assemble the current package into a tarball ready for
uploading to the cargo registry. Currently no further verification is done
beyond packaging the local repository into a tarball, but in the future this
could execute other operations such as api stability tools.
Alex Crichton [Fri, 18 Jul 2014 15:40:45 +0000 (08:40 -0700)]
Implement cargo-package
This command will assemble the current package into a tarball ready for
uploading to the cargo registry. Currently no further verification is done
beyond packaging the local repository into a tarball, but in the future this
could execute other operations such as api stability tools.
bors [Wed, 27 Aug 2014 02:00:57 +0000 (02:00 +0000)]
auto merge of #435 : alexcrichton/cargo/issue-431, r=brson
This option is used to disable the --test flag to rustc for a test or benchmark
target in order to signal that the binary already knows how to run the testing
infrastructure.
The test/benchmark is still compiled and run as usual, and the exit code is
expected to reflect the result of the test/benchmark.
Alex Crichton [Mon, 25 Aug 2014 12:54:47 +0000 (05:54 -0700)]
Add a `harness` manifest option
This option is used to disable the --test flag to rustc for a test or benchmark
target in order to signal that the binary already knows how to run the testing
infrastructure.
The test/benchmark is still compiled and run as usual, and the exit code is
expected to reflect the result of the test/benchmark.
bors [Wed, 27 Aug 2014 01:40:01 +0000 (01:40 +0000)]
auto merge of #420 : alexcrichton/cargo/issue-393-2, r=brson
This commit removes all distributed executables except for `cargo`. All
builtin subcommands are implemented through library calls, and the fallback
methods are retained to maintain extensability through new subcommands.
Alex Crichton [Thu, 21 Aug 2014 16:24:34 +0000 (09:24 -0700)]
Remove all subcommand executables
This commit removes all distributed executables except for `cargo`. All
builtin subcommands are implemented through library calls, and the fallback
methods are retained to maintain extensability through new subcommands.
Alex Crichton [Tue, 26 Aug 2014 15:45:33 +0000 (08:45 -0700)]
Decode directly into a semver::Version
This generates errors for malformed semver versions during the decoding process
rather than later in the convertion to a package id. This also cuts down on the
large number of derived traits to only what's necessary.
bors [Mon, 25 Aug 2014 13:44:11 +0000 (13:44 +0000)]
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.
Alex Crichton [Mon, 25 Aug 2014 12:40:47 +0000 (05:40 -0700)]
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.
bors [Sat, 23 Aug 2014 18:29:10 +0000 (18:29 +0000)]
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.
Jim Garrison [Sat, 23 Aug 2014 18:18:03 +0000 (11:18 -0700)]
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.
bors [Tue, 19 Aug 2014 16:21:40 +0000 (16:21 +0000)]
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.
Tim Carey-Smith [Fri, 15 Aug 2014 22:12:14 +0000 (15:12 -0700)]
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.
Alex Crichton [Sat, 16 Aug 2014 01:25:12 +0000 (18:25 -0700)]
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.
Alex Crichton [Sat, 16 Aug 2014 01:15:13 +0000 (18:15 -0700)]
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.
Alex Crichton [Sat, 16 Aug 2014 00:57:16 +0000 (17:57 -0700)]
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.
Alex Crichton [Sat, 16 Aug 2014 00:40:08 +0000 (17:40 -0700)]
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.
bors [Tue, 19 Aug 2014 06:32:54 +0000 (06:32 +0000)]
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.
Alex Crichton [Tue, 19 Aug 2014 04:38:04 +0000 (21:38 -0700)]
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.
bors [Tue, 19 Aug 2014 05:56:43 +0000 (05:56 +0000)]
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.
Alex Crichton [Sun, 17 Aug 2014 05:38:32 +0000 (22:38 -0700)]
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.
bors [Sat, 16 Aug 2014 23:18:45 +0000 (23:18 +0000)]
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.
Alex Crichton [Wed, 6 Aug 2014 15:01:17 +0000 (08:01 -0700)]
Use libgit2 for driving git instead of the CLI
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.