]> git.proxmox.com Git - cargo.git/log
cargo.git
6 years agoFix the edition build scripts are compiled with
Alex Crichton [Sat, 4 Aug 2018 15:44:16 +0000 (08:44 -0700)]
Fix the edition build scripts are compiled with

Previously build scripts were accidentally and unconditionally compiled with the
2015 edition, but they should instead use the edition of the `[package]` itself.

Closes #5860

6 years agoAuto merge of #5845 - alexcrichton:fix-edition, r=alexcrichton
bors [Thu, 2 Aug 2018 14:57:35 +0000 (14:57 +0000)]
Auto merge of #5845 - alexcrichton:fix-edition, r=alexcrichton

Rename `--prepare-for` to `--edition`, drop arg

This commit tweaks the UI of `cargo fix` for the edition. Previously you'd
execute `cargo fix --prepare-for 2018`, but that's a lot of typing! Plus it's
some manual data that Cargo can already infer.

Instead, after this commit, you now type `cargo fix --edition`, and that's it!
The idea is that this'll tell Cargo to fix code for the *next* edition,
inferring whatever edition is in use and figuring out what to pass to rustc.

Functionality-wise this should be the exact same as `--prepare-for 2018` though

If others agree w/ this change I'll send a PR to the edition guide after this
merges!

6 years agoAuto merge of #5851 - dwijnand:slash-macro, r=alexcrichton
bors [Thu, 2 Aug 2018 13:34:57 +0000 (13:34 +0000)]
Auto merge of #5851 - dwijnand:slash-macro, r=alexcrichton

Drop the [/] test output macro

Refs #5742

6 years agoPush slash conforming to lines_match, so match_json uses it
Dale Wijnand [Thu, 2 Aug 2018 10:43:26 +0000 (11:43 +0100)]
Push slash conforming to lines_match, so match_json uses it

6 years agoDrop the [/] test output macro
Dale Wijnand [Thu, 2 Aug 2018 09:18:48 +0000 (10:18 +0100)]
Drop the [/] test output macro

6 years agoSwitch strategies for how rustc's workspace is unioned
Alex Crichton [Thu, 2 Aug 2018 04:28:47 +0000 (21:28 -0700)]
Switch strategies for how rustc's workspace is unioned

See rust-lang/rust#52919 for more details.

6 years agoRename `--prepare-for` to `--edition`, drop arg
Alex Crichton [Wed, 1 Aug 2018 00:01:09 +0000 (17:01 -0700)]
Rename `--prepare-for` to `--edition`, drop arg

This commit tweaks the UI of `cargo fix` for the edition. Previously you'd
execute `cargo fix --prepare-for 2018`, but that's a lot of typing! Plus it's
some manual data that Cargo can already infer.

Instead, after this commit, you now type `cargo fix --edition`, and that's it!
The idea is that this'll tell Cargo to fix code for the *next* edition,
inferring whatever edition is in use and figuring out what to pass to rustc.

Functionality-wise this should be the exact same as `--prepare-for 2018` though

If others agree w/ this change I'll send a PR to the edition guide after this
merges!

6 years agoAuto merge of #5831 - Eh2406:i5684, r=alexcrichton
bors [Wed, 1 Aug 2018 16:39:58 +0000 (16:39 +0000)]
Auto merge of #5831 - Eh2406:i5684, r=alexcrichton

cargo can silently fix some bad lockfiles (use --locked to disable)

Lock files often get corrupted by git merge. This makes all cargo commands silently fix that kind of corruption.

If you want to be sure that your CI does not change the lock file you have commited
---

Then make sure to use `--locked` in your CI

Edit: original description below

---------------

This is a continuation of @dwijnand work in #5809, and closes #5684

This adds a `ignore_errors` arg to reading a lock file which ignores sections it doesn't understand. Specifically things that depend on versions that don't exist in the lock file. Then all users pass false except for the two that relate to `update` command.

I think the open questions for this pr relate to testing.
- Now that we are passing false in all other commands, do they each need a test for a bad lockfile?
- Do we need a test with a more subtly corrupted lock file, or is this always sufficient for `update` to clean up?

6 years agoAuto merge of #5834 - Undin:metadata-edition, r=alexcrichton
bors [Wed, 1 Aug 2018 15:51:56 +0000 (15:51 +0000)]
Auto merge of #5834 - Undin:metadata-edition, r=alexcrichton

Add edition info into metadata

Since edition feature was introduced, external tools have to support this new feature.
But cargo metadata doesn't provide info about package edition.
This commit adds edition field to `SerializedPackage` struct to add the corresponding field into metadata output.

6 years agoAuto merge of #5847 - alexcrichton:fix-deprecations, r=alexcrichton
bors [Wed, 1 Aug 2018 14:21:03 +0000 (14:21 +0000)]
Auto merge of #5847 - alexcrichton:fix-deprecations, r=alexcrichton

