2601 Commits

Author SHA1 Message Date
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
Eric Huss
e8f37daeff Fix built-in aliases taking arguments. 2018-12-05 09:29:10 -08: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
Dale Wijnand
282f238d93
Include executable in JSON output. 2018-11-30 22:12:30 +00:00
Eh2406
dae87a2624 PackageId is copy, clippy thinks we dont need &PackageId or PackageId.clone() 2018-11-27 17:43:23 -05:00
bors
151c2253b1 Auto merge of #6332 - dwijnand:intern-more, r=Eh2406
Intern PackageId

Refs #6207
2018-11-26 19:10:38 +00:00
Collins Abitekaniza
f61966403a assert for non-release artifacts 2018-11-26 18:12:11 +03:00
Collins Abitekaniza
84be123f79 test cargo clean with --release option 2018-11-26 18:01:51 +03:00
Dale Wijnand
2e35475121
Add debug info to git::two_deps_only_update_one test 2018-11-26 11:04:01 +00:00
Eh2406
e5a11190b3 SourceId is copy, clippy thinks we dont need &SourceId or SourceId.clone() 2018-11-25 21:08:05 -05:00
bors
9caf0bac4c Auto merge of #6331 - dwijnand:distinguish-custom-build-invocations, r=alexcrichton
Distinguish custom build invocations

Distinguish building a build script from running it,
in build plan invocations.

Fixes #5719
2018-11-19 18:35:19 +00:00
bors
85060d8452 Auto merge of #6330 - dwijnand:run_bin_example, r=alexcrichton
Allow crate_type=bin examples to run

Fixes #6159
2018-11-19 18:01:37 +00:00
bors
bf6aa590b1 Auto merge of #6326 - dwijnand:verify_project_honours_unstable_features, r=alexcrichton
Make verify-project honour unstable features

Fixes #6209
2018-11-19 17:18:24 +00:00
bors
cd43d3a11f Auto merge of #6329 - dwijnand:disable-autobins, r=alexcrichton
Make autodiscovery disable inferred targets

Fixes #6205
2018-11-19 16:37:01 +00:00
bors
61c83bac9c Auto merge of #6259 - ordovicia:user-alias-override, r=ehuss
Allow user aliases to override built-in aliases

This PR allows user-defined aliases take precedence over built-in ones, with a warning that tells there exists a built-in alias.
This PR does not allow user aliases override built-in subcommands.

```console
$ cat .cargo/config
[alias]
b = "fetch"
build = "fetch"

$ ./target/debug/cargo b
warning: user-defined alias `b` overrides a built-in alias for `build`

$ ./target/debug/cargo build
warning: user-defined alias `build` is ignored, because it is shadowed by a built-in command
   Compiling proc-macro2 v0.4.19
   Compiling unicode-xid v0.1.0
   Compiling cc v1.0.25
(snip)
```

In the current version of Cargo, user aliases cannot override built-in aliases.
This behavior is keeping us from safely adding new built-in aliases without interfering existing user config.
Merging this PR will allow that.

Fixes #6221
Relating to #6218
2018-11-18 22:24:07 +00:00
Dale Wijnand
e8c1811f83
Fix metabuild::metabuild_build_plan 2018-11-18 18:39:08 +00:00
Dale Wijnand
27424e2dba
Use kebab-case for CompileMode, & discard some info 2018-11-18 18:32:54 +00:00
Dale Wijnand
7b081569ed
Distinguish custom build invocations
Distinguish building a build script from running it,
in build plan invocations.
2018-11-18 17:59:05 +00:00
Dale Wijnand
e95036467e
Allow crate_type=bin examples to run 2018-11-18 17:32:42 +00:00
Dale Wijnand
8d996a2df0
Make autodiscovery disable inferred targets 2018-11-18 15:57:54 +00:00
Dale Wijnand
dc6b5be30d
Simplify tool_paths::absolute_tools test
... by reusing the new [ROOT] macro.
2018-11-18 14:45:28 +00:00
Dale Wijnand
092f7baea3
Fix cargo_command::cargo_subcommand_args test 2018-11-18 14:44:16 +00:00
Dale Wijnand
49f73b9c4e
Simplify cargo_command::cargo_subcommand_args test 2018-11-18 13:38:33 +00:00
Dale Wijnand
6afca122e5
Handle backslash-escaped backslashes in actual output too 2018-11-18 12:08:46 +00:00
Dale Wijnand
b088539de8
Handle backslash-escaped backslashes 2018-11-18 09:10:20 +00:00
Hidehito Yabuuchi
ea1f525c02 Allow user aliases to override built-in aliases 2018-11-18 18:08:28 +09:00
bors
53e436d665 Auto merge of #6328 - ehuss:rename-cross-build-output, r=alexcrichton
Fix renaming directory project using build scripts with cross-compiling.

The rename-protection introduced in #4818 checks for paths with a prefix of `/…/target/debug`, but this does not work for paths used during cross-compiling.

This change checks for paths with the full `OUT_DIR` prefix, and the `build/PKG/root-output` file now includes that full `OUT_DIR` instead of `/…/target/debug`.

