]> git.proxmox.com Git - cargo.git/log
cargo.git
5 years agoBring back `Graph::sort` so we can use it in tests
Eh2406 [Mon, 15 Oct 2018 01:39:30 +0000 (21:39 -0400)]
Bring back `Graph::sort` so we can use it in tests

This reverts commit a26676a

5 years agogenerate Build deps, don't bother with Development deps.
Eh2406 [Mon, 8 Oct 2018 01:02:36 +0000 (21:02 -0400)]
generate Build deps, don't bother with Development deps.

5 years agomove the `ActivateError` to the `errors.rs` and fmt
Eh2406 [Thu, 18 Oct 2018 14:04:57 +0000 (10:04 -0400)]
move the `ActivateError` to the `errors.rs` and fmt

5 years agoAuto merge of #6247 - alexcrichton:fix-less, r=dwijnand
bors [Thu, 1 Nov 2018 23:39:13 +0000 (23:39 +0000)]
Auto merge of #6247 - alexcrichton:fix-less, r=dwijnand

Don't turn on edition lints for unfixed crates

Currently Cargo runs the risk of turning on the edition lints for crates
which `cargo fix` isn't actually fixing, which means you'll get a huge
deluge of lints that would otherwise be automatically fixable! Fix this
situation by only enabling lints in the same cases that we're actually
applying fixes.

Closes rust-lang-nursery/rustfix#150

5 years agoAuto merge of #6243 - btashton:strip_email_bracket, r=alexcrichton
bors [Thu, 1 Nov 2018 22:36:33 +0000 (22:36 +0000)]
Auto merge of #6243 - btashton:strip_email_bracket, r=alexcrichton

Strip angle brackets from author email before passing to template.

Some people already have angle brackets around their email in
git settings or other author sources. Right now if you create
a new project the Cargo.toml would render something like:

`authors = ["bar <<foo@baz>>"]`

instead of

`authors = ["bar <foo@baz>"]`

This detects the emails that start and end with `<>` and removes them.

5 years agoStrip angle brackets from author email before passing to template.
Brennan Ashton [Wed, 31 Oct 2018 20:07:02 +0000 (13:07 -0700)]
Strip angle brackets from author email before passing to template.

Some people already have angle brackets around their email in
git settings or other author sources. Right now if you create
a new project the Cargo.toml would render something like:

authors = ["bar <<foo@baz>>"]

instead of

authors = ["bar <foo@baz>"]

This detects the emails that start and end with <> and removes them.

5 years agoAuto merge of #6242 - sfackler:registry-username, r=alexcrichton
bors [Thu, 1 Nov 2018 15:55:19 +0000 (15:55 +0000)]
Auto merge of #6242 - sfackler:registry-username, r=alexcrichton

Allow usernames in alt registry URLs

We want to forbid secrets since they'll commonly end up checked into
source control, but usernames are fine (and are commonly going to be
`git`).

Closes #6241

r? @alexcrichton

5 years agoDon't turn on edition lints for unfixed crates
Alex Crichton [Thu, 1 Nov 2018 15:13:11 +0000 (08:13 -0700)]
Don't turn on edition lints for unfixed crates

Currently Cargo runs the risk of turning on the edition lints for crates
which `cargo fix` isn't actually fixing, which means you'll get a huge
deluge of lints that would otherwise be automatically fixable! Fix this
situation by only enabling lints in the same cases that we're actually
applying fixes.

Closes rust-lang-nursery/rustfix#150

5 years agoAuto merge of #6236 - ehuss:fix-fix_path_deps, r=alexcrichton
bors [Wed, 31 Oct 2018 18:59:19 +0000 (18:59 +0000)]
Auto merge of #6236 - ehuss:fix-fix_path_deps, r=alexcrichton

Fix fix_path_deps test error.

5 years agoAuto merge of #6235 - ehuss:fix-globs-link, r=alexcrichton
bors [Wed, 31 Oct 2018 18:08:27 +0000 (18:08 +0000)]
Auto merge of #6235 - ehuss:fix-globs-link, r=alexcrichton

Fix `globs` link.

5 years agoAuto merge of #6232 - pwoolcoc:small-doc-fixes, r=alexcrichton
bors [Wed, 31 Oct 2018 17:18:22 +0000 (17:18 +0000)]
Auto merge of #6232 - pwoolcoc:small-doc-fixes, r=alexcrichton

Update docs to be more like a regular local crates.io setup

5 years agoAllow usernames in alt registry URLs
Steven Fackler [Wed, 31 Oct 2018 01:01:44 +0000 (18:01 -0700)]
Allow usernames in alt registry URLs

We want to forbid secrets since they'll commonly end up checked into
source control, but usernames are fine (and are commonly going to be
`git`).

Closes #6241

5 years agoAuto merge of #6234 - alexcrichton:bump, r=alexcrichton
bors [Tue, 30 Oct 2018 02:11:20 +0000 (02:11 +0000)]
Auto merge of #6234 - alexcrichton:bump, r=alexcrichton

Bump to 0.33.0

5 years agoFix fix_path_deps test error.
Eric Huss [Mon, 29 Oct 2018 21:55:21 +0000 (14:55 -0700)]
Fix fix_path_deps test error.

5 years agoFix `globs` link.
Eric Huss [Mon, 29 Oct 2018 18:10:42 +0000 (11:10 -0700)]
Fix `globs` link.

5 years agoBump to 0.33.0
Alex Crichton [Mon, 29 Oct 2018 16:14:07 +0000 (09:14 -0700)]
Bump to 0.33.0

5 years agoAuto merge of #6233 - dtolnay:erase, r=alexcrichton
bors [Sun, 28 Oct 2018 20:11:57 +0000 (20:11 +0000)]
Auto merge of #6233 - dtolnay:erase, r=alexcrichton

Use ANSI escape code to clear line

This eliminates the trailing spaces that Cargo used to use for clearing a line of output. Trailing spaces are problematic because they take up space on the next line when reducing the width of a terminal.

5 years agoUse ANSI escape code to clear line
David Tolnay [Sun, 28 Oct 2018 18:39:37 +0000 (11:39 -0700)]
Use ANSI escape code to clear line

This eliminates the trailing spaces that Cargo used to use for clearing
a line of output. Trailing spaces are problematic because they take up
space on the next line when reducing the width of a terminal.

5 years agoUpdate docs to be more like a regular local crates.io setup
Paul Woolcock [Sun, 28 Oct 2018 17:50:03 +0000 (13:50 -0400)]
Update docs to be more like a regular local crates.io setup