Upgrade to `failure 0.1.2` idioms

Fixes some deprecation warnings in Cargo

6 years agoUpgrade to `failure 0.1.2` idioms
Alex Crichton [Wed, 1 Aug 2018 14:20:04 +0000 (07:20 -0700)]
Upgrade to `failure 0.1.2` idioms

Fixes some deprecation warnings in Cargo

6 years agofix tests on Windows
Arseniy Pendryak [Wed, 1 Aug 2018 06:04:55 +0000 (09:04 +0300)]
fix tests on Windows

6 years agoAuto merge of #5842 - alexcrichton:fix-lots, r=ehuss
bors [Wed, 1 Aug 2018 02:52:35 +0000 (02:52 +0000)]
Auto merge of #5842 - alexcrichton:fix-lots, r=ehuss

fix: Iteratively apply suggestions from the compiler

This commit updates the `cargo fix` implementation to iteratively apply fixes
from the compiler instead of only once. Currently the compiler can sometimes
emit overlapping suggestions, such as in the case of transitioning

    ::foo::<::Bar>();

to ...

    crate::foo::<crate::Bar>();

and `rustfix` rightfully can't handle overlapping suggestions as there's no
clear way of how to disambiguate the fixes. To fix this problem Cargo will now
run `rustc` and `rustfix` multiple times, attempting to reach a steady state
where no fixes failed to apply.

Naturally this is a pretty tricky thing to do and we want to be sure that Cargo
doesn't loop forever, for example. A number of safeguards are in place to
prevent Cargo from going off into the weeds when fixing files, notably avoiding
to reattempt fixes if no successful fixes ended up being applied.

Closes #5813
Closes rust-lang/rust#52754

6 years agoAuto merge of #5841 - Mark-Simulacrum:internal-error-json, r=alexcrichton
bors [Wed, 1 Aug 2018 01:24:42 +0000 (01:24 +0000)]
Auto merge of #5841 - Mark-Simulacrum:internal-error-json, r=alexcrichton

Consider rustc failure internal despite JSON formatting

@eddyb noted this on IRC I believe, this should make compiler devs in general happy in 6 weeks once this lands onto beta

r? @alexcrichton

6 years agoAuto merge of #5840 - ehuss:uninstall-spec, r=alexcrichton
bors [Tue, 31 Jul 2018 23:28:18 +0000 (23:28 +0000)]
Auto merge of #5840 - ehuss:uninstall-spec, r=alexcrichton

Allow `-p` in `uninstall` to accommodate error messages.

The ambiguous spec error tells you to use `-p` which wasn't available for
this command.

Fixes #5006

6 years agoAdd edition field into target object in metadata as well
Arseniy Pendryak [Tue, 31 Jul 2018 22:29:48 +0000 (01:29 +0300)]
Add edition field into target object in metadata as well

6 years agoAuto merge of #5836 - kornelski:profiledebug, r=alexcrichton
bors [Tue, 31 Jul 2018 21:37:35 +0000 (21:37 +0000)]
Auto merge of #5836 - kornelski:profiledebug, r=alexcrichton

Hint correct name of profile.debug