This also includes a few other changes:
- Support fixing KIND=PATH style paths.
- Support fixing paths in metadata (like `cargo:root=…` or `cargo:include=…` which are common).
- Adds a "version" value to the metadata hash to ensure that cargo doesn't get confused with the new `root-output` file format.

Fixes #6177
2018-11-18 08:12:27 +00:00
Eric Huss
d1045c9cc2 Fix renaming directory project using build scripts with cross-compiling. 2018-11-17 19:10:29 -08:00
Eric Huss
83ff57a4ad Fix add_plugin_deps-related tests. 2018-11-17 16:33:24 -08:00
Dale Wijnand
104ab6c2bc
Make verify-project honour unstable features 2018-11-17 22:57:06 +00:00
bors
b3d0b2e545 Auto merge of #6311 - alexcrichton:stabilize-renames, r=the-whole-team
Stabilize the `rename-dependency` feature

This commit stabilizes Cargo's `rename-dependency` feature which allows
renaming packages in `Cargo.toml`, enabling importing multiple versions
of a single crate or simply avoiding a `use foo as bar` in `src/lib.rs`.

Closes #5653
2018-11-15 19:13:04 +00:00
bors
51d541fced Auto merge of #6309 - ehuss:bench-build-profile, r=alexcrichton
Use "test" profile for `cargo build` benchmarks.

When using `cargo build` (without `--release`), build benchmarks using the "test" profile. This was causing some confusion where the benchmark is placed in the `target/debug` directory, and also causing some duplicates that may not be expected. It also makes it easier to debug benchmarks (previously you had to edit the `[profile.bench]` profile).

Closes #5575, closes #6301, closes #4240, closes #4929.
2018-11-14 15:06:17 +00:00
bors
0da2c999ea Auto merge of #6312 - alexcrichton:fix-broken, r=ehuss
fix: Don't back out changes with `--broken-code`

This commit updates the behavior of `cargo fix` when the `--broken-code`
flag is passed to Cargo. Previously Cargo would always back out
automatically applied changes to files whenever the fixed code failed to
compile. Now, with the `--broken-code` flag, fixed code is left as-is.
This means that if the fixed code can be more easily inspected by
humans to detect bugs and such.

The main use case intended here is that if you're working with a large
code base then lints like the edition idiom lints aren't 100% finished
yet to work as smoothly as `cargo fix`. The idiom lints are often
useful, however, to transition code to be idiomatic (who would have
guessed!) in the new edition.

To ease the experience of using not-quite-ready lints this flag can be
used to hopefully "fix 90% of lint warnings" and then the remaining
compiler errors can be sifted through manually. The intention is that we
have edition documentation indicating this workflow which also
encourages filing bugs for anything that fails to fix, and hopefully
this new behavior will make it easier for us to narrow down what the
minimal test case is too!
2018-11-14 04:27:13 +00:00
Alex Crichton
08dc6da030 fix: Don't back out changes with --broken-code
This commit updates the behavior of `cargo fix` when the `--broken-code`
flag is passed to Cargo. Previously Cargo would always back out
automatically applied changes to files whenever the fixed code failed to
compile. Now, with the `--broken-code` flag, fixed code is left as-is.
This means that if the fixed code can be more easily inspected by
humans to detect bugs and such.

The main use case intended here is that if you're working with a large
code base then lints like the edition idiom lints aren't 100% finished
yet to work as smoothly as `cargo fix`. The idiom lints are often
useful, however, to transition code to be idiomatic (who would have
guessed!) in the new edition.

To ease the experience of using not-quite-ready lints this flag can be
used to hopefully "fix 90% of lint warnings" and then the remaining
compiler errors can be sifted through manually. The intention is that we
have edition documentation indicating this workflow which also
encourages filing bugs for anything that fails to fix, and hopefully
this new behavior will make it easier for us to narrow down what the
minimal test case is too!
2018-11-13 20:26:57 -08:00
Eric Huss
69c6363418 Fix windows failure on collision_dylib. 2018-11-13 16:31:24 -08:00
Eric Huss
a10eb01150 Change error to warning. 2018-11-13 14:31:56 -08:00
Alex Crichton
1533a0493a Stabilize the rename-dependency feature
This commit stabilizes Cargo's `rename-dependency` feature which allows
renaming packages in `Cargo.toml`, enabling importing multiple versions
of a single crate or simply avoiding a `use foo as bar` in `src/lib.rs`.

Closes #5653
2018-11-13 11:37:49 -08:00
Eric Huss
739c272f05 Use "test" profile for cargo build benchmarks. 2018-11-12 13:10:54 -08:00
Eric Huss
fa0787aaf7 Check for duplicate output filenames. 2018-11-12 12:07:22 -08:00
Eric Huss
27e6b1840c Don't include build scripts in --out-dir. 2018-11-10 09:48:07 -08:00
bors
f0950da8b8 Auto merge of #6292 - ehuss:no-rmeta-hardlink, r=alexcrichton
Don't hardlink rmeta files.

`.rmeta` files shouldn't be needed in the main directory, and since rustc started outputing rmeta files for binaries, there are name collisions between bins and libs of the same name.

Partial fix for #5524.
2018-11-09 23:56:39 +00:00