803 Commits

Author SHA1 Message Date
Katharina Fey
142bafb7e6
Adding feature tests to publish and package 2018-12-29 11:45:05 +01:00
Eric Huss
53de08a57d Add links to cargo metadata.
This is needed for creating registry index entries.
2018-12-23 11:34:14 -08:00
bors
8e547a7b14 Auto merge of #6470 - ehuss:warn-unused-patch, r=alexcrichton
Warn on unused patches.

Adds a warning when a `[patch]` entry fails to match anything.
I've hit this several times in the past, and it always takes me
5 minutes of confusion to figure out what's wrong.

Fixes #6444
2018-12-22 21:49:21 +00:00
Eric Huss
e35ecbe7ac Warn on unused patches. 2018-12-21 18:54:03 -08:00
Eric Huss
70f84bf3b0 Rewrite login and registry cleanups. 2018-12-20 04:34:35 -08:00
Eric Huss
080f0b34c4 Restrict registry names to same style as package names. 2018-12-19 20:36:13 -08:00
bors
8ffc9606aa Auto merge of #6432 - ehuss:fix-metabuild-json, r=alexcrichton
Fix metabuild compile errors with --message-format=json.

If an error occurs while compiling a metabuild target with `--message-format=json`, it would panic because it was unable to serialize `Target`. This change makes it so that it places a fake "metabuild.rs" string in the `src_path` in this situation.

I'm very unhappy with this solution, but I'm unable to think of something better. Changing `src_path` to an `Option` (or something) would break existing tools (this might break, but maybe not catastrophically?). I tried implementing something that resets the `src_path` to the correct path in the target dir after the workspace is configured, but it felt very brittle – you have to fix up after all dependencies are downloaded, and there's not a good place to ensure that happens correctly. Any alternate ideas?

This adds a `with_json_contains_unordered` to help with tests.
2018-12-18 15:49:51 +00:00
Eric Huss
7eaa1cf70a Support alt-registry names in [patch] table. 2018-12-17 20:50:42 -08:00
Eric Huss
48d56a44cd Update metabuild test to 2018. 2018-12-17 19:58:32 -08:00
Eric Huss
2a0bb65a6f Switch SerializedTarget::src_path to None instead of using fake path. 2018-12-17 19:55:16 -08:00
Eric Huss
9a7fadf6bd Fix metabuild compile errors with --message-format=json.
If an error occurs while compiling a metabuild target with
`--message-format=json`, it would panic because it was unable to serialize
`Target`. This change makes it so that it places a fake "metabuild.rs" string in
the `src_path` in this situation.

I'm very unhappy with this solution, but I'm unable to think of something
better. Changing `src_path` to an `Option` (or something) would break existing
tools. I tried implementing something that resets the `src_path` to the correct
path in the target dir after the workspace is configured, but it felt very
brittle – you have to fix up after all dependencies are downloaded, and there's
not a good way to ensure that happens correctly.

This adds a `with_json_contains_unordered` to help with tests.
2018-12-17 19:55:16 -08:00
bors
a3a3c254bd Auto merge of #6419 - ehuss:fix-show-errors, r=alexcrichton
Display errors when `cargo fix` fails.

It can be difficult to figure out what's wrong when a user reports that `cargo fix` fails. It can be hard to figure out which suggestion caused a compile error, especially if the error is in another file/location.
2018-12-14 00:11:15 +00:00
Eric Huss
41519fbf10 cargo fix: fix targets with shared sources.
If `cargo fix` attempts to fix multiple targets concurrently that have shared
source files, it would apply fixes multiple times causing corruption of the
source code. Fix this by locking on the package path instead of the target
filename, essentially serializing all targets within a package.
2018-12-13 14:29:26 -08:00
Eric Huss
fffb05d8fc Display errors when cargo fix fails.
It can be difficult to figure out what's wrong when a user reports that
`cargo fix` fails. There's often a large list of warnings, and it can
be hard to figure out which one caused a compile error.
2018-12-13 13:59:06 -08:00
Eric Huss
fa94e8aab4 Fix panic-in-panic in tests.
There are some very rare circumstances that can cause a double panic during
development. For example, `.with_json("")` will panic, and then the drop
will also panic.
2018-12-13 11:55:38 -08:00
Dale Wijnand
54c4214251
Remove trailing extern crate usage 2018-12-13 15:21:32 +00:00
Dale Wijnand
ec197891e8
Remove trailing cfg_attr feature = "cargo-clippy" usage 2018-12-13 15:21:31 +00:00
bors
6459852b67 Auto merge of #6427 - phansch:remove_nightly_check_in_test, r=dwijnand
Remove a nightly check from doc tests