Cargo talks about "debug" and "release" builds, but there are "dev" and "release" profiles. [This is a gotcha](https://users.rust-lang.org/t/rust-emscripten-emterpreter/19215/5). I've added an explicit hint that `profile.debug` is supposed to be `profile.dev`.

6 years agofix: Iteratively apply suggestions from the compiler
Alex Crichton [Tue, 31 Jul 2018 20:08:46 +0000 (13:08 -0700)]
fix: Iteratively apply suggestions from the compiler

This commit updates the `cargo fix` implementation to iteratively apply fixes
from the compiler instead of only once. Currently the compiler can sometimes
emit overlapping suggestions, such as in the case of transitioning

    ::foo::<::Bar>();

to ...

    crate::foo::<crate::Bar>();

and `rustfix` rightfully can't handle overlapping suggestions as there's no
clear way of how to disambiguate the fixes. To fix this problem Cargo will now
run `rustc` and `rustfix` multiple times, attempting to reach a steady state
where no fixes failed to apply.

Naturally this is a pretty tricky thing to do and we want to be sure that Cargo
doesn't loop forever, for example. A number of safeguards are in place to
prevent Cargo from going off into the weeds when fixing files, notably avoiding
to reattempt fixes if no successful fixes ended up being applied.

Closes #5813
Closes rust-lang/rust#52754

6 years agoAuto merge of #5835 - dwijnand:clippy, r=alexcrichton
bors [Tue, 31 Jul 2018 20:26:45 +0000 (20:26 +0000)]
Auto merge of #5835 - dwijnand:clippy, r=alexcrichton

Resolve some Clippy warnings

I'm not sure how these popped up since my PR 8 days ago.

My current hypotheses:
* changes in latest nightly rust/clippy
* new or changed cargo code
* I missed these as I was only touching `src/bin/cargo/main.rs`

For future reference I now iterate with:

    touch src/bin/cargo/main.rs src/cargo/lib.rs && cargo +nightly clippy

6 years agoMove all clippy config to target top files
Dale Wijnand [Tue, 31 Jul 2018 20:02:15 +0000 (21:02 +0100)]
Move all clippy config to target top files

6 years agoAdd edition field into metadata.
Arseniy Pendryak [Mon, 30 Jul 2018 22:08:16 +0000 (01:08 +0300)]
Add edition field into metadata.

Since edition feature was introduced, external tools have to support this new feature.
But cargo metadata doesn't provide info about package edition.
This commit adds edition field to SerializedPackage struct
to add the corresponding field into metadata output.

6 years agoAuto merge of #5824 - alexcrichton:careful-transition, r=alexcrichton
bors [Tue, 31 Jul 2018 19:28:52 +0000 (19:28 +0000)]
Auto merge of #5824 - alexcrichton:careful-transition, r=alexcrichton

Add more diagnostics to smooth edition transition

This commit adds two diagnostics in particular to ease the transition into the
2018 edition. The current transition process is pretty particular and must be
done carefully, so let's try to automate things to make it as painless as
possible! Notably the new diagnostics are:

* If you `cargo fix --prepare-for 2018` a crate which already has the 2018
  edition enabled, then an error is generated. This is because the compiler
  can't prepare for the 2018 edition if you're already in the 2018 edition, the
  lints won't have a chance to fire. You can only execute `--prepare-for 2018`
  over crates in the 2015 edition.

* If you `cargo fix --prepare-for 2018` and have forgotten the
  `rust_2018_preview` feature, a warning is issued. The lints don't fire unless
  the feature is enabled, so this is intended to warn in this situation to
  ensure that lints fire as much as they can.

After this commit if `cargo fix --prepare-for` exits successfully with zero
warnings then crates should be guaranteed to be compatible!

Closes #5778

6 years agoConsider rustc failure internal despite JSON formatting
Mark Rousskov [Tue, 31 Jul 2018 19:27:17 +0000 (13:27 -0600)]
Consider rustc failure internal despite JSON formatting

6 years agoremove `missing from the package list` error and fmt
Eh2406 [Tue, 31 Jul 2018 18:58:34 +0000 (14:58 -0400)]
remove `missing from the package list` error and fmt

6 years agoAllow `-p` in `uninstall` to accommodate error messages.
Eric Huss [Tue, 31 Jul 2018 18:50:09 +0000 (11:50 -0700)]
Allow `-p` in `uninstall` to accommodate error messages.

The ambiguous spec error tells you to use `-p` which wasn't available for
this command.

Fixes #5006

6 years agoAuto merge of #5811 - alexcrichton:rename-crate-feature-names, r=ehuss
bors [Tue, 31 Jul 2018 18:18:17 +0000 (18:18 +0000)]
Auto merge of #5811 - alexcrichton:rename-crate-feature-names, r=ehuss

Use listed dependency name for feature names

This commit updates the implementation of renamed dependencies to use the listed
name of a dependency in Cargo.toml for the name of the associated feature,
rather than using the package name. This'll allow disambiguating between
different packages of the same name and was the intention all along!

Closes #5753

6 years agoAuto merge of #5816 - dwijnand:edtion-per-target, r=alexcrichton
bors [Tue, 31 Jul 2018 17:10:10 +0000 (17:10 +0000)]
Auto merge of #5816 - dwijnand:edtion-per-target, r=alexcrichton

Edition key should be per-target, not per-package

Fixes #5661

I've pushed this WIP PR as I'd love some early feedback on it and some tips on:

* how to best to make it fail if edition is set on a target, but the feature isn't set; and
* what tests this should include (i.e how exhaustive should I go)

Thanks!

6 years agoUse listed dependency name for feature names
Alex Crichton [Thu, 26 Jul 2018 19:56:32 +0000 (12:56 -0700)]
Use listed dependency name for feature names

This commit updates the implementation of renamed dependencies to use the listed
name of a dependency in Cargo.toml for the name of the associated feature,
rather than using the package name. This'll allow disambiguating between
different packages of the same name and was the intention all along!

Closes #5753

6 years agoAdd more diagnostics to smooth edition transition
Alex Crichton [Sat, 28 Jul 2018 20:22:32 +0000 (13:22 -0700)]
Add more diagnostics to smooth edition transition

This commit adds two diagnostics in particular to ease the transition into the
2018 edition. The current transition process is pretty particular and must be
done carefully, so let's try to automate things to make it as painless as
possible! Notably the new diagnostics are:

* If you `cargo fix --prepare-for 2018` a crate which already has the 2018
  edition enabled, then an error is generated. This is because the compiler
  can't prepare for the 2018 edition if you're already in the 2018 edition, the
  lints won't have a chance to fire. You can only execute `--prepare-for 2018`
  over crates in the 2015 edition.

* If you `cargo fix --prepare-for 2018` and have forgotten the
  `rust_2018_preview` feature, a warning is issued. The lints don't fire unless
  the feature is enabled, so this is intended to warn in this situation to
  ensure that lints fire as much as they can.

After this commit if `cargo fix --prepare-for` exits successfully with zero
warnings then crates should be guaranteed to be compatible!

Closes #5778

6 years agoResolve a single_match lint warning
Dale Wijnand [Tue, 31 Jul 2018 08:57:54 +0000 (09:57 +0100)]
Resolve a single_match lint warning

6 years agoExempt 2 wrong_self_convention lint warnings
Dale Wijnand [Tue, 31 Jul 2018 08:56:08 +0000 (09:56 +0100)]
Exempt 2 wrong_self_convention lint warnings

6 years agoResolve a trivially_copy_pass_by_ref lint warning
Dale Wijnand [Tue, 31 Jul 2018 08:46:33 +0000 (09:46 +0100)]
Resolve a trivially_copy_pass_by_ref lint warning

6 years agoResolve a wrong_self_convention lint warning
Dale Wijnand [Tue, 31 Jul 2018 08:43:23 +0000 (09:43 +0100)]
Resolve a wrong_self_convention lint warning

6 years agoResolve a wrong_self_convention lint warning
Dale Wijnand [Tue, 31 Jul 2018 08:39:30 +0000 (09:39 +0100)]
Resolve a wrong_self_convention lint warning

.. by inlining & removing `Members::is_empty`.

For details see
https://rust-lang-nursery.github.io/rust-clippy/v0.0.212/index.html#wrong_self_convention

Asides from opt-ing out, the alternative I saw was calling it
"into_empty" and make it return a little

    enum Empty { Empty, NonEmpty }

type.

6 years agoResolve 2 needless_pass_by_value lint warnings
Dale Wijnand [Tue, 31 Jul 2018 08:32:57 +0000 (09:32 +0100)]
Resolve 2 needless_pass_by_value lint warnings

TIL Rust doesn't have equational reasoning.. :-/
(can't inline the new "exec" bindings)

6 years agoAdd tests for per-target edition
Dale Wijnand [Tue, 31 Jul 2018 13:49:33 +0000 (14:49 +0100)]
Add tests for per-target edition

Test:
* enabling edition feature & setting at target level (happy path)
* overriding the package-level edition with per-target edition
* feature gating of per-target edition
* per-target edition usage for rustdoc

6 years agoWire Features down to targets::configure to check the edition feature gate
Dale Wijnand [Tue, 31 Jul 2018 13:22:45 +0000 (14:22 +0100)]
Wire Features down to targets::configure to check the edition feature gate

6 years agoDocument per-target edition & give an example
Dale Wijnand [Tue, 31 Jul 2018 09:47:35 +0000 (10:47 +0100)]
Document per-target edition & give an example

6 years agoHint correct name of profile.debug
Kornel Lesiński [Tue, 31 Jul 2018 09:13:16 +0000 (10:13 +0100)]
Hint correct name of profile.debug

6 years agoExempt too_many_arguments throughout the cargo lib crate
Dale Wijnand [Tue, 31 Jul 2018 08:15:32 +0000 (09:15 +0100)]
Exempt too_many_arguments throughout the cargo lib crate

I'm confused.  Now this is duplicated with src/bin/cargo/main.rs and I
don't know how to avoid that.  Tips welcome.

6 years agoExempt 3 identity_op lint warnings
Dale Wijnand [Tue, 31 Jul 2018 08:10:45 +0000 (09:10 +0100)]
Exempt 3 identity_op lint warnings

6 years agofix: Only fix "primary" packages by default
Alex Crichton [Sat, 28 Jul 2018 17:38:34 +0000 (10:38 -0700)]
fix: Only fix "primary" packages by default

The previous heuristic for fixing packages was to fix all packages in a
workspace, aka those with path dependencies. Instead this commit switches cargo
over to only fixing the "primary" package, or those requested on the command
line or implicitly via cwd.

This will later help us identify which packages are being targeted so we can
provide tailored warnings and errors for mixed up transition steps.

6 years agoAuto merge of #5814 - alexcrichton:fix-all-targets, r=alexcrichton
bors [Mon, 30 Jul 2018 22:11:58 +0000 (22:11 +0000)]
Auto merge of #5814 - alexcrichton:fix-all-targets, r=alexcrichton

cargo fix: Pass `--all-targets` to `cargo fix` by default

This'll help fix as much code as possible, including tests!

Closes #5739

6 years agouse enum instead of bool
Eh2406 [Mon, 30 Jul 2018 21:30:55 +0000 (17:30 -0400)]
use enum instead of bool

6 years agoAuto merge of #5832 - Eh2406:collect_seq, r=alexcrichton
bors [Mon, 30 Jul 2018 21:18:51 +0000 (21:18 +0000)]
Auto merge of #5832 - Eh2406:collect_seq, r=alexcrichton

remove some allocations in Serialize

I have know reason to think this is in the hot path, but don't allocate if we don't have to.

6 years agoremove some allocations in Serialize
Eh2406 [Mon, 30 Jul 2018 18:11:21 +0000 (14:11 -0400)]
remove some allocations in Serialize

6 years agocargo update can deal with some bad lockfiles
Eh2406 [Fri, 27 Jul 2018 18:32:02 +0000 (14:32 -0400)]
cargo update can deal with some bad lockfiles

6 years agoAuto merge of #5830 - Xanewok:executor-compile-mode, r=matklad
bors [Sun, 29 Jul 2018 20:56:35 +0000 (20:56 +0000)]
Auto merge of #5830 - Xanewok:executor-compile-mode, r=matklad

Add CompileMode to Executor callbacks

This came up when trying to fix https://github.com/rust-lang-nursery/rls/issues/876.

So currently in the RLS we recreate our own dep graph, where we store units with a key `(PackageId, TargetKind)`. This turned out to be not enough since
a) we can have multiple bin target kinds with different names (unrelated to this PR)
b) same package target kind (bin, lib) can be compiled regularly or including the test harness.
With this, we can distinguish these cases and properly rerun both regular compilation check and the one including unit tests.

