Commit graph

114 commits

Author SHA1 Message Date
Alex Crichton 8778797dc7 Update some build tools and libgit2
* Updates git2-rs back to 0.3 now that the distribution issue on OSX has been
  fixed.
* Updates libgit2-sys to using the `cmake` crate so building with VS 2015 can
  work.
* Update pkg-config to totally disable it on MSVC (basically guaranteed to never
  work)
2015-10-07 11:33:39 -07:00
George Hilliard 492b5825c3 Print information about updated packages on cargo update
Closes #984.
2015-08-27 22:56:24 -05:00
Alex Crichton 6bf164203b Revert update of libgit2
Unfortunately this flew past on the bots because we didn't built on one of the
10.7 bots, but it looks like libgit2 doesn't currently build on OSX 10.7 so
we'll have to wait until that's fixed to update.
2015-08-17 10:08:13 -07:00
Alex Crichton 530e1d180d Update dependencies and Rust that's used
* Picks up a few breaking changes to dependency APIs, notably the tar-rs changes
  and git2-rs changes.
* Builds should now work with VS 2015
2015-08-14 13:30:53 -07:00
Alex Crichton ff96fa159b Pass --cap-lints=allow instead of -Awarnings
This commit adds support to Cargo to pass `--cap-lints allow` to all upstream
dependencies instead of `-A warings`. This should serve the same purpose of
suppressing warnings in upstream dependencies as well as preventing widespread
breakage whenever a change to a lint is introduced in the compiler.
2015-07-24 14:13:30 -07:00
Ivan Ukhov 32dae0bb37 tests: move Git-related routines to support 2015-06-02 10:00:32 -04:00
Alex Crichton 7d73487e5a Try to debug a failing test on the windows bots
This test is failing on the win64 bot, and I'm not 100% sure why, so trying to
get some more info out of it.
2015-05-28 15:56:42 -07:00
Tshepang Lekhonkhobe 74076d2a04 fix typos caught by codespell 2015-05-06 02:05:41 +02:00
Alex Crichton 80fe0e6df6 Update to rust-2015-04-02
Along the way, this also removes the ability to specify `[[lib]]` targets while
getting warnings. While we're at it remove nearly all unstable features that
Cargo is depending on as well!
2015-04-02 16:28:53 -07:00
Alex Crichton 5033dab9b3 Fix passing --extern and -L to doc tests
Previously --extern was passed for *all* upstream dependencies, causing
conflicts if some had duplicate names. Now cargo only passes --extern for
libraries that were built including immediate dependencies. Cargo also
additionally now properly passes `-L dependency=` instead of just a plain `-L`.

Closes #1449
2015-03-31 10:06:46 -07:00
Alex Crichton 964e72ffc0 Update to rust 2015-03-26 2015-03-26 11:59:30 -07:00
bors c6b93247c6 Auto merge of #1441 - alexcrichton:issue-1323, r=bson
This commit is a complete overhaul of how Cargo handles compilation profiles
internally. The external interface of Cargo is not affected by this change.

Previously each Target had a Profile embedded within it. Conceptually a Target
is an entry in the manifest (a binary, benchmark, etc) and a Profile controlled
various flags (e.g. --test, -C opt-level, etc). Each Package then contained many
profiles for each possible compilation mode. For example a Package would have
one target for testing a library, benchmarking a library, documenting a library,
etc. When it came to building these targets, Cargo would filter out the targets
listed to determine what needed to be built.

This filtering was largely done based off an "environment" represented as a
string. Each mode of compilation got a separate environment string like `"test"`
or `"bench"`. Altogether, however, this approach had a number of drawbacks:

* Examples in release mode do not currently work. This is due to how examples
  are classified and how release mode is handled (e.g. the "release" environment
  where examples are meant to be built in the "test" environment).
* It is not trivial to implement `cargo test --release` today.
* It is not trivial to implement `cargo build --bin foo` where *only* the binary
  `foo` is built. The same is true for examples.
* It is not trivial to add selective building of a number of
  binaries/examples/etc.
* Filtering the list of targets to build has some pretty hokey logic that
  involves pseudo-environments like "doc-all" vs "doc". This logic is duplicated
  in a few places and in general is quite brittle.