None
2018-12-13 07:40:41 +00:00
Philipp Hansch
5e62437eb9
Remove a nightly check from doc tests 2018-12-13 07:55:08 +01:00
bors
e92df21b07 Auto merge of #6425 - dwijnand:promote-failure-error, r=alexcrichton
Replace CargoError with failure::Error

None
2018-12-13 06:10:04 +00:00
Dale Wijnand
0e031b5a96
Allow testsuite warnings in dev
This makes the deny(warnings) in the testsuite conditional on a new
"deny-warnings" feature, that is then enabled in CI.

Ideally I could use the (reasonably well established) CI env var (like
we do for proptests), but I don't know how to get the attribute to be
defined in terms of an env var.
2018-12-13 01:03:08 +00:00
Dale Wijnand
920d552750
Replace CargoError with failure::Error 2018-12-12 23:25:08 +00:00
Nick Cameron
4786249bcb
Merge pull request #6371 from matklad/update-dry-run
add `--dry-run` option to cargo update
2018-12-12 16:32:39 -05:00
Alex Crichton
92bf2c3604 Turn on Rust 2018 idiom warnings unconditionally
It may take us awhile to get used to them, so let's see how this goes!
2018-12-11 05:45:46 -08:00
Alex Crichton
b8b7faee50 Run cargo fix --edition-idioms and fixup output
This gets Cargo passing the `--edition-idioms` lints and more down the
road of the 2018 edition!
2018-12-11 05:45:46 -08:00
bors
7d270339ee Auto merge of #6409 - spk:add-dev-deps-metadata-test, r=ehuss
Add dev-dependencies test on cargo_metadata_with_deps_and_version

Hi, this just add some test for `dev-dependencies` on metadata with some registery update for others tests `+https://github.com/rust-lang/crates.io-index` (let me know if I should do another PR), cheers
2018-12-11 03:16:36 +00:00
Laurent Arnoud
db1940b0e5
Use correct registry on tests/testsuite/metadata.rs 2018-12-10 23:10:43 +01:00
Eric Huss
49d753e641 Fix flakey broken_fixes_backed_out test.
Since `fix` does `--all-targets` there is a race condition as to which target goes first. This has less than a 1% failure rate on CI, but it has been seen several times lately:

https://ci.appveyor.com/project/rust-lang-libs/cargo/builds/20878003/job/v01k5j14od50mghw
https://ci.appveyor.com/project/rust-lang-libs/cargo/builds/18699824/job/465w7uav7ew24yka
https://ci.appveyor.com/project/rust-lang-libs/cargo/builds/17283788/job/7cxp8bwm4d3i1xgl
2018-12-09 11:59:42 -08:00
Laurent Arnoud
1d68c7fb40
Add dev-dependencies test on cargo_metadata_with_deps_and_version 2018-12-09 19:35:34 +01:00
Aleksey Kladov
7be09e3c7c Add a test for update --dry-run 2018-12-08 21:25:56 +03:00
Alex Crichton
9ebf0657e4 Remove unused imports 2018-12-08 08:21:33 -08:00
Alex Crichton
fecb724643 Format with cargo fmt 2018-12-08 03:19:47 -08:00
bors
41a7e150fc Auto merge of #6387 - dwijnand:rust-2018, r=dwijnand
Upgrade to Rust 2018 & fix edition idioms