Without this information we'd need to fall back on guessing whether the rustc invocation has `--test` but having this information makes it accurate and seems useful enough to add it to the callback arguments.

r? @alexcrichton or @matklad

6 years agoAdd CompileMode to Executor callbacks
Igor Matuszewski [Sun, 29 Jul 2018 19:18:36 +0000 (21:18 +0200)]
Add CompileMode to Executor callbacks

This helps distinguish whether a given rustc invocation corresponds to a
regular compilation or is it compiled as a test harness. The difference is
important for tools like RLS, since checking test code is different than
checking what is it regularly compiled as.

6 years agoAuto merge of #5828 - kennytm:compile-progress-names, r=alexcrichton
bors [Sun, 29 Jul 2018 16:00:37 +0000 (16:00 +0000)]
Auto merge of #5828 - kennytm:compile-progress-names, r=alexcrichton

-Zcompile-progress: Use the target name in the progress bar when building a test/binary.

Thus fixes hilarious output like
https://twitter.com/ManishEarth/status/1015479576670027776.

New output: https://asciinema.org/a/F1rkCk0bTWKQMr1NEScia3IYx

6 years agoUse the target name in the progress bar when building a test/binary.
kennytm [Sat, 28 Jul 2018 17:18:47 +0000 (01:18 +0800)]
Use the target name in the progress bar when building a test/binary.

