bors [Wed, 2 Jan 2019 17:59:46 +0000 (17:59 +0000)]
Auto merge of #6493 - ehuss:fix-fingerprint-patch, r=alexcrichton
Fix fingerprint calculation for patched deps.
If you have A→B→C where B and C are in a registry, and you `[patch]` C, the fingerprint calculation wasn't working correctly when C changes. The following sequence illustrates the problem:
1. Do a build from scratch.
2. Touch a file in C.
3. Build again. Everything rebuilds as expected.
4. Build again. You would expect this to be all fresh, but it rebuilds A.
The problem is the hash-busting doesn't propagate up to parents from dependencies. Normal targets normally aren't a problem because they have a `LocalFingerprint::MtimeBased` style local value which always recomputes the hash. However, registry dependencies have a `Precalculated` style local value which never recomputes the hash.
The solution here is to always recompute the hash. This shouldn't be too expensive, and is only done when writing the fingerprint, which should only happen when the target is dirty. I'm not entirely certain why the caching logic was added in #4125.
bors [Mon, 31 Dec 2018 16:11:46 +0000 (16:11 +0000)]
Auto merge of #6501 - vishallama:vishallama-doc-update-cargo.toml, r=dwijnand
Update display of contents of Cargo.toml
When creating a (binary) program/crate using 'cargo new', with the new 2018 version of Rust the autogenerated Cargo.toml file contains a couple of additional lines. These lines have to do with edition and dependencies.
Vishal Lama [Mon, 31 Dec 2018 07:22:02 +0000 (00:22 -0700)]
Update display of contents of Cargo.toml
When creating a (binary) program using 'cargo new', with the new 2018 version of Rust the autogenerated Cargo.toml file contains a couple of additional lines. These lines have to do with edition and dependencies.
bors [Sat, 29 Dec 2018 08:58:42 +0000 (08:58 +0000)]
Auto merge of #6497 - ehuss:test-require-output-check, r=dwijnand
testsuite: Require failing commands to check output.
This requires that commands that expect an error (using `with_status()`) also check some part of the output, to ensure that the test is working correctly. As evidence by the few tests fixed here, it is dangerous to assume that the correct error will trigger.
Some of these check rustc error messages which is generally undesirable since they aren't always stable, but I think in the few cases they shouldn't be much of a problem. If that seems too risky, I can make them more generic.
bors [Fri, 28 Dec 2018 17:38:04 +0000 (17:38 +0000)]
Auto merge of #6494 - ehuss:fix-unused-patch-warning, r=dwijnand
Fix new unused patch warning.
The unused `[patch]` warning added in #6470 was misfiring if you build only a subset of a workspace that doesn't include the patch.
I'm about 80% confident this new logic is correct. It addresses the scenario I discovered, and I tested a bunch of commands (generate-lockfile, update, etc.) to make sure they all work. However, the many ways that `resolve_with_previous` is called is tricky to ensure every scenario works correctly.
use DYLD_FALLBACK_LIBRARY_PATH for dylib_path_envvar on macOS
When loading and linking a dynamic library or bundle, dlopen
searches in LD_LIBRARY_PATH, DYLD_LIBRARY_PATH, PWD, and
DYLD_FALLBACK_LIBRARY_PATH.
In the Mach-O format, a dynamic library has an "install path."
Clients linking against the library record this path, and the
dynamic linker, dyld, uses it to locate the library.
dyld searches DYLD_LIBRARY_PATH *before* the install path.
dyld searches DYLD_FALLBACK_LIBRARY_PATH only if it cannot
find the library in the install path.
Setting DYLD_LIBRARY_PATH can easily have unintended
consequences.
See https://users.rust-lang.org/t/subprocess-and-dynamic-library-linking-problem-interaction/7873/10
See https://trac.macports.org/ticket/57692
bors [Sat, 22 Dec 2018 21:49:21 +0000 (21:49 +0000)]
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.
bors [Fri, 21 Dec 2018 20:07:17 +0000 (20:07 +0000)]
Auto merge of #6473 - Eh2406:rustc-0, r=alexcrichton
don't write a an incorrect rustc version to the fingerprint file
In making https://github.com/holmgr/cargo-sweep/pull/14 I noted that some fingerprint files related to build scripts report being built with a rustc that hashes to "0". To work around this I just marked them as still being needed, even though no rustc that hashes to "0" is currently installed.
I believe that this PR just filles in the correct info for the build script fingerprints. This makes it possible for outside tools to more reliably clean up after cargo, at basically no cost.
@ehuss Thanks again for the help.
bors [Thu, 20 Dec 2018 15:40:49 +0000 (15:40 +0000)]
Auto merge of #6466 - ehuss:registry-cleanup, r=alexcrichton
Rewrite `login` and registry cleanups.
- Login:
- Change `login` so that it reads the API host from the registry config so it knows the `{api}/me` URL to display.
- The `--host` flag is deprecated/unused. It wasn't used for much before.
- `--registry` supports interactive entry of the token (does not require it on the command line).
- Displays a message after saving the token (fixes #5868).
- Because `login` now requires an index, some of the tests had to be updated.
- Fix so that if `api` is missing from the config, it will display a nice error message instead of panicking with unwrap.
bors [Tue, 18 Dec 2018 20:40:52 +0000 (20:40 +0000)]
Auto merge of #6459 - ehuss:fix-man-checks, r=alexcrichton
Fix new man page links.
The rustc link checker found some problems:
- The raw generated HTML files were being included when they shouldn't.
Fixed by moving them out of the mdbook directory.
- The `print.html` file concatenates all the pages together, causing duplicate
`id`'s. Fix by giving each page a unique set of IDs.
Eric Huss [Tue, 18 Dec 2018 20:06:58 +0000 (12:06 -0800)]
Fix new man page links.
The rustc link checker found some problems:
- The raw generated HTML files were being included when they shouldn't.
Fixed by moving them out of the mdbook directory.
- The `print.html` file concatenates all the pages together, causing duplicate
`id`'s. Fix by giving each page a unique set of IDs.
bors [Tue, 18 Dec 2018 15:49:51 +0000 (15:49 +0000)]
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.
Eric Huss [Thu, 13 Dec 2018 20:37:25 +0000 (12:37 -0800)]
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.
bors [Mon, 17 Dec 2018 23:53:39 +0000 (23:53 +0000)]
Auto merge of #6455 - wezm:patch-1, r=dwijnand
Update the rustup URL
Yesterday at the Melbourne Rust meetup I helped someone install Rust on their Mac. They were following the instructions from the cargo book and I was surprised to see `rustup` and all the tools being installed globally in `/usr/local/bin`. Eventually we worked out that the URL in the cargo book was different from the one on the Rust website and on rustup.rs. After using the other URL the install proceeded as expected, installing into the user's home directory. It appears the old link is an old version of rustup/rust-init.
This PR updates the install command to match the Rust home page.
bors [Mon, 17 Dec 2018 18:13:06 +0000 (18:13 +0000)]
Auto merge of #6405 - ehuss:new-man, r=alexcrichton
New man pages.
This is a rewrite and update of the man pages. This also adds them to the website documentation. They are now in Asciidoc format to make it easy to output multiple formats and have decent formatting. There is a Makefile with instructions on how to rebuild the man pages.
bors [Mon, 17 Dec 2018 17:13:53 +0000 (17:13 +0000)]
Auto merge of #6451 - dwijnand:reify-DepFingerprint, r=alexcrichton
Reify the DepFingerprint type
I'm very slightly concerned I might've incompatibly changed the serialise/deserialise code with respect to existing serialised data, so please double-check my work.
bors [Mon, 17 Dec 2018 15:42:58 +0000 (15:42 +0000)]
Auto merge of #6448 - dwijnand:upgrade-the-metabuild-to-rust-2018, r=ehuss
Upgrade the metabuild to Rust 2018
Just happened across the code that @ehuss mentioned in https://github.com/rust-lang/cargo/pull/6423#issuecomment-446807216 and thought of reviving that effort.
@ehuss says there's no reason to. Let's see if it passes CI and we should land this change or not.
bors [Mon, 17 Dec 2018 03:28:16 +0000 (03:28 +0000)]
Auto merge of #6447 - ehuss:doc-name-authors, r=alexcrichton
Document `name` and `authors` in [package]
I don't think we need to take a principled stand on the exact meaning of
"authors", so I left it somewhat vague. Also, it was made optional in #3682 so
the existing docs were a little wrong.
bors [Fri, 14 Dec 2018 16:56:14 +0000 (16:56 +0000)]
Auto merge of #6439 - rust-lang:dependabot/cargo/git2-curl-0.9.0, r=alexcrichton
Update git2-curl requirement from 0.8.1 to 0.9.0
Updates the requirements on [git2-curl](https://github.com/alexcrichton/git2-rs) to permit the latest version.
<details>
<summary>Commits</summary>
- See full diff in [compare view](https://github.com/alexcrichton/git2-rs/commits)
</details>
<br />
Dependabot will resolve any conflicts with this PR as long as you don't alter it yourself. You can also trigger a rebase manually by commenting `@dependabot rebase`.
<details>
<summary>Dependabot commands and options</summary>
<br />
You can trigger Dependabot actions by commenting on this PR:
- `@dependabot rebase` will rebase this PR
- `@dependabot recreate` will recreate this PR, overwriting any edits that have been made to it
- `@dependabot merge` will merge this PR after your CI passes on it
- `@dependabot cancel merge` will cancel a previously requested merge
- `@dependabot reopen` will reopen this PR if it is closed
- `@dependabot ignore this [patch|minor|major] version` will close this PR and stop Dependabot creating any more for this minor/major version (unless you reopen the PR or upgrade to it yourself)
- `@dependabot ignore this dependency` will close this PR and stop Dependabot creating any more for this dependency (unless you reopen the PR or upgrade to it yourself)
- `@dependabot use these labels` will set the current labels as the default for future PRs for this repo and language
- `@dependabot use these reviewers` will set the current reviewers as the default for future PRs for this repo and language
- `@dependabot use these assignees` will set the current assignees as the default for future PRs for this repo and language
- `@dependabot use this milestone` will set the current milestone as the default for future PRs for this repo and language
- `@dependabot badge me` will comment on this PR with code to add a "Dependabot enabled" badge to your readme
Additionally, you can set the following in your Dependabot [dashboard](https://app.dependabot.com):
- Update frequency (including time of day and day of week)
- Automerge options (never/patch/minor, and dev/runtime dependencies)
- Pull request limits (per update run and/or open at any time)
- Out-of-range updates (receive only lockfile updates, if desired)
- Security updates (receive only security updates, if desired)
Finally, you can contact us by mentioning @dependabot.
dependabot[bot] [Fri, 14 Dec 2018 16:30:00 +0000 (16:30 +0000)]
Update git2-curl requirement from 0.8.1 to 0.9.0
Updates the requirements on [git2-curl](https://github.com/alexcrichton/git2-rs) to permit the latest version.
- [Release notes](https://github.com/alexcrichton/git2-rs/releases)
- [Commits](https://github.com/alexcrichton/git2-rs/commits)
bors [Fri, 14 Dec 2018 15:50:31 +0000 (15:50 +0000)]
Auto merge of #6438 - rust-lang:dependabot/cargo/git2-0.8.0, r=alexcrichton
Update git2 requirement from 0.7.5 to 0.8.0
Updates the requirements on [git2](https://github.com/alexcrichton/git2-rs) to permit the latest version.
<details>
<summary>Commits</summary>
- See full diff in [compare view](https://github.com/alexcrichton/git2-rs/commits/git2-curl-0.8.0)
</details>
<br />
Dependabot will resolve any conflicts with this PR as long as you don't alter it yourself. You can also trigger a rebase manually by commenting `@dependabot rebase`.
<details>
<summary>Dependabot commands and options</summary>
<br />
You can trigger Dependabot actions by commenting on this PR:
- `@dependabot rebase` will rebase this PR
- `@dependabot recreate` will recreate this PR, overwriting any edits that have been made to it
- `@dependabot merge` will merge this PR after your CI passes on it
- `@dependabot cancel merge` will cancel a previously requested merge
- `@dependabot reopen` will reopen this PR if it is closed
- `@dependabot ignore this [patch|minor|major] version` will close this PR and stop Dependabot creating any more for this minor/major version (unless you reopen the PR or upgrade to it yourself)
- `@dependabot ignore this dependency` will close this PR and stop Dependabot creating any more for this dependency (unless you reopen the PR or upgrade to it yourself)
- `@dependabot use these labels` will set the current labels as the default for future PRs for this repo and language
- `@dependabot use these reviewers` will set the current reviewers as the default for future PRs for this repo and language
- `@dependabot use these assignees` will set the current assignees as the default for future PRs for this repo and language
- `@dependabot use this milestone` will set the current milestone as the default for future PRs for this repo and language
- `@dependabot badge me` will comment on this PR with code to add a "Dependabot enabled" badge to your readme
Additionally, you can set the following in your Dependabot [dashboard](https://app.dependabot.com):
- Update frequency (including time of day and day of week)
- Automerge options (never/patch/minor, and dev/runtime dependencies)
- Pull request limits (per update run and/or open at any time)
- Out-of-range updates (receive only lockfile updates, if desired)
- Security updates (receive only security updates, if desired)
Finally, you can contact us by mentioning @dependabot.
dependabot[bot] [Fri, 14 Dec 2018 05:51:03 +0000 (05:51 +0000)]
Update git2 requirement from 0.7.5 to 0.8.0
Updates the requirements on [git2](https://github.com/alexcrichton/git2-rs) to permit the latest version.
- [Release notes](https://github.com/alexcrichton/git2-rs/releases)
- [Commits](https://github.com/alexcrichton/git2-rs/commits/git2-curl-0.8.0)
bors [Fri, 14 Dec 2018 00:11:15 +0000 (00:11 +0000)]
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.
bors [Thu, 13 Dec 2018 23:31:39 +0000 (23:31 +0000)]
Auto merge of #6434 - ehuss:fix-fix-concurrent, r=dwijnand
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.
Eric Huss [Thu, 13 Dec 2018 22:29:26 +0000 (14:29 -0800)]
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.
Eric Huss [Wed, 12 Dec 2018 00:24:20 +0000 (16:24 -0800)]
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.
bors [Thu, 13 Dec 2018 20:12:04 +0000 (20:12 +0000)]
Auto merge of #6431 - ehuss:panic-in-panic, r=nrc
Fix panic-in-panic in tests.
There are some very rare circumstances that can cause a double panic during
development. For example, `.with_json("")` (or any invalid JSON) will panic, and then the drop
will also panic. This can cause a confusing SIGILL.
Eric Huss [Thu, 13 Dec 2018 19:55:38 +0000 (11:55 -0800)]
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.
bors [Thu, 13 Dec 2018 01:10:43 +0000 (01:10 +0000)]
Auto merge of #6426 - dwijnand:allow-testsuite-warnings-in-dev, r=nrc
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.
Dale Wijnand [Thu, 13 Dec 2018 01:00:27 +0000 (01:00 +0000)]
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.