* The TOML parser greatly affects compilation due to the time at which profiles
  are generated, which seems somewhat backwards.
* Profiles must be overridden, but only partially, at compile time becuase only
  the top-level package's profile is applied.

In general, this system just needed an overhaul. This commit made a single
change of separating `Profile` from `Target` and then basically hit `make` until
all the tests passed again. The other large architectural changes are:

* Environment strings are now entirely gone.
* Filters are implemented in a much more robust fashion.
* Release mode is now handled much more gracefully.
* The unit of compilation in the backend is no longer (package, target) but
  rather (package, target, profile). This change had to be propagated many
  location in the `cargo_rustc` module.
* The backend does not filter targets to build *at all*. All filtering now
  happens entirely in the frontend.

I'll test issues after this change lands, but the motivation behind this is to
open the door to quickly fixing a number of outstanding issues against Cargo.
This change itself is not intended to close many bugs.
2015-03-24 00:15:20 +00:00
Alex Crichton 0c2878345a Fix tests for windows 2015-03-23 17:14:47 -07:00
Tamir Duberstein 1ced1dc8dd Update to rust 2015-03-22 2015-03-23 13:59:59 -07:00
Alex Crichton 50c6eb4d46 Update to rust master 2015-03-17 09:26:13 -07:00
Alex Crichton 1e0b04a03e Translate '\' to '/' for submodule names
Apparently git submodules are checked in as '/' not '\' so if a '\' leaks
through it'll end up not being found!

Closes #1299
2015-03-02 15:51:13 -08:00
Alex Crichton a6dad62221 Update to rust master and std::{io, path} 2015-02-27 15:34:13 -08:00
Robin Gloster 973f6712f0 rustup 2015-02-24 12:43:41 +01:00
Andrew Paseltiner 1384050eea update Rust 2015-02-12 23:10:25 -05:00
Gabriel Souza Franco af45e08862 std::io → std::old_io 2015-01-30 16:03:53 -02:00
Alex Crichton 98bd1f7448 Don't require all submodules are checked out
When probing a repository for files that should be considered as inputs for a
build script we should just skip submodules that haven't been checked out
instead of throwing an error.

Closes #1248
2015-01-29 11:41:00 -08:00
Alex Crichton 0fdaf507a1 Remove infrastructure for the old custom build command
This aspect of the manifest has been deprecated for quite some time now, and
this commit purges the support entirely.
2015-01-19 15:48:06 -08:00
Alex Crichton b65197b6a8 Update to rust master 2015-01-19 13:22:48 -08:00
Alex Crichton d14abb6ec3 Print human errors in traces by default
This helps get nice pretty stack traces which terminate when we get into the
weeds of errors but still present relevant contextual information when Cargo
isn't run with --verbose
2015-01-16 09:43:28 -08:00
Alex Crichton 5d0cb3f2e9 Overhaul how Config is passed around
This commit started out by moving the hash map of configuration values into
`Config` and then removing all calls to config::all_configs in favor of taking a
`&Config` argument. This initial step was taken to prevent reloading
configuration many times from disk, but it also provides a nice house for
configuration to be loaded from.

The commit snowballed into purging `MultiShell` as an argument all over the
place and passing around `Config` instead. Along the way a few other breaking
changes were made:

* The `config_for_key` and `config_list` subcommands have been removed. These
  commands are not ready to be stabilized and need some more work. In general
  the `cargo config` system needs to be cleaned out and built back up with a new
  interface, at which point these subcommands can return.
* The old and deprecated behavior of `cargo update foo` has been removed.
2015-01-16 08:45:07 -08:00
Alex Crichton ed58e0bea9 Improve errors for invalid manifests
Print out the path to the manifest in question whenever a parsing error is
encountered.
2015-01-13 18:51:24 -08:00
Alex Crichton 553211119b Update to rust master 2015-01-13 14:11:20 -08:00
Alex Crichton 9ed3a6ea1d Clean up Cargo's util::errors module
This commit cleans up cargo's error module to reduce the duplication of
`CargoError` and the standard library's `Error` trait. The `CargoError` trait
remains, but only has one methods, `is_human`.

A number of other modifications were made:

* ChainError was altered to work over unboxed closures
* Wrap and Require were removed as they're duplicates of the ChainError
  functionality.