Thus fixes hilarious output like
https://twitter.com/ManishEarth/status/1015479576670027776.

6 years agoDefault target edition to package edition
Dale Wijnand [Fri, 27 Jul 2018 15:59:19 +0000 (16:59 +0100)]
Default target edition to package edition

6 years agofix: Pass `--all-targets` to `cargo fix` by default
Alex Crichton [Thu, 26 Jul 2018 22:21:34 +0000 (15:21 -0700)]
fix: Pass `--all-targets` to `cargo fix` by default

This'll help fix as much code as possible, including tests!

Closes #5739

6 years agoWire target edition to rustc/rustdoc
Dale Wijnand [Fri, 27 Jul 2018 14:43:50 +0000 (15:43 +0100)]
Wire target edition to rustc/rustdoc

6 years agoWire Fingerprint to target unit's edition
Dale Wijnand [Fri, 27 Jul 2018 14:37:13 +0000 (15:37 +0100)]
Wire Fingerprint to target unit's edition

6 years agoAdd an Edition on TomlTarget & Target, & wire
Dale Wijnand [Fri, 27 Jul 2018 13:56:48 +0000 (14:56 +0100)]
Add an Edition on TomlTarget & Target, & wire

6 years agoAuto merge of #5812 - dwijnand:move-existing_vcs_repo, r=alexcrichton
bors [Fri, 27 Jul 2018 04:56:29 +0000 (04:56 +0000)]
Auto merge of #5812 - dwijnand:move-existing_vcs_repo, r=alexcrichton

Move existing_vcs_repo to the util::vcs module

Rather than being in cargo_new publically exposed and used by cargo fix.

Just a proposal, as it looked weird to me.

6 years agoAuto merge of #5810 - Eh2406:test-fix, r=alexcrichton
bors [Fri, 27 Jul 2018 03:51:35 +0000 (03:51 +0000)]
Auto merge of #5810 - Eh2406:test-fix, r=alexcrichton