5 years agoAuto merge of #6194 - dwijnand:todo-remove-Compilation.native_dirs, r=dwijnand
bors [Wed, 24 Oct 2018 12:23:55 +0000 (12:23 +0000)]
Auto merge of #6194 - dwijnand:todo-remove-Compilation.native_dirs, r=dwijnand

Remove the remote TODO on Compilation.native_dirs

It's still used, see tests:

* build_script::doctest_receives_build_link_args
* build_script::rename_with_link_search_path
* run::run_with_library_paths
* run::library_paths_sorted_alphabetically

Originally I was trying to action https://github.com/rust-lang/cargo/pull/792#discussion_r226826431 with this PR

5 years agoRemove the remote TODO on Compilation.native_dirs
Dale Wijnand [Tue, 23 Oct 2018 08:57:07 +0000 (04:57 -0400)]
Remove the remote TODO on Compilation.native_dirs

It's still used, see tests:

* build_script::doctest_receives_build_link_args
* build_script::rename_with_link_search_path
* run::run_with_library_paths
* run::library_paths_sorted_alphabetically

5 years agoAuto merge of #6206 - ehuss:progress-clear, r=alexcrichton
bors [Tue, 23 Oct 2018 07:43:34 +0000 (07:43 +0000)]
Auto merge of #6206 - ehuss:progress-clear, r=alexcrichton

Fix download summary overlapping progress.

The following two lines:

```
 Downloading 0 crates, extracting cargo-modules ...
  Downloaded 1 crates (541.8 KB) in 1.64s
```

Were being combined resulting in:

```
  Downloaded 1 crates (541.8 KB) in 1.64sodules ...
```

5 years agoFix download summary overlapping progress.
Eric Huss [Mon, 22 Oct 2018 16:41:01 +0000 (09:41 -0700)]
Fix download summary overlapping progress.

The following two lines:

```
 Downloading 0 crates, extracting cargo-modules ...
  Downloaded 1 crates (541.8 KB) in 1.64s
```

Were being combined resulting in:

```
  Downloaded 1 crates (541.8 KB) in 1.64sodules ...
```

6 years agoAuto merge of #6193 - dwijnand:remove-Compilation.libraries, r=alexcrichton
bors [Sat, 20 Oct 2018 20:01:47 +0000 (20:01 +0000)]
Auto merge of #6193 - dwijnand:remove-Compilation.libraries, r=alexcrichton

Remove Compilation.libraries

Actioning https://github.com/rust-lang/cargo/pull/5651#issuecomment-402825950

6 years agoRemove Compilation.libraries
Dale Wijnand [Sat, 20 Oct 2018 08:02:56 +0000 (09:02 +0100)]
Remove Compilation.libraries

6 years agoAuto merge of #6192 - ehuss:test-dep-with-dev, r=alexcrichton
bors [Sat, 20 Oct 2018 02:26:47 +0000 (02:26 +0000)]
Auto merge of #6192 - ehuss:test-dep-with-dev, r=alexcrichton

Provide error for testing non-workspaces packages with dev-dependencies.

Considering in most cases it just won't work, might as well display a better error message explaining why.

Closes #6183, #5156

6 years agoAuto merge of #6191 - ehuss:fix-uuid-link, r=alexcrichton
bors [Sat, 20 Oct 2018 01:27:33 +0000 (01:27 +0000)]
Auto merge of #6191 - ehuss:fix-uuid-link, r=alexcrichton

Fix minor broken link in docs.

6 years agoFix minor broken link in docs.
Eric Huss [Sat, 20 Oct 2018 01:13:31 +0000 (18:13 -0700)]
Fix minor broken link in docs.

6 years agoProvide error for testing non-workspaces packages with dev-dependencies.
Eric Huss [Sat, 20 Oct 2018 01:04:36 +0000 (18:04 -0700)]
Provide error for testing non-workspaces packages with dev-dependencies.

Considering in most cases it just won't work, might as well display
a better error message explaining why.

6 years agoAuto merge of #6164 - luser:build-script-output-prefix, r=alexcrichton
bors [Fri, 19 Oct 2018 13:31:31 +0000 (13:31 +0000)]
Auto merge of #6164 - luser:build-script-output-prefix, r=alexcrichton

Prefix build script output with crate name when running in extra verbose mode. Fixes #6158.

cargo's extra verbose mode is useful for getting detailed information out of
builds in CI where it can be difficult to examine the build environment
after-the-fact. However, when multiple build scripts are running as part of a
build it's not always clear what output is from which build script. This patch
makes cargo prefix each line of build script output with the crate name
in this case.