* Many public error types are now private from util::errors as they're only
  returned as boxed trait objects.
* The `concrete` was removed, all calls to `make_human` are now done through a
  newtype `Human` wrapper.
* Cargo's custom `try!` macro was removed.
2014-12-29 18:59:15 -08:00
Alex Crichton aa256ffddc Refactor git rev handling infrastructure
This commit unifies the notion of a "git revision" between a SourceId and the
GitSource. This pushes the request of a branch, tag, or revision all the way
down into a GitSource so special care can be taken for each case.

This primarily was discovered by #1069 where a git tag's id is different from
the commit that it points at, and we need to push the knowledge of whether it's
a tag or not all the way down to the point where we resolve what revision we
want (and perform appropriate operations to find the commit we want).

Closes #1069
2014-12-29 16:00:18 -08:00
Alex Crichton 157d639afc Update rust and all deps 2014-12-19 20:55:17 -08:00
Alex Crichton 673d318021 Bump libgit2 dep to hopefully fix win32 2014-12-08 11:14:09 -08:00
Cody P Schafer 631210790d Update for nightly
I'm a bit shaky on the profile.rs changes (`thread_local!` and `RefCell`
relplacing `local_data_key!`), do make sure I haven't royally screwed
something up there.

Note that I haven't sucessfully run the various test_cargo_cross_compile
tests as I don't have an i686-unknown-linux-gnu rustc sitting around.
2014-12-03 02:25:18 -05:00
Alex Crichton 2ba5c5ec45 Test source equality when locking dependencies
When applying the lockfile to a resolve graph, we need to take into account that
the listed source of dependencies can change over time, in which case we cannot
lock to the previous version but instead need to continue onwards with updating
the listed source.

Closes #951
2014-11-23 17:46:04 -08:00
Jakub Bukaj df9cf06663 Update to newest Rust 2014-11-23 17:02:45 -05:00
Alex Crichton 2833358294 Fix some flaky tests 2014-11-05 11:37:34 -08:00
Alex Crichton ce14ff2f77 Be sure to update all packages from a git source
With the recent resolve rewrite, `cargo update -p foo` would only update one
package in a git repository, even if the repository provided many packages.
Cargo does not currently support depending on the same git repository source
with different precise revisions, and this would cause errors down the line
depending on what happened.

This adds a fix to the `resolve_with_previous` method to ensure that any
non-registry sources being updated will not have any locked packages inside them
which would result in an invalid lockfile.
2014-10-29 11:50:24 -07:00
Alex Crichton 6ab9311754 Fix a flaky test relying on nondeterminsm
When updating a source with multiple packages, the registry will lazily discover
both the precise and imprecise versions of the source at some point. Previously
the source would be updated depending on which was discovered first, but this
commit adds logic to understand that if an imprecise version is discovered after
a precise version then the imprecise version should be favored (because it will
always trigger an update).

This needs to understand, however, that if `cargo update --precise` is used that
those sources should not be updated again, so the sources treated in
`add_sources` are considered "special" in the sense that they're locked and will
not be updated again.
2014-10-27 12:40:23 -07:00
Alex Crichton ebd3c1da77 Remove the hokey add_lockfile_sources
This method shouldn't be necessary as it should be possible to simply add all
sources known in the lockfile to a package registry, and
core::{resolve, registry} should take care of weeding them out if necessary.

In the process of doing so, this actually ends up fixing a problem with
rewriting a dependency to a new one which shares transitive deps. Previously all
the transitive deps were updated, but now the transitive deps remain locked at
where they were previously locked.
2014-10-27 12:40:23 -07:00
Alex Crichton c2e9996011 Fix updating sources with more than one crate
When a source has multiple crates inside of it, `cargo update -p foo` would
previously not actually update anything because the extra crates were continuing
to lock the source to the same revision. This change updates the "avoid me"
logic to avoid *sources*, not *packages*.

Closes #697
2014-10-13 09:54:08 -07:00
Alex Crichton 78bd836023 Update to rust master 2014-10-10 08:03:45 -07:00
Alex Crichton 1ef09734ed Refine dependencies on dev-deps
Currently whenever a dev-dep is brought in to the build process the entire
library is rebuilt, but this is just unnecessary recompilation because the
library *can't* depend on the dev-dep.