now that we respect gitignore tests can be simplified

There are a lot of test that used a tempfile to avoid the fact that cargo would not init a git in the test folder. (or because they were copy/pasted from one that did.) Now that #5733 landed we can remove them all.

6 years agoAuto merge of #5807 - dwijnand:cargo-list-summary, r=alexcrichton
bors [Fri, 27 Jul 2018 02:49:04 +0000 (02:49 +0000)]
Auto merge of #5807 - dwijnand:cargo-list-summary, r=alexcrichton

Show the command summary when running cargo --list

Fixes #3726

6 years agoAuto merge of #5801 - ehuss:fix-doctestable, r=alexcrichton
bors [Fri, 27 Jul 2018 02:17:52 +0000 (02:17 +0000)]
Auto merge of #5801 - ehuss:fix-doctestable, r=alexcrichton

Fix `test --doc` with incompatible lib types.

When I recently changed the doctest handling, I forgot to check the lib type in
the `test --doc` scenario.

I also added the package name to a nearby error message, since it can be
confusing in a workspace setting.

6 years agoMove existing_vcs_repo to the util::vcs module
Dale Wijnand [Thu, 26 Jul 2018 21:09:45 +0000 (22:09 +0100)]
Move existing_vcs_repo to the util::vcs module

Rather than being in cargo_new publically exposed and used by cargo fix.

6 years agoAvoid right-padding commands with spaces
Dale Wijnand [Thu, 26 Jul 2018 20:42:31 +0000 (21:42 +0100)]
Avoid right-padding commands with spaces

Primarily because it needlessly breaks tests.

6 years agoAdapt --list output in find_closest_biuld_to_build test
Dale Wijnand [Thu, 26 Jul 2018 20:41:43 +0000 (21:41 +0100)]
Adapt --list output in find_closest_biuld_to_build test

6 years agoAuto merge of #5804 - dwijnand:hg-discover, r=alexcrichton
bors [Thu, 26 Jul 2018 19:29:21 +0000 (19:29 +0000)]
Auto merge of #5804 - dwijnand:hg-discover, r=alexcrichton

Fix HgRepo::discover

Replace the duplicate .cwd call with an invocation taken from
https://stackoverflow.com/a/3138925/463761

Match the semantics of the other vcs calls, which is invoke from 'cwd'
targeting 'path'. Looks a little confusing because hg takes a '--cwd'
argument.

6 years agoremove all of the (now) unnecessary temp file usage in tests
Eh2406 [Thu, 26 Jul 2018 19:10:48 +0000 (15:10 -0400)]
remove all of the (now) unnecessary temp file usage in tests

6 years agoupdate test for #5733
Eh2406 [Thu, 26 Jul 2018 18:39:10 +0000 (14:39 -0400)]
update test for #5733

6 years agoAuto merge of #5733 - withoutboats:cargo-new-respects-gitignore, r=alexcrichton
bors [Thu, 26 Jul 2018 18:01:26 +0000 (18:01 +0000)]
Auto merge of #5733 - withoutboats:cargo-new-respects-gitignore, r=alexcrichton

Respect .gitignore during `cargo new`