None
2018-12-07 16:37:19 +00:00
Eric Huss
503af8a522 Fix spurious error for test json_artifact_includes_test_flag
There is a race condition for which job finishes first. On CI I am able
to reproduce the error about 1% of the time.

Recent failures:
- https://ci.appveyor.com/project/rust-lang-libs/cargo/builds/20151768/job/oghwemec7b19turs
- https://travis-ci.org/rust-lang/cargo/jobs/464717439
2018-12-06 20:44:45 -08:00
bors
d9347c3274 Auto merge of #6380 - fbunt:issue-6370, r=alexcrichton
Warn if feature is called "default-features"

Fixes #6370.

I'm new to Rust and Cargo so any tips or critiques are welcome!
2018-12-07 00:39:58 +00:00
Dale Wijnand
6d1d3a6840
Fix 2018 edition idioms 2018-12-06 20:26:07 +01:00
Dale Wijnand
04ddd4d0fc
Upgrade to Rust 2018 2018-12-06 20:18:35 +01:00
bors
cdcb8f29d2 Auto merge of #6382 - ehuss:fix-builtin-alias, r=alexcrichton
Fix built-in aliases taking arguments.

The built-in aliases weren't parsing their arguments. Change implementation to treat built-in aliases the same as user aliases.

Fixes #6381
2018-12-06 14:35:08 +00:00
Fred Bunt
d522344f58 Clean up pattern string 2018-12-05 17:07:53 -07:00
Eric Huss
e8f37daeff Fix built-in aliases taking arguments. 2018-12-05 09:29:10 -08:00
Fred Bunt
86037b8ab6 Add failing test for issue #6370 2018-12-05 02:34:37 -07:00
bors
bfd6618840 Auto merge of #6363 - dwijnand:add-executable-in-json-output, r=matklad
Include executable in JSON output.

Fixes #5426
Rebase of @patriksvensson's #5517
CC @matklad

I didn't really get into the issue or the code, I just interatively rebased Patrik's branch and then massaged and cleaned up the code until the tests passed.  So please double check it for code correctness, test case correctness and test case coverage.

Particularly the branch changed an if condition according to [this suggestion](https://github.com/rust-lang/cargo/pull/5517#issuecomment-388557248) by Aleksey.  I rolled that back because at one point it helped fix a series of tests.  But let me know if that should be included here.
2018-12-03 18:44:13 +00:00
bors
5e85ba14aa Auto merge of #6366 - Eh2406:faster-filtered-search, r=alexcrichton
ConflictStoreTrie: Faster filtered search

This is an optimization that I was thinking of doing in #6283. I did not then as this is optimizing a not particularly hot path. I wish to do it now as it is stuck in my head, and I need that head space for more important things.

This also "accidentally" fixes the [indeterminacy](https://github.com/rust-lang/cargo/pull/6283#issuecomment-443358988) introduced in #6283, by replacing the `HashMap.iter().find()` like code with `BTreeMap.iter().find()` like code. This is not strictly needed, as @alexcrichton pointed out (In most use cases the index will change between any two invocations anyway), but does make it much easier to deal with (fuzz) test cases.
2018-12-02 14:37:25 +00:00
Eh2406
2814ca2b19 fuzzer found a bad case 2018-12-01 17:38:35 -05:00
Dale Wijnand
020efe02f5
Trim the bench test so it cannot be non-deterministic 2018-12-01 18:35:31 +00:00
Dale Wijnand
70af0636d4
Simplify & fix int test test 2018-12-01 16:52:20 +00:00
Eh2406
8c7f6af4e8 I think this shrinks better. 2018-12-01 10:00:06 -05:00
Dale Wijnand
b938637893
Use expect over unwrap, for panic-in-panic aborts
... doesn't help, but it can't hurt either, right?
2018-12-01 07:53:05 +00:00
Dale Wijnand
b0046c084d
Fix message order 2018-11-30 23:16:34 +00:00
Dale Wijnand
c78cd0ceb7
Ignore filenames, to avoid extra Windows file
Apparently on Windows it creates an .exe & a .pdb.
2018-11-30 23:15:31 +00:00