Commit graph

131 commits

Author SHA1 Message Date
Alex Crichton 763ba535eb Shared the test suite into multiple binaries
Compiling everything in one binary was getting annoying as it just took forever
to build, instead shard it all up so we can build just particular test suites at
a time.
2016-05-25 21:25:13 -07:00
Alex Crichton 6950bbb0b4 Remove the test! macro
This isn't really necessary and we can do setup manually in a few cases and
lazily do it in all the others.
2016-05-25 15:40:51 -07:00
Aleksey Kladov d0a14eb018 fix test_compile_git_deps 2016-05-20 16:39:58 +03:00
Aleksey Kladov 40fd7a7490 one more regexp 2016-05-20 04:07:54 +03:00
Aleksey Kladov e78956d1a6 more auto refactoring fixes 2016-05-19 03:51:07 +03:00
Aleksey Kladov 2904e36b4b fix some more tests with regexp 2016-05-19 01:42:29 +03:00
Aleksey Kladov 1a2257bfb6 fix a bunch of tests with regexp 2016-05-19 01:42:29 +03:00
Aleksey Kladov ac3a8579db remove useless formats 2016-05-12 22:54:23 +03:00
Aleksey Kladov 29cdad4f98 simplify tests
remove RUNNING, COMPILING, ERROR, DOCUMENTING, FRESH and UPDATING
constants
2016-05-11 22:26:03 +03:00
Alex Crichton 18e593044d Replace existing sources before updating
Currently sources may acquire file locks to ensure that they're not tampered
with while they're in use. We may load two sources to the same location,
however, in the case of git repositories which need to be updated. Cargo will
first load a locked version of the source and then may load an unlocked version,
and these two loads currently deadlock.

This commit tweaks the logic when updating a source to only update it after the
previous source has been replaced.

Closes #2533
2016-03-30 10:39:24 -07:00
Stephen Becker IV 1c439875e2 Remove color from the errors
I updated the error states to use say_status.
Add text to the empty error
The empty error looked odd with the say_status change.
Update all stderr messages
Switch them to format statements and create a helper for the error
status.
2016-03-12 11:37:59 -08:00
Alex Crichton 09847df8d3 Fix all tests with recent changes
The package id for path dependencies now has another path component pointing
precisely to the package being compiled, so lots of tests need their output
matches to get updated.
2016-03-03 13:35:46 -08:00
Alex Crichton 1a1d8f8c19 Fix output matching in tests
Right now we only match a suffix of the line, assuming all lines start with
`[..]`. Instead this ensures that the first match is anchored at the start.
2016-03-03 10:19:56 -08:00
Alex Crichton dd34296008 Update dependencies and Rust version
Just a routine for niche bug fixes, linkage errors, perf improvements, etc.
2016-01-25 09:33:51 -08:00
Alex Crichton 1b09e16df6 Merge branch 'cwd-fixes' of https://github.com/Kimundi/cargo 2015-11-19 14:29:22 -08:00
Alex Crichton 1ad6f785ca Don't panic when printing the precise source id
Closes #2094
2015-10-31 10:03:18 -07:00
Marvin Löbel c6607054f7 Fixed testsuite 2015-10-28 12:15:37 +01:00
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