When running `cargo new`, we check to see if you are inside a git repository. If you are, we do not initialize a new git repo for your project unless you specifically asked for it using --vcs. (See #1210 for more background).

This commit changes that behavior to *also* create a new repo if the project would be an ignored path in the parent repository. This way, if your home directory is a git repository, as long as you have ignored the directory you are creating a new project in, we will instantiate a git repository without you having to specifically request it.

6 years agoAuto merge of #5802 - ehuss:fix-doc-typo, r=dwijnand
bors [Thu, 26 Jul 2018 17:21:33 +0000 (17:21 +0000)]
Auto merge of #5802 - ehuss:fix-doc-typo, r=dwijnand

Fix minor typo in the book.

6 years agoTest verbose error output for a bad lockfile
Dale Wijnand [Thu, 26 Jul 2018 16:14:08 +0000 (17:14 +0100)]
Test verbose error output for a bad lockfile

6 years agoSuggest "update -p" to fix a bad lockfile
Dale Wijnand [Thu, 26 Jul 2018 16:12:09 +0000 (17:12 +0100)]
Suggest "update -p" to fix a bad lockfile

6 years agoRespect .gitignore during `cargo new`
Without Boats [Tue, 17 Jul 2018 06:27:43 +0000 (02:27 -0400)]
Respect .gitignore during `cargo new`

When running `cargo new`, we check to see if you are inside a git
repository. If you are, we do not initialize a new git repo for
your project unless you specifically asked for it using --vcs.
(See #1210 for more background).

This commit changes that behavior to *also* create a new repo if
the project would be an ignored path in the parent repository.
This way, if your home directory is a git repository, as long as
you have ignored the directory you are creating a new project in,
we will instantiate a git repository without you having to
specifically request it.

6 years agoFix read-manifest summary printing under cargo --list
Dale Wijnand [Thu, 26 Jul 2018 11:09:04 +0000 (12:09 +0100)]
Fix read-manifest summary printing under cargo --list

6 years agoShow the command summary when running cargo --list
Dale Wijnand [Thu, 26 Jul 2018 11:08:39 +0000 (12:08 +0100)]
Show the command summary when running cargo --list

6 years agoReformat main::list_commands to return CommandInfo over a tuple
Dale Wijnand [Thu, 26 Jul 2018 10:29:47 +0000 (11:29 +0100)]
Reformat main::list_commands to return CommandInfo over a tuple

6 years agoFix HgRepo::discover
Dale Wijnand [Thu, 26 Jul 2018 07:49:03 +0000 (08:49 +0100)]
Fix HgRepo::discover

Replace the duplicate .cwd call with an invocation taken from
https://stackoverflow.com/a/3138925/463761

Match the semantics of the other vcs calls, which is invoke from 'cwd'
targeting 'path'. Looks a little confusing because hg takes a '--cwd'
argument.

6 years agoAuto merge of #5803 - dwijnand:dependabot/cargo/crossbeam-utils-0.5, r=matklad
bors [Thu, 26 Jul 2018 07:13:38 +0000 (07:13 +0000)]
Auto merge of #5803 - dwijnand:dependabot/cargo/crossbeam-utils-0.5, r=matklad

Upgrade to crossbeam-utils's -new 0.5 API

Supersedes #5800

6 years agoUpgrade to crossbeam-utils's -new 0.5 API
Dale Wijnand [Thu, 26 Jul 2018 05:47:19 +0000 (06:47 +0100)]
Upgrade to crossbeam-utils's -new 0.5 API

6 years agoFix minor typo in the book.
Eric Huss [Thu, 26 Jul 2018 05:46:17 +0000 (22:46 -0700)]
Fix minor typo in the book.

6 years agoFix `test --doc` with incompatible lib types.
Eric Huss [Thu, 26 Jul 2018 05:40:46 +0000 (22:40 -0700)]
Fix `test --doc` with incompatible lib types.

When I recently changed the doctest handling, I forgot to check the lib type in
the `test --doc` scenario.

I also added the package name to a nearby error message, since it can be
confusing in a workspace setting.

6 years agoUpdate crossbeam-utils requirement to 0.5
dependabot[bot] [Thu, 26 Jul 2018 05:30:17 +0000 (05:30 +0000)]
Update crossbeam-utils requirement to 0.5

Updates the requirements on [crossbeam-utils](https://github.com/crossbeam-rs/crossbeam-utils) to permit the latest version.
- [Release notes](https://github.com/crossbeam-rs/crossbeam-utils/releases)
- [Changelog](https://github.com/crossbeam-rs/crossbeam-utils/blob/master/CHANGELOG.md)
- [Commits](https://github.com/crossbeam-rs/crossbeam-utils/commits/v0.5.0)

Signed-off-by: dependabot[bot] <support@dependabot.com>
6 years agoAuto merge of #5794 - Nemo157:rustdoc-rename-extern, r=alexcrichton
bors [Thu, 26 Jul 2018 00:36:42 +0000 (00:36 +0000)]
Auto merge of #5794 - Nemo157:rustdoc-rename-extern, r=alexcrichton

Apply dependency renamings when running rustdoc

Fixes #5792

6 years agoAuto merge of #5790 - dwijnand:dependabot/cargo/crossbeam-0.4, r=alexcrichton
bors [Wed, 25 Jul 2018 23:10:21 +0000 (23:10 +0000)]
Auto merge of #5790 - dwijnand:dependabot/cargo/crossbeam-0.4, r=alexcrichton

Upgrade to crossbeam 0.4

Supersedes #5789

6 years agoSwitch to crossbeam_utils crate, sidesteppin
Dale Wijnand [Wed, 25 Jul 2018 22:32:25 +0000 (23:32 +0100)]
Switch to crossbeam_utils crate, sidesteppin

6 years agoAuto merge of #5791 - dwijnand:oneline-files, r=alexcrichton
bors [Wed, 25 Jul 2018 22:04:20 +0000 (22:04 +0000)]
Auto merge of #5791 - dwijnand:oneline-files, r=alexcrichton

Declare one-line files on one line, in test projects

Builds on #5787
Fixes #5745 unless @alexcrichton feels more can be done there.

6 years agoAuto merge of #5787 - dwijnand:dedup-manifest-further, r=alexcrichton
bors [Wed, 25 Jul 2018 21:21:24 +0000 (21:21 +0000)]
Auto merge of #5787 - dwijnand:dedup-manifest-further, r=alexcrichton

Deduplicate a bunch more manifests in test code

Wanted to deduplicate the "bar" manifest files too, and found I hadn't even done build.rs.

6 years agoApply dependency renamings when running rustdoc
Wim Looman [Wed, 25 Jul 2018 16:58:28 +0000 (18:58 +0200)]
Apply dependency renamings when running rustdoc

Fixes #5792

6 years agoUpdate the minimal parking_lot_core version
Dale Wijnand [Wed, 25 Jul 2018 16:11:21 +0000 (17:11 +0100)]
Update the minimal parking_lot_core version

6 years agoDeclare one-line write_all contents on one line, too
Dale Wijnand [Wed, 25 Jul 2018 08:58:40 +0000 (09:58 +0100)]
Declare one-line write_all contents on one line, too

6 years agoDeclare one-line files on one line, in test projects
Dale Wijnand [Wed, 25 Jul 2018 00:30:32 +0000 (01:30 +0100)]
Declare one-line files on one line, in test projects

6 years agoMigrate to crossbeam's new 0.4 API
Dale Wijnand [Wed, 25 Jul 2018 05:50:07 +0000 (06:50 +0100)]
Migrate to crossbeam's new 0.4 API

6 years agoUpdate crossbeam requirement to 0.4
dependabot[bot] [Wed, 25 Jul 2018 05:31:03 +0000 (05:31 +0000)]
Update crossbeam requirement to 0.4

Updates the requirements on [crossbeam](https://github.com/crossbeam-rs/crossbeam) to permit the latest version.
- [Release notes](https://github.com/crossbeam-rs/crossbeam/releases)
- [Changelog](https://github.com/crossbeam-rs/crossbeam/blob/master/CHANGELOG.md)
- [Commits](https://github.com/crossbeam-rs/crossbeam/commits)

Signed-off-by: dependabot[bot] <support@dependabot.com>
6 years agoDedup a bunch more manifest
Dale Wijnand [Tue, 24 Jul 2018 22:35:01 +0000 (23:35 +0100)]
Dedup a bunch more manifest

6 years agoReplace const BASIC_MANIFEST with basic_manifest("foo", "0.0.1")
Dale Wijnand [Tue, 24 Jul 2018 17:57:58 +0000 (18:57 +0100)]
Replace const BASIC_MANIFEST with basic_manifest("foo", "0.0.1")

6 years agoAuto merge of #5782 - dwijnand:dedup-manifest, r=alexcrichton
bors [Tue, 24 Jul 2018 20:47:57 +0000 (20:47 +0000)]
Auto merge of #5782 - dwijnand:dedup-manifest, r=alexcrichton

Add a default template for Cargo.toml

Fixes #5743

r? @alexcrichton

6 years agoAuto merge of #5621 - knight42:cargo-search-relaced-registry, r=alexcrichton
bors [Tue, 24 Jul 2018 16:10:11 +0000 (16:10 +0000)]
Auto merge of #5621 - knight42:cargo-search-relaced-registry, r=alexcrichton

Update replaced registry before search

Close #5550.

It seems that updating the replaced registry before search has not been well considered in cargo and I have to add a function to trait `core::source::Source` to get the replaced `SourceId`.

I am not sure whether this is a good design, any advice is welcome.

6 years agoDrop now unnecessary basic manifests
Dale Wijnand [Tue, 24 Jul 2018 13:01:56 +0000 (14:01 +0100)]
Drop now unnecessary basic manifests

6 years agoAuto merge of #5757 - Eh2406:minimal-versions-build, r=alexcrichton
bors [Tue, 24 Jul 2018 15:11:36 +0000 (15:11 +0000)]
Auto merge of #5757 - Eh2406:minimal-versions-build, r=alexcrichton

Minimal versions build

This is a conceptual rebase of #5275, to reiterate:
Big thanks to @klausi for doing most of the work!
Thanks to @matklad for pointing out that we could finish it.

I don't know if I have the Travis config quite correct, advice definitely wellcome!

edit: closes #5275

6 years agoupdate curl so we don't need so may hacks
Eh2406 [Tue, 24 Jul 2018 14:41:10 +0000 (10:41 -0400)]
update curl so we don't need so may hacks

6 years agoAuto merge of #5779 - alexcrichton:msg, r=dwijnand
bors [Tue, 24 Jul 2018 14:02:09 +0000 (14:02 +0000)]
Auto merge of #5779 - alexcrichton:msg, r=dwijnand

Fix a formatting of a cargo fix message

Something I saw in the report of https://github.com/rust-lang/cargo/issues/5775

6 years agoOpt-out all other failing tests
Dale Wijnand [Tue, 24 Jul 2018 12:59:42 +0000 (13:59 +0100)]
Opt-out all other failing tests

Looks like cargo traverses the filesystem & fails if it runs into a
Cargo.toml that doesn't declare a target.  I couldn't find a nice way to
re-engineer the test to avoid this issue.  So I'll leave that as someone
else's exercise.