I put together [a simple test crate](https://github.com/luser/snippet/tree/build-script-output) for this. Building that crate on my machine with stable cargo produces:
```
luser@eye7:/build/snippet$ cargo build -vv
   Compiling one v0.1.0 (file:///build/snippet/one)
   Compiling two v0.1.0 (file:///build/snippet/two)
       Fresh itoa v0.3.4
     Running `rustc --crate-name build_script_build one/build.rs --crate-type bin --emit=dep-info,link -C debuginfo=2 -C metadata=8e5ff38061b98562 -C extra-filename=-8e5ff38061b98562 --out-dir /build/snippet/target/debug/build/one-8e5ff38061b98562 -C incremental=/build/snippet/target/debug/incremental -L dependency=/build/snippet/target/debug/deps`
     Running `rustc --crate-name build_script_build two/build.rs --crate-type bin --emit=dep-info,link -C debuginfo=2 -C metadata=fcd8c089040e6ff4 -C extra-filename=-fcd8c089040e6ff4 --out-dir /build/snippet/target/debug/build/two-fcd8c089040e6ff4 -C incremental=/build/snippet/target/debug/incremental -L dependency=/build/snippet/target/debug/deps`
     Running `/build/snippet/target/debug/build/two-fcd8c089040e6ff4/build-script-build`
     Running `/build/snippet/target/debug/build/one-8e5ff38061b98562/build-script-build`
Error 0
Output 0
Output 0
Error 0
Output 1
Error 1
Error 1
Output 1
Error 2
Output 2
Error 2
Output 2
Error 3
Output 3
Error 3
Output 3
Error 4
Error 4
Output 4
Output 4
Error 5
Error 5
Output 5
Output 5
Error 6
Output 6
Error 6
Output 6
Error 7
Output 7
Error 7
Output 7
Error 8
Error 8
Output 8
Output 8
Error 9
Output 9
Error 9
Output 9
     Running `rustc --crate-name two two/src/lib.rs --crate-type lib --emit=dep-info,link -C debuginfo=2 -C metadata=904ea56f5613ae62 -C extra-filename=-904ea56f5613ae62 --out-dir /build/snippet/target/debug/deps -C incremental=/build/snippet/target/debug/incremental -L dependency=/build/snippet/target/debug/deps`
     Running `rustc --crate-name one one/src/lib.rs --crate-type lib --emit=dep-info,link -C debuginfo=2 -C metadata=c2b76a52468c9a0b -C extra-filename=-c2b76a52468c9a0b --out-dir /build/snippet/target/debug/deps -C incremental=/build/snippet/target/debug/incremental -L dependency=/build/snippet/target/debug/deps`
   Compiling snippet v0.1.4-alpha.0 (file:///build/snippet)
     Running `rustc --crate-name snippet src/lib.rs --crate-type lib --emit=dep-info,link -C debuginfo=2 -C metadata=a5c6abeab1e38e11 -C extra-filename=-a5c6abeab1e38e11 --out-dir /build/snippet/target/debug/deps -C incremental=/build/snippet/target/debug/incremental -L dependency=/build/snippet/target/debug/deps --extern itoa=/build/snippet/target/debug/deps/libitoa-327a92d5ddd56b4a.rlib --extern one=/build/snippet/target/debug/deps/libone-c2b76a52468c9a0b.rlib --extern two=/build/snippet/target/debug/deps/libtwo-904ea56f5613ae62.rlib`
     Running `rustc --crate-name snippet src/main.rs --crate-type bin --emit=dep-info,link -C debuginfo=2 -C metadata=8b5a0b44264aa67c -C extra-filename=-8b5a0b44264aa67c --out-dir /build/snippet/target/debug/deps -C incremental=/build/snippet/target/debug/incremental -L dependency=/build/snippet/target/debug/deps --extern itoa=/build/snippet/target/debug/deps/libitoa-327a92d5ddd56b4a.rlib --extern one=/build/snippet/target/debug/deps/libone-c2b76a52468c9a0b.rlib --extern snippet=/build/snippet/target/debug/deps/libsnippet-a5c6abeab1e38e11.rlib --extern two=/build/snippet/target/debug/deps/libtwo-904ea56f5613ae62.rlib`
    Finished dev [unoptimized + debuginfo] target(s) in 0.76s
```

Building that crate with my local cargo including this change produces:
```
luser@eye7:/build/snippet$ /build/cargo/target/debug/cargo build -vv
   Compiling one v0.1.0 (/build/snippet/one)
   Compiling two v0.1.0 (/build/snippet/two)
   Compiling itoa v0.3.4
     Running `rustc --crate-name build_script_build one/build.rs --color always --crate-type bin --emit=dep-info,link -C debuginfo=2 -C metadata=8e5ff38061b98562 -C extra-filename=-8e5ff38061b98562 --out-dir /build/snippet/target/debug/build/one-8e5ff38061b98562 -C incremental=/build/snippet/target/debug/incremental -L dependency=/build/snippet/target/debug/deps`
     Running `rustc --crate-name build_script_build two/build.rs --color always --crate-type bin --emit=dep-info,link -C debuginfo=2 -C metadata=fcd8c089040e6ff4 -C extra-filename=-fcd8c089040e6ff4 --out-dir /build/snippet/target/debug/build/two-fcd8c089040e6ff4 -C incremental=/build/snippet/target/debug/incremental -L dependency=/build/snippet/target/debug/deps`
     Running `rustc --crate-name itoa /home/luser/.cargo/registry/src/github.com-1ecc6299db9ec823/itoa-0.3.4/src/lib.rs --color always --crate-type lib --emit=dep-info,link -C debuginfo=2 -C metadata=327a92d5ddd56b4a -C extra-filename=-327a92d5ddd56b4a --out-dir /build/snippet/target/debug/deps -L dependency=/build/snippet/target/debug/deps --cap-lints warn`
     Running `/build/snippet/target/debug/build/one-8e5ff38061b98562/build-script-build`
     Running `/build/snippet/target/debug/build/two-fcd8c089040e6ff4/build-script-build`
[one-e779b28932bbd20b] Error 0
[one-e779b28932bbd20b] Output 0
[one-e779b28932bbd20b] Output 1
[one-e779b28932bbd20b] Error 1
[two-adc2191c38bf9afc] Error 0
[two-adc2191c38bf9afc] Output 0
[one-e779b28932bbd20b] Error 2
[one-e779b28932bbd20b] Output 2
[two-adc2191c38bf9afc] Error 1
[two-adc2191c38bf9afc] Output 1
[one-e779b28932bbd20b] Output 3
[one-e779b28932bbd20b] Error 3
[two-adc2191c38bf9afc] Error 2
[two-adc2191c38bf9afc] Output 2
[one-e779b28932bbd20b] Error 4
[one-e779b28932bbd20b] Output 4
[two-adc2191c38bf9afc] Error 3
[two-adc2191c38bf9afc] Output 3
[one-e779b28932bbd20b] Error 5
[one-e779b28932bbd20b] Output 5
[two-adc2191c38bf9afc] Error 4
[two-adc2191c38bf9afc] Output 4
[one-e779b28932bbd20b] Error 6
[one-e779b28932bbd20b] Output 6
[two-adc2191c38bf9afc] Error 5
[two-adc2191c38bf9afc] Output 5
[one-e779b28932bbd20b] Error 7
[one-e779b28932bbd20b] Output 7
[two-adc2191c38bf9afc] Error 6
[two-adc2191c38bf9afc] Output 6
[one-e779b28932bbd20b] Error 8
[one-e779b28932bbd20b] Output 8
[two-adc2191c38bf9afc] Error 7
[two-adc2191c38bf9afc] Output 7
[one-e779b28932bbd20b] Error 9
[one-e779b28932bbd20b] Output 9
[two-adc2191c38bf9afc] Output 8
[two-adc2191c38bf9afc] Error 8
     Running `rustc --crate-name one one/src/lib.rs --color always --crate-type lib --emit=dep-info,link -C debuginfo=2 -C metadata=c2b76a52468c9a0b -C extra-filename=-c2b76a52468c9a0b --out-dir /build/snippet/target/debug/deps -C incremental=/build/snippet/target/debug/incremental -L dependency=/build/snippet/target/debug/deps`
[two-adc2191c38bf9afc] Error 9
[two-adc2191c38bf9afc] Output 9
     Running `rustc --crate-name two two/src/lib.rs --color always --crate-type lib --emit=dep-info,link -C debuginfo=2 -C metadata=904ea56f5613ae62 -C extra-filename=-904ea56f5613ae62 --out-dir /build/snippet/target/debug/deps -C incremental=/build/snippet/target/debug/incremental -L dependency=/build/snippet/target/debug/deps`
   Compiling snippet v0.1.4-alpha.0 (/build/snippet)
     Running `rustc --crate-name snippet src/lib.rs --color always --crate-type lib --emit=dep-info,link -C debuginfo=2 -C metadata=a5c6abeab1e38e11 -C extra-filename=-a5c6abeab1e38e11 --out-dir /build/snippet/target/debug/deps -C incremental=/build/snippet/target/debug/incremental -L dependency=/build/snippet/target/debug/deps --extern itoa=/build/snippet/target/debug/deps/libitoa-327a92d5ddd56b4a.rlib --extern one=/build/snippet/target/debug/deps/libone-c2b76a52468c9a0b.rlib --extern two=/build/snippet/target/debug/deps/libtwo-904ea56f5613ae62.rlib`
     Running `rustc --crate-name snippet src/main.rs --color always --crate-type bin --emit=dep-info,link -C debuginfo=2 -C metadata=8b5a0b44264aa67c -C extra-filename=-8b5a0b44264aa67c --out-dir /build/snippet/target/debug/deps -C incremental=/build/snippet/target/debug/incremental -L dependency=/build/snippet/target/debug/deps --extern itoa=/build/snippet/target/debug/deps/libitoa-327a92d5ddd56b4a.rlib --extern one=/build/snippet/target/debug/deps/libone-c2b76a52468c9a0b.rlib --extern snippet=/build/snippet/target/debug/deps/libsnippet-a5c6abeab1e38e11.rlib --extern two=/build/snippet/target/debug/deps/libtwo-904ea56f5613ae62.rlib`
    Finished dev [unoptimized + debuginfo] target(s) in 0.90s
```
I used `invocation_name` here for no particular reason other than it was being used by the build plan code immediately above, but since that includes the fingerprint it might be nicer to use just `pkg_name`?

6 years agoRestore a line of test output that was accidentally deleted while rebasing
Ted Mielczarek [Thu, 18 Oct 2018 20:47:55 +0000 (16:47 -0400)]
Restore a line of test output that was accidentally deleted while rebasing

6 years agoAuto merge of #6181 - dwijnand:preserve-lockfile-top-comment, r=alexcrichton
bors [Thu, 18 Oct 2018 13:51:13 +0000 (13:51 +0000)]
Auto merge of #6181 - dwijnand:preserve-lockfile-top-comment, r=alexcrichton

Preserve lockfile top comment

Refs #6180

6 years agoPrefix build script output with crate name when running in extra verbose mode. Fixes...
Ted Mielczarek [Tue, 9 Oct 2018 20:30:13 +0000 (16:30 -0400)]
Prefix build script output with crate name when running in extra verbose mode. Fixes #6158.

cargo's extra verbose mode is useful for getting detailed information out of
builds in CI where it can be difficult to examine the build environment
after-the-fact. However, when multiple build scripts are running as part of a
build it's not always clear what output is from which build script. This patch
makes cargo prefix each line of build script output with the crate name and
version this case.

6 years agoExplain why top comments are preserved in Cargo.lock
Dale Wijnand [Thu, 18 Oct 2018 13:30:40 +0000 (14:30 +0100)]
Explain why top comments are preserved in Cargo.lock

6 years agoPreserve multiline top comments
Dale Wijnand [Thu, 18 Oct 2018 05:44:12 +0000 (06:44 +0100)]
Preserve multiline top comments

6 years agoAssert the lock files are byte-for-byte equal
Dale Wijnand [Thu, 18 Oct 2018 05:43:59 +0000 (06:43 +0100)]
Assert the lock files are byte-for-byte equal

6 years agoAuto merge of #6147 - dwijnand:issue-templates, r=JoshTriplett
bors [Wed, 17 Oct 2018 21:25:24 +0000 (21:25 +0000)]
Auto merge of #6147 - dwijnand:issue-templates, r=JoshTriplett

Introduce issue templates

I took GitHub's default "Bug report" and "Feature request" templates and modified them a bit to make them work with Cargo.  Happy to iterate more.  WDYT?

6 years agoLearn to use Project::read_file & String::insert
Dale Wijnand [Wed, 17 Oct 2018 20:49:35 +0000 (21:49 +0100)]
Learn to use Project::read_file & String::insert

6 years agoMore consistency in comment format
Dale Wijnand [Wed, 17 Oct 2018 20:38:26 +0000 (21:38 +0100)]
More consistency in comment format

6 years agoPreserve lockfile top comment
Dale Wijnand [Wed, 17 Oct 2018 20:29:51 +0000 (21:29 +0100)]
Preserve lockfile top comment

6 years agoAuto merge of #6175 - alexheretic:compile_package_errors, r=alexcrichton
bors [Wed, 17 Oct 2018 18:33:54 +0000 (18:33 +0000)]
Auto merge of #6175 - alexheretic:compile_package_errors, r=alexcrichton

Add PackageError wrappers for activation errors

Similarly to #6157 this wraps compile errors with `PackageId` info to allow lib users, in this case rls, to discern where something went wrong.

In particular if a dependency has a dodgy version or doesn't exist the error chain will now contain a <s>PackageError that provides the package id</s> `ResolveError` that provides the package path from error-parent -> root. From this I figure out if the error better relates to a workspace member, and target that manifest for diagnostics.

6 years agoMove ResolveError -> core/resolver/errors.rs
Alex Butler [Tue, 16 Oct 2018 14:42:15 +0000 (15:42 +0100)]
Move ResolveError -> core/resolver/errors.rs

Move activation_error, describe_path -> errors.rs

6 years agoAuto merge of #6176 - oli-obk:patch-1, r=alexcrichton
bors [Tue, 16 Oct 2018 14:08:50 +0000 (14:08 +0000)]
Auto merge of #6176 - oli-obk:patch-1, r=alexcrichton

Future proof an unstable test

statics (even extern ones) will get their type checked for a `Sized` bound in order to fix https://github.com/rust-lang/rust/issues/54410

6 years agolang items need feature gates
Oliver S̶c̶h̶n̶e̶i̶d̶e̶r Scherer [Tue, 16 Oct 2018 09:52:48 +0000 (11:52 +0200)]
lang items need feature gates

6 years agoAdd package_path to ResolveError
Alex Butler [Tue, 16 Oct 2018 07:56:31 +0000 (08:56 +0100)]
Add package_path to ResolveError

More useful than just the parent

6 years agoRename PackageError -> ResolveError
Alex Butler [Mon, 15 Oct 2018 23:42:14 +0000 (00:42 +0100)]
Rename PackageError -> ResolveError

Rename package_id() -> parent_package_id() for clarity

6 years agoFuture proof an unstable test
Oliver S̶c̶h̶n̶e̶i̶d̶e̶r Scherer [Mon, 15 Oct 2018 18:45:39 +0000 (20:45 +0200)]
Future proof an unstable test

statics (even extern ones) will get their type checked for a `Sized` bound in order to fix https://github.com/rust-lang/rust/issues/54410

6 years agoAdd PackageError wrappers for activation errors
Alex Butler [Mon, 15 Oct 2018 18:29:53 +0000 (19:29 +0100)]
Add PackageError wrappers for activation errors

6 years agoAuto merge of #6170 - ehuss:panic-in-unit, r=alexcrichton
bors [Mon, 15 Oct 2018 16:35:38 +0000 (16:35 +0000)]
Auto merge of #6170 - ehuss:panic-in-unit, r=alexcrichton

Track `panic` in Unit early.

This is an alternate solution for #5445. It ensures that `panic` is cleared in the Profile for "for_host" targets (proc-macro/plugin/build-scripts) and dependencies. This helps avoid unnecessary recompiles in some situations (though does add extra units in some situations, see below).

Some examples where extra rebuilds are now avoided:
* A workspace with a dependency shared with normal and build-deps.  `build --all` should build everything, and then `build -p foo` was causing a recompile because the shared dep was no longer in the `used_in_plugin` set. Now it should not recompile.
* `panic=abort`, with a shared dependency in build and dev, `build` would cause that shared dependency to be built twice (exactly the same without panic set). Now it should only build once.

Some examples where `panic` is now set correctly:
* `panic=abort`, with a binary with a shared dependency in build and normal, `test` would cause that shared dependency to be built twice (exactly the same without panic set).  Now it is still built twice, but the one for the normal (bin) dependency will correctly have `panic` set.

Some examples where new units are now generated:
* `panic=abort`, with shared dependency between normal and proc-macro or build. Previously the shared dependency was built once with `panic=unwind`. Now it is built separately (once with `panic`, once without). I feel like that this is more correct behavior â€” that now the normal dependency avoids adding landing pads.

   For `panic=abort` cross-compiling, this makes no difference in compile time since it was already built twice.

Additional notes:
- I left build-scripts with the old behavior where `panic` is cleared for it and all its dependencies. There could be arguments made to change that (#5436), but it doesn't seem important to me.
- Renamed and refactored `ProfileFor` to `UnitFor`. I expect this API to continue to evolve in the future.

Closes #6143, closes #6154.

6 years agoAuto merge of #6157 - alexheretic:member-manifest-error, r=alexcrichton
bors [Sat, 13 Oct 2018 01:28:51 +0000 (01:28 +0000)]
Auto merge of #6157 - alexheretic:member-manifest-error, r=alexcrichton

Expose manifest error chain in CargoErrors

Adds new `ManifestError`s to the `CargoError` causal chain. These errors pass on their display, but provide more detail on which manifests are at fault when failing to build a `Workspace`. This is useful for lib users, in particular rls, allowing lookup of a particular manifest file that caused the error. See #6144.

For example a workspace _foo_ where a member _bar_ has an invalid toml manifest would have the error chain:
- failed to parse manifest at `/home/alex/project/foo/bar/Cargo.toml`
  _ManifestError: /home/alex/project/foo/Cargo.toml_
- failed to parse manifest at `/home/alex/project/foo/bar/Cargo.toml`
  _ManifestError: /home/alex/project/foo/bar/Cargo.toml_
- failed to parse manifest at `/home/alex/project/foo/bar/Cargo.toml`
- could not parse input as TOML
- expected a value, found an equals at line 8

This will allow rls to point to a particular workspace member's manifest file when that manifest fails to deserialize, has invalid paths, etc.

This change should not affect binary use.

6 years agoAuto merge of #6171 - ehuss:metabuild-hash, r=alexcrichton
bors [Sat, 13 Oct 2018 00:09:32 +0000 (00:09 +0000)]
Auto merge of #6171 - ehuss:metabuild-hash, r=alexcrichton

Minor cleanup for metabuild hash

At the time I wrote this I was unaware of the util function that did the same
thing.

6 years agoMinor cleanup for metabuild hash
Eric Huss [Fri, 12 Oct 2018 22:19:16 +0000 (15:19 -0700)]
Minor cleanup for metabuild hash

At the time I wrote this I was unaware of the util function that did the same
thing.

6 years agoTrack `panic` in Unit early.
Eric Huss [Fri, 12 Oct 2018 19:55:31 +0000 (12:55 -0700)]
Track `panic` in Unit early.

6 years agoWrap initial ManifestError in toml module
Alex Butler [Fri, 12 Oct 2018 19:54:29 +0000 (20:54 +0100)]
Wrap initial ManifestError in toml module

Filter out ManifestErrors when generating error output

6 years agoWrap all, including io, manifest errors
Alex Butler [Tue, 9 Oct 2018 20:44:32 +0000 (21:44 +0100)]
Wrap all, including io, manifest errors

6 years agoExpose manifest error chain
Alex Butler [Tue, 9 Oct 2018 13:05:10 +0000 (14:05 +0100)]
Expose manifest error chain

6 years agoAuto merge of #6096 - mathstuf:export-repository-info, r=alexcrichton
bors [Fri, 12 Oct 2018 17:32:25 +0000 (17:32 +0000)]
Auto merge of #6096 - mathstuf:export-repository-info, r=alexcrichton

build: export repository information

The repository string is made available via the `CARGO_PKG_REPOSITORY`
environment variable similar to other metadata.

6 years agoAuto merge of #6167 - ehuss:fix-dylib-feature-flip, r=alexcrichton
bors [Fri, 12 Oct 2018 03:53:43 +0000 (03:53 +0000)]
Auto merge of #6167 - ehuss:fix-dylib-feature-flip, r=alexcrichton

Fix dylib reuse with uplift.

Due to #5460, the files that are copied to the root of the target dir depend on whether or not it is a direct target. This causes a problem with dylibs if you build a dylib directly, and then separately run a target that depends on that dylib.  It will run with the dylib path preferring the root dir, which picks up the old dylib.  This PR swaps the preference of the dylib search path so that the dylib in the `deps` dir is preferred.

This is maybe not the best solution for dynamic dependencies. I can imagine if you are trying to create a package, you'll want all of the shared libs along with the binary, and digging through the `deps` dir is not optimal.  However, unconditionally linking dependencies into the root has issues (which #5460 fixed).  There are other issues because shared libs do not include a hash in the filename.  A grander solution might involve coming up with a better strategy for organizing the `target` directory to avoid conflicts between targets.

Fixes #6162

6 years agoFix dylib reuse with uplift.
Eric Huss [Fri, 12 Oct 2018 02:42:32 +0000 (19:42 -0700)]
Fix dylib reuse with uplift.

6 years agoAuto merge of #6166 - alexcrichton:debug-curl, r=ehuss
bors [Fri, 12 Oct 2018 01:43:10 +0000 (01:43 +0000)]
Auto merge of #6166 - alexcrichton:debug-curl, r=ehuss

Add convenience debugging for HTTP requests in Cargo

This is something we probably should have added long long ago given the
number of network issues that arise over time. This adds a new
configuration setting for Cargo, `http.debug`, which activates curl's
`verbose` interface which prints out information like redirects and
headers flying back and forth. This is by default routed through Cargo's
normal debug logging facilities, meaning one way to use this could be:

    CARGO_HTTP_DEBUG=true \
      RUST_LOG=cargo::ops::registry \
      cargo build

and you should get lots of nice verbose logs as a result! This should
hopefully make it much easier to remotely debug HTTP issues as we can in
theory do a lot less guessing and a lot more manual inspection.

6 years agoAdd convenience debugging for HTTP requests in Cargo
Alex Crichton [Thu, 11 Oct 2018 21:12:03 +0000 (14:12 -0700)]
Add convenience debugging for HTTP requests in Cargo

This is something we probably should have added long long ago given the
number of network issues that arise over time. This adds a new
configuration setting for Cargo, `http.debug`, which activates curl's
`verbose` interface which prints out information like redirects and
headers flying back and forth. This is by default routed through Cargo's
normal debug logging facilities, meaning one way to use this could be:

    CARGO_HTTP_DEBUG=true \
      RUST_LOG=cargo::ops::registry \
      cargo build

and you should get lots of nice verbose logs as a result! This should
hopefully make it much easier to remotely debug HTTP issues as we can in
theory do a lot less guessing and a lot more manual inspection.

6 years agoAuto merge of #6165 - Eh2406:cleanup, r=alexcrichton
bors [Thu, 11 Oct 2018 20:52:12 +0000 (20:52 +0000)]
Auto merge of #6165 - Eh2406:cleanup, r=alexcrichton

small cleanups to registry tests

This should make the slow proptest tests approximately 10x faster. It also adds a test ensuring that we make fuzz inputs that involve multiple versions of the same library.

6 years agofaster test by unpublishing all at once
Eh2406 [Thu, 11 Oct 2018 19:31:10 +0000 (15:31 -0400)]
faster test by unpublishing all at once

6 years agoTest that the generator makes registries that include multiple versions of the same...
Eh2406 [Thu, 11 Oct 2018 17:56:17 +0000 (13:56 -0400)]
Test that the generator makes registries that include multiple versions of the same library

6 years agoassert_contains -> assert_same
Eh2406 [Mon, 8 Oct 2018 17:06:34 +0000 (13:06 -0400)]
assert_contains -> assert_same

6 years agoTrim back to just cargo version
Dale Wijnand [Thu, 11 Oct 2018 07:49:45 +0000 (08:49 +0100)]
Trim back to just cargo version

6 years agoSteer the feature request author to describe the underlying problem first
Dale Wijnand [Thu, 11 Oct 2018 07:16:27 +0000 (08:16 +0100)]
Steer the feature request author to describe the underlying problem first

6 years agoProblem before Steps
Dale Wijnand [Thu, 11 Oct 2018 07:14:39 +0000 (08:14 +0100)]
Problem before Steps

6 years agoDon't explain issue titles to people
Dale Wijnand [Thu, 11 Oct 2018 07:14:19 +0000 (08:14 +0100)]
Don't explain issue titles to people

6 years agoTrim back the issue templates.
Dale Wijnand [Wed, 10 Oct 2018 21:07:05 +0000 (22:07 +0100)]
Trim back the issue templates.

6 years agoJust drop the part about duplicate issues
Dale Wijnand [Wed, 10 Oct 2018 20:56:16 +0000 (21:56 +0100)]
Just drop the part about duplicate issues

GitHub does a prompt thing on the right based on issue description, so
perhaps that's good enough.  This way we avoid sounding too aggressive.

6 years agoAdapt the issue templates
Dale Wijnand [Wed, 10 Oct 2018 08:26:31 +0000 (09:26 +0100)]
Adapt the issue templates

Adapt to feedback comments, and steal (heavily) from the templates in rust-clique/human-panic.

6 years agoAuto merge of #6135 - cswindle:default-registry, r=alexcrichton
bors [Mon, 8 Oct 2018 16:52:23 +0000 (16:52 +0000)]
Auto merge of #6135 - cswindle:default-registry, r=alexcrichton

Add support for a default registry for cargo commands

This adds two things:
  - --registry support for new and init
 - adds default registry configuration to cargo

The main reason for these changes is to reduce the risk of closed-source software ending up accidentally on crates.io.

This fixes #6123.

6 years agoAuto merge of #6149 - Eh2406:proptest, r=alexcrichton
bors [Mon, 8 Oct 2018 15:58:57 +0000 (15:58 +0000)]
Auto merge of #6149 - Eh2406:proptest, r=alexcrichton

proptest basic validation

This adds a function for testing that the output of the resolver is basically reasonable. This function has the same signature as the function for running the resolver in a test. So it is easy to switch back and forth, depending on the thoroughness vs speed tradeoff. This also adds a proptest/fuzz that runs this validation against arbitrary registry.

cc #6120
Sorry about the cargo fmt.

6 years agoSwitch to use crates-io as the registry name and don't include publish when registry...
Christopher Swindle [Mon, 8 Oct 2018 06:28:37 +0000 (07:28 +0100)]
Switch to use crates-io as the registry name and don't include publish when registry is not specified

6 years agofix redundant pkgid generation
Eh2406 [Sat, 6 Oct 2018 22:55:39 +0000 (18:55 -0400)]
fix redundant pkgid generation

6 years agovalidate some basic properties of a valid resolve
Eh2406 [Sat, 6 Oct 2018 22:07:36 +0000 (18:07 -0400)]
validate some basic properties of a valid resolve

6 years agoAuto merge of #6141 - dwijnand:detail-dep-name-in-invalid-version-error, r=alexcrichton
bors [Sat, 6 Oct 2018 17:28:40 +0000 (17:28 +0000)]
Auto merge of #6141 - dwijnand:detail-dep-name-in-invalid-version-error, r=alexcrichton

Detail dep name in invalid version error

Fixes #2146

I struggled with some aspects of Rust's pattern matching syntax & the borrow-checker, as well as the types and API of failure, so... this is the "I got it to compile" version-I'd love tips/advice to clean it up. (soft-cc @withoutboats?).

6 years agoMake issue templates work for Cargo
Dale Wijnand [Sat, 6 Oct 2018 16:55:03 +0000 (17:55 +0100)]
Make issue templates work for Cargo

6 years agoIntroduce issue templates
Dale Wijnand [Sat, 6 Oct 2018 16:44:48 +0000 (17:44 +0100)]
Introduce issue templates

These are GitHub's default "Bug report" and "Feature request" template.  We can modify them as we deem appropriate.

6 years agoDetail dep name in invalid version error
Dale Wijnand [Sat, 6 Oct 2018 10:15:41 +0000 (11:15 +0100)]
Detail dep name in invalid version error

6 years agoAuto merge of #6140 - ehuss:fix-dash-rename, r=alexcrichton
bors [Fri, 5 Oct 2018 22:15:20 +0000 (22:15 +0000)]
Auto merge of #6140 - ehuss:fix-dash-rename, r=alexcrichton

Fix dashes in rename dependencies.

Fixes #6138

6 years agoFix dashes in rename dependencies.
Eric Huss [Fri, 5 Oct 2018 21:05:24 +0000 (14:05 -0700)]
Fix dashes in rename dependencies.

6 years agoAuto merge of #6132 - Xanewok:bump-libgit2-sys, r=Eh2406
bors [Fri, 5 Oct 2018 14:58:07 +0000 (14:58 +0000)]
Auto merge of #6132 - Xanewok:bump-libgit2-sys, r=Eh2406

Bump libgit2-sys to 0.7.9

For some reason I couldn't compile with newest nightly `rustc 1.31.0-nightly (5597ee8a6 2018-10-03)`:
```
error: failed to run custom build command for `libgit2-sys v0.7.7`
process didn't exit successfully: `/home/xanewok/repos/cargo/target/debug/build/libgit2-sys-f38ab3eb27549370/build-script-build` (exit code: 101)
--- stdout
running: "cmake" "/home/xanewok/.cargo/registry/src/github.com-1ecc6299db9ec823/libgit2-sys-0.7.7/libgit2" "-DGIT_SSH_MEMORY_CREDENTIALS=1" "-DBUILD_SHARED_LIBS=OFF" "-DBUILD_CLAR=OFF" "-DCMAKE_INSTALL_PREFIX=/home/xanewok/repos/cargo/target/debug/build/libgit2-sys-e96505b09ca81ecd/out" "-DCMAKE_C_FLAGS= -ffunction-sections -fdata-sections -fPIC -m64" "-DCMAKE_C_COMPILER=/usr/bin/cc" "-DCMAKE_CXX_FLAGS= -ffunction-sections -fdata-sections -fPIC -m64" "-DCMAKE_CXX_COMPILER=/usr/bin/c++" "-DCMAKE_BUILD_TYPE=Debug"
-- The C compiler identification is GNU 7.3.0
-- Check for working C compiler: /usr/bin/cc
-- Check for working C compiler: /usr/bin/cc -- works
-- Detecting C compiler ABI info
-- Detecting C compiler ABI info - done
-- Detecting C compile features
-- Detecting C compile features - done
-- Found PkgConfig: /usr/bin/pkg-config (found version "0.29.1")
-- Looking for pthread.h
-- Looking for pthread.h - found
-- Looking for pthread_create
-- Looking for pthread_create - not found
-- Looking for pthread_create in pthreads
-- Looking for pthread_create in pthreads - not found
-- Looking for pthread_create in pthread
-- Looking for pthread_create in pthread - found
-- Found Threads: TRUE
-- Performing Test HAVE_STRUCT_STAT_ST_MTIM
-- Performing Test HAVE_STRUCT_STAT_ST_MTIM - Success
-- Performing Test HAVE_STRUCT_STAT_ST_MTIMESPEC
-- Performing Test HAVE_STRUCT_STAT_ST_MTIMESPEC - Failed
-- Performing Test HAVE_STRUCT_STAT_MTIME_NSEC
-- Performing Test HAVE_STRUCT_STAT_MTIME_NSEC - Failed
-- Performing Test HAVE_STRUCT_STAT_NSEC
-- Performing Test HAVE_STRUCT_STAT_NSEC - Success
-- Performing Test IS_WALL_SUPPORTED
-- Performing Test IS_WALL_SUPPORTED - Success
-- Performing Test IS_WEXTRA_SUPPORTED
-- Performing Test IS_WEXTRA_SUPPORTED - Success
-- Performing Test IS_WDOCUMENTATION_SUPPORTED
-- Performing Test IS_WDOCUMENTATION_SUPPORTED - Failed
-- Performing Test IS_WNO-MISSING-FIELD-INITIALIZERS_SUPPORTED
-- Performing Test IS_WNO-MISSING-FIELD-INITIALIZERS_SUPPORTED - Success
-- Performing Test IS_WSTRICT-ALIASING_SUPPORTED
-- Performing Test IS_WSTRICT-ALIASING_SUPPORTED - Success
-- Performing Test IS_WSTRICT-PROTOTYPES_SUPPORTED
-- Performing Test IS_WSTRICT-PROTOTYPES_SUPPORTED - Success
-- Performing Test IS_WDECLARATION-AFTER-STATEMENT_SUPPORTED
-- Performing Test IS_WDECLARATION-AFTER-STATEMENT_SUPPORTED - Success
-- Performing Test IS_WSHIFT-COUNT-OVERFLOW_SUPPORTED
-- Performing Test IS_WSHIFT-COUNT-OVERFLOW_SUPPORTED - Success
-- Performing Test IS_WNO-UNUSED-CONST-VARIABLE_SUPPORTED
-- Performing Test IS_WNO-UNUSED-CONST-VARIABLE_SUPPORTED - Success
-- Performing Test IS_WNO-UNUSED-FUNCTION_SUPPORTED
-- Performing Test IS_WNO-UNUSED-FUNCTION_SUPPORTED - Success
-- Looking for regcomp_l
-- Looking for regcomp_l - not found
-- Looking for futimens
-- Looking for futimens - found
-- Looking for qsort_r
-- Looking for qsort_r - found
-- Looking for qsort_s
-- Looking for qsort_s - not found
-- Looking for clock_gettime in rt
-- Looking for clock_gettime in rt - found
-- Checking for module 'libcurl'
--   Found libcurl, version 7.61.1
-- Configuring incomplete, errors occurred!
See also "/home/xanewok/repos/cargo/target/debug/build/libgit2-sys-e96505b09ca81ecd/out/build/CMakeFiles/CMakeOutput.log".
See also "/home/xanewok/repos/cargo/target/debug/build/libgit2-sys-e96505b09ca81ecd/out/build/CMakeFiles/CMakeError.log".
--- stderr
fatal: not a git repository (or any of the parent directories): .git
CMake Error at cmake/Modules/FindPkgLibraries.cmake:17 (MESSAGE):
  could not resolve curl
Call Stack (most recent call first):
  src/CMakeLists.txt:120 (FIND_PKGLIBRARIES)
thread 'main' panicked at '
command did not execute successfully, got: exit code: 1
build script failed, must exit now', /home/xanewok/.cargo/registry/src/github.com-1ecc6299db9ec823/cmake-0.1.29/src/lib.rs:632:5
note: Run with `RUST_BACKTRACE=1` for a backtrace.
```
on Xubuntu 18.04.1.

Simply bumping `libgit2-sys` seemed to have fixed the problem, so... :man_shrugging:

r? @alexcrichton

6 years agoBump flate2 to 1.0.3
Igor Matuszewski [Fri, 5 Oct 2018 10:48:04 +0000 (12:48 +0200)]
Bump flate2 to 1.0.3

6 years agoAdd default in config document
Christopher Swindle [Fri, 5 Oct 2018 06:01:34 +0000 (07:01 +0100)]
Add default in config document

6 years agoAdd support for providing a default registry
Christopher Swindle [Fri, 5 Oct 2018 05:58:56 +0000 (06:58 +0100)]
Add support for providing a default registry

6 years agoAdd support for registry to new and init
Christopher Swindle [Fri, 5 Oct 2018 05:11:51 +0000 (06:11 +0100)]
Add support for registry to new and init

6 years agoAuto merge of #6134 - Eh2406:dead-code, r=alexcrichton
bors [Fri, 5 Oct 2018 03:49:06 +0000 (03:49 +0000)]
Auto merge of #6134 - Eh2406:dead-code, r=alexcrichton

remove dead code, use impl Iterator instead of custom types, cargo fmt

This is a mishmash of things. `Graph::sort` was unused so I removed it. There are a bunch of custom types that allow us to return iterators that can now be replaced with `impl Iterator`. jetbrains wanted to reorder some impls to match the definition. fmt also made some changes to the files I opened.

6 years agouse impl Iterator instead of custom types in `source`
Eh2406 [Fri, 5 Oct 2018 02:07:45 +0000 (22:07 -0400)]
use impl Iterator instead of custom types in `source`

6 years agolet jetbrains reorder some impls to match the definition
Eh2406 [Fri, 5 Oct 2018 02:00:01 +0000 (22:00 -0400)]
let jetbrains reorder some impls to match the definition

6 years agouse impl Iterator instead of custom types in resolver and graph
Eh2406 [Fri, 5 Oct 2018 01:49:30 +0000 (21:49 -0400)]
use impl Iterator instead of custom types in resolver and graph

6 years agoremove Graph::sort as it is unused
Eh2406 [Fri, 5 Oct 2018 00:44:30 +0000 (20:44 -0400)]
remove Graph::sort as it is unused

6 years agofmt
Eh2406 [Fri, 5 Oct 2018 00:09:17 +0000 (20:09 -0400)]
fmt

6 years agoBump libgit2-sys to 0.7.9
Igor Matuszewski [Thu, 4 Oct 2018 15:14:38 +0000 (17:14 +0200)]
Bump libgit2-sys to 0.7.9

6 years agoAuto merge of #6128 - cswindle:install-registry, r=alexcrichton
bors [Thu, 4 Oct 2018 07:13:57 +0000 (07:13 +0000)]
Auto merge of #6128 - cswindle:install-registry, r=alexcrichton

Allow registry option for cargo install

This allows installing rust crates directly from cargo install by passing --registry to the command.

6 years agoSwitch to use registry
Christopher Swindle [Thu, 4 Oct 2018 07:08:30 +0000 (08:08 +0100)]
Switch to use registry

6 years agoAllow registry option for cargo install.
Christopher Swindle [Wed, 3 Oct 2018 18:33:43 +0000 (19:33 +0100)]
Allow registry option for cargo install.

6 years agoAuto merge of #6112 - alexcrichton:better-errors, r=Eh2406
bors [Wed, 3 Oct 2018 02:54:55 +0000 (02:54 +0000)]
Auto merge of #6112 - alexcrichton:better-errors, r=Eh2406

Try to improve "version not found" error

This commit tweaks the wording for when versions aren't found in a
source, notably including more location information other than the
source id but rather also taking into account replaced sources and such.
It's hoped that this gives more information to make it a bit more clear
what's going on.

Closes #6111

6 years agoAuto merge of #6122 - ehuss:msys-width, r=alexcrichton
bors [Wed, 3 Oct 2018 02:11:37 +0000 (02:11 +0000)]
Auto merge of #6122 - ehuss:msys-width, r=alexcrichton

Second attempt at fixing msys terminal width.

Lock the max width on msys-based terminals to 60. I tried a lot of different
things, but I was unable to find a way to detect the correct width in mintty.
Unfortunately this means that terminals that work correctly like ConEmu will
also be capped at 60. C'est la vie.

Of course this does not affect cmd, powershell, etc.

Fixes #6108