This commit refines the dependency graph so the lib stage only depends on
transitive dependencies (non-dev-deps), and a new stage for tests was added
which depends on the packages libraries *and* the dev-deps. This way only the
test are rebuilt when dev-deps change, not libraries.
2014-10-02 18:38:15 -07:00
Alex Crichton 37dbfd2ec6 Improve the error message for ambiguous specs 2014-09-29 16:55:45 -07:00
Alex Crichton 217ff7fb93 Deprecate cargo update foo
To maintain consistency with `cargo {build,test,bench,clean}` the `update`
subcommand now takes a specific package via the `-p` argument instead of as a
positional argument.
2014-09-29 16:54:45 -07:00
Alex Crichton f97cef0c30 Add cargo {test,bench} -p <spec>
This functionality allows running tests and benchmarks on any upstream
dependencies in the dependency graph. This is most useful for path sources all
developed in tandem (see Servo for instance).

In terms of built artifacts, this will actually preserve as many artifacts as
possible. That means that if you test a low-level dependency with the high-level
artifacts already built, the high-level artifacts will not get removed. This
means that it's possible to accidentally have a low-level dependency to depend
on a higher level one just because it's lib is picked up via -L, but this is
generally a necessary evil to get testing to not rebuild packages too often.

Closes #483
2014-09-29 16:54:45 -07:00
Alex Crichton 325c5f2def Allow selectively cleaning packages
This adds a new argument to `cargo clean` which will enable selectively cleaning
particular packages. The command only cleans the package specified, no other
(not the dependencies of the package).

cc #537
2014-09-29 16:54:24 -07:00
Alex Crichton c098a9a7a9 Allow updating to a precise revision
This commit adds a flag, --precise, to cargo update. This flag is used to update
a dependency to precisely an exact revision (or branch) as part of an update
step. For git repositories the argument is some form of reference, while
registry packages this will be a version number.

The flag --precise forces a non-aggressive update and will fail if the
--aggresive flag is specified.

Closes #484
2014-09-25 08:51:45 -07:00
bors 262c794949 auto merge of #614 : alexcrichton/cargo/issue-613, r=brson
As described in #613, this commit switches the semantics of `cargo update foo`
to updating *only* `foo`, not any of its dependencies. A new flag,
`--aggressive` was added to restore the old behavior.

The behavior of attempting to only unlock `foo`, and then if resolve fails
unlock all dependencies of `foo` is unimplemented as it's not super relevant
right now when the majority of dependencies are git dependencies and resolution
cannot fail for version-related reasons.

Closes #613
2014-09-22 20:58:34 +00:00
Alex Crichton d1a332d19a Make cargo update more conservative.
As described in #613, this commit switches the semantics of `cargo update foo`
to updating *only* `foo`, not any of its dependencies. A new flag,
`--aggressive` was added to restore the old behavior.

The behavior of attempting to only unlock `foo`, and then if resolve fails
unlock all dependencies of `foo` is unimplemented as it's not super relevant
right now when the majority of dependencies are git dependencies and resolution
cannot fail for version-related reasons.

Closes #613
2014-09-21 14:27:30 -07:00
Alex Crichton 541a535f71 Stop capturing output of all dependencies
There are some competing concerns when it comes to the output of compiling
dependencies:

* Not capturing anything leads to getting drowned in unrelated output
* Capturing requires coloration be compromised because of the way windows
  terminal colors are implemented.
* Path dependencies are often developed in tandem with the rest of a package,
  and capturing their output is not always desired.

To address these concerns, cargo previously captured output of dependent
compilations and then re-printed it to the screen if an error occurred. This
patch modifies the behavior to as follows:

* No output is captured. This preserves any coloration rustc provides.
* All dependencies are compiled with `-Awarnings`. This should suppress any
  extraneous output from the compiler and it is considered a bug otherwise if
  the compiler prints a warnings when `-Awarnings` is specified.
* All *path* dependencies (`path="..."`, overrides, etc) are *not* compiled with
  `-Awarnings`. The reason for this is that you are always in control of these
  packages and probably want to see warnings anyway.

Closes #490
Closes #496
2014-09-21 14:06:58 -07:00
Alex Crichton dfae53c406 Fix some more deprecation warnings 2014-09-17 08:27:41 -07:00