9878 Commits

Author SHA1 Message Date
Camelid
82c834cec2 Update tests 2020-09-07 10:57:00 -07:00
Camelid
a9424d978a
Remove periods from error messages 2020-08-26 19:51:53 -07:00
Camelid
8e7c0ab8d8
Lowercase docs error message for consistency 2020-08-26 18:51:36 -07:00
bors
888ae7266a Auto merge of #8648 - Fogapod:rustc-args, r=ehuss
Add spaces after -C and -Z flags for consistency

Most other options have a space after flag name.
This commit makes verbose output of rustc invocations a little bit cleaner.
2020-08-26 21:38:52 +00:00
bors
1d66f90d8e Auto merge of #8653 - ehuss:fix-cache-messages-rustdoc-test, r=alexcrichton
Fix cache_messages::rustdoc test broken on beta.

The most recent beta `rustc 1.47.0-beta.1` broke this test (https://github.com/rust-lang/rust/issues/75951).  Just switch to a different lint to get the test working again.
2020-08-26 18:59:57 +00:00
Eric Huss
10426acb54 Fix cache_messages::rustdoc test broken on beta. 2020-08-26 11:17:57 -07:00
Eugene
8164c1df3a Add spaces after -C and -Z flags for consistency
Most other options have a space after flag name.
This commit makes verbose output of rustc invocations a little bit cleaner.
2020-08-25 16:06:16 +03:00
bors
5165270dd4 Auto merge of #8641 - weihanglo:fix/remove-alloc, r=Eh2406
fix: remove unnecessary allocations

Remove unnecessary `str::to_string` and `str::replace` allocations by using iterators. This PR is almost identical to #8622 except it does not skip the generated header.

Sorry that I did not profile the changes by myself. Seems that valgrind does not support macOS 10.15.6, I have not idea how to profile cargo subcommand. It would be great for an instruction to run a memory profiling for Rust program on macOS.
2020-08-23 13:07:55 +00:00
Weihang Lo
0c70319afe
refactor: compare lockfile use Iterator.eq 2020-08-23 09:07:54 +08:00
Weihang Lo
d86745bf99
fix: remove unnecessary allocations 2020-08-23 08:19:16 +08:00
bors
868a1cf00a Auto merge of #8637 - hbina:spelling_and_clippy, r=alexcrichton
Fixed a spelling and some clippy warnings
2020-08-20 17:29:36 +00:00
Hanif Bin Ariffin
47428433d4 Fixed a spelling and some clippy warnings 2020-08-19 18:20:51 -04:00
bors
51b66125ba Auto merge of #8609 - ehuss:resolver-semver, r=Eh2406
Add chapters on dependency resolution and SemVer compatibility.

This adds two documentation chapters, one on the resolver and one on SemVer compatibility. These are intended to help guide users on how to version their package and how to use dependencies.

I did not document `[patch]` resolution. Perhaps someday in the future the the "Overriding dependencies" chapter can be expanded to include more details on how patch works, and how to properly use it. I have a bunch of notes on this, but I want to defer it till later.

The SemVer compatibility guidelines were guided by [RFC 1105](https://github.com/rust-lang/rfcs/blob/master/text/1105-api-evolution.md), but are edited and expanded based on my own personal observations. I tried to highlight when some rules do not appear to have consensus on behavior. I would be happy for any additions or modifications to the rule list. I have a list of additional things to add, but I wanted to get the ball rolling, and it might take a while finish them.

Each compatibility entry has an example, and there is a small script which tests all the examples to ensure they work like they are supposed to. This script checks against the compiler output, which can be fragile over time. If that becomes too troublesome, we can probably find some more relaxed checks. I think checking the error is important because I've run into cases in the past where using basic "compile_fail" annotations were misleading because the examples were failing for the wrong reason.

Closes #7301
2020-08-19 20:22:52 +00:00
bors
343433487b Auto merge of #8611 - hbina:rename_into_url, r=ehuss
Renames SourceId::into_url -> SourceId::as_url

While studying the source code, I am surprised to see that `into_url`
does not actually consume its caller when a function with such name
usually does. Additionally, there is a trait in `cargo::util::IntoUrl`
with the same and does exactly what you expect, consumes itself and yields
a `CargoResult<Url>`.

I hope this is not too nitpicky.
Thank you!
2020-08-19 19:30:21 +00:00
bors
f03698b3f9 Auto merge of #8629 - EmbarkStudios:master, r=ehuss
Fix bug with PathAndArg config values

This fixes an issue I noticed when trying to specify a target runner via the [`CARGO_TARGET_{triplet}_RUNNER`](https://doc.rust-lang.org/cargo/reference/config.html#targettriplerunner) environment variable, expecting it to override the value in our `.cargo/config.toml` file, which was giving quite strange errors until I figured out that cargo was actually merging the config file's values with the environment's values.

This change adds a small hack to use and `UnmergedStringList` from `PathAndArgs` instead of just plain `StringList`, which uses the type in the deserializer to determine if `Config::get_list_or_string` should merge the values from the config file(s) with the environment as it was doing before, or else only use the environment to the exclusion of the config file(s) if the key was set in the environment.

I also added a test for this to confirm both the bug and the fix.
2020-08-18 16:52:45 +00:00
bors
e0dfa08e9a Auto merge of #8627 - ehuss:run-proc-err, r=Eh2406
Show full error context on `cargo run` error.

If there was an error exec-ing a process with `cargo run`, the error message was not displayed. The code was calling `downcast` to a `ProcessError` which erased the surrounding error context.  As shown in the modified test, it should now include a `Caused by:` message with the underlying error message.
2020-08-18 15:08:14 +00:00
Jake Shadle
ddc7090f49 Remove debug only code 2020-08-17 19:53:16 +02:00
Jake Shadle
a9a154f783 Fix bug with PathAndArg config values 2020-08-17 19:23:49 +02:00
Eric Huss
18bc90cd0e Show full error context on cargo run error. 2020-08-17 08:55:37 -07:00
bors
4de00d2c7f Auto merge of #8615 - davepacheco:sigquit-typo, r=ehuss
Fix typo in SIGQUIT description

This PR fixes a small typo in the SIGQUIT description.

(edit: removed my notes about automated tests because the PR bot has a more complete summary.)

In terms of manual testing: I had a test that raised `SIGQUIT` using the "coredump" crate.  Previously, it emitted:

```
error: test failed, to rerun pass '--test the_test'

Caused by:
  process didn't exit successfully: `/Users/dap/oxide/experiments/rust-coredump/target/debug/deps/the_test-a8a068307be90649 --nocapture` (signal: 3, SIGQUIT: terminal quite signal)
```

Now, it emits:

```
error: test failed, to rerun pass '--test the_test'

Caused by:
  process didn't exit successfully: `/Users/dap/oxide/experiments/rust-coredump/target/debug/deps/the_test-20c8e90133861ece --nocapture` (signal: 3, SIGQUIT: terminal quit signal)
```

which looks correct.
2020-08-12 23:26:46 +00:00
David Pacheco
ea0709e88a Fix typo in SIGQUIT description 2020-08-12 15:27:45 -07:00
Hanif Bin Ariffin
3dbac42a57 Renamed SourceIdIntoUrl -> SourceIdAsUrl 2020-08-11 17:46:47 -04:00
Hanif Bin Ariffin
79f3512975 Renames SourceId::into_url -> SourceId::as_url
While studying the source code, I am surprised to see that `into_url`
does not actually consume the string when a function with such name
usually does. Additionally, there are traits in `cargo::util::IntoUrl`
with the same and does exactly what you expect, consumes T and yields
a `Url`.

I hope this is not too nitpicky.
Thank you!
2020-08-10 21:03:53 -04:00
Eric Huss
006023c582 Update from review comments. 2020-08-10 17:35:34 -07:00
Eric Huss
1ee38a326e Try to fix CI for semver-check. 2020-08-10 11:33:42 -07:00
Eric Huss
4d023b1ec5 Don't check src/doc directory. 2020-08-10 11:29:28 -07:00
Eric Huss
fd6a84aa83 Add chapters on dependency resolution and SemVer compatibility. 2020-08-10 11:00:58 -07:00
bors
ab32ee88da Auto merge of #8600 - alexcrichton:deterministic, r=ehuss
Build manpage archive deterministically

Keep deterministic builds for Cargo!

Closes #8599
2020-08-10 17:44:43 +00:00
Alex Crichton
624acc8e2b Build manpage archive deterministically
Keep deterministic builds for Cargo! The changes here are:

* Sort files being added to the archive to ensure they're added in the
  same order on all platforms.
* Flag the archive builder as "deterministic mode" which means it won't
  pick up fields like mtime.

Closes #8599
2020-08-10 06:47:00 -07:00
bors
20d35ffeb6 Auto merge of #8604 - jtojnar:patch-1, r=ehuss
doc: Qualify GNU licenses in example license field

Since SPDX License list 3.0, unqualified GNU licenses are deprecated:

https://www.gnu.org/licenses/identify-licenses-clearly.html

We use version 3.6 of the list so we should not use the deprecated licenses.
2020-08-09 19:27:31 +00:00
bors
5de5915ca2 Auto merge of #8598 - alexcrichton:fix-test, r=ehuss
Fix jobserver_exists test on single-cpu systems

Closes #8595
2020-08-09 19:05:39 +00:00
Eric Huss
5305a3def6
Fix typo
Co-authored-by: Teymour Aldridge <42674621+teymour-aldridge@users.noreply.github.com>
2020-08-09 11:43:52 -07:00
bors
3bf5ad8ca9 Auto merge of #8605 - louib:patch-1, r=ehuss
Fix small typo in reference/profiles.md
2020-08-09 18:42:18 +00:00
louib
ff7d328149
Fix small typo in reference/profiles.md 2020-08-08 17:53:21 -04:00
Jan Tojnar
916b392cdb
doc: Qualify GNU licenses in example license field
Since SPDX License list 3.0, unqualified GNU licenses are deprecated:

https://www.gnu.org/licenses/identify-licenses-clearly.html

We use version 3.6 of the list so we should not use the deprecated licenses.
2020-08-08 20:38:06 +02:00
Alex Crichton
02fc16aece Fix jobserver_exists test on single-cpu systems
Closes #8595
2020-08-07 12:50:25 -07:00
bors
449743b1ac Auto merge of #8571 - canova:publish-default, r=ehuss
Default cargo publish to the alt registry if it's the only allowed one

Hi, this PR fixes #8036. Previously if we had only one allowed registry in Cargo.toml file, `cargo publish` was failing. But with this PR, we are defaulting to the only allowed registry with printing a note if there is only one registry in that array. I believe this will make things easier for people who use an alternative registry all the time.
2020-08-06 17:48:55 +00:00
Nazım Can Altınova
a8ce734a95
Update man page of cargo publish to include the new behavior 2020-08-06 13:30:29 +02:00
Nazım Can Altınova
81ecfe9466
Update publish field doc to explain new cargo publish behavior 2020-08-06 13:30:29 +02:00
Nazım Can Altınova
32449a70db
Add a test case for new publish behavior change 2020-08-06 13:01:15 +02:00
Nazım Can Altınova
d0e86cb505
Default cargo publish to the alt registry if it's the only allowed one 2020-08-06 13:01:15 +02:00
Nazım Can Altınova
ae57964cc3
Fix the comment of Package::publish 2020-08-06 13:01:11 +02:00
bors
0aedda245b Auto merge of #8565 - pawanbisht62:master, r=ehuss
cargo install with specific yanked version gives confusing "not found" error

Resolves #8171
2020-08-05 20:31:06 +00:00
bishtpawan
81687e7926 Resolve PR comments 2020-08-05 20:56:56 +05:30
bors
f84a62735a Auto merge of #8589 - camelid:patch-1, r=alexcrichton
Fix typo

elswhere -> elsewhere
2020-08-05 14:17:14 +00:00
bishtpawan
3952fdb223 Refactor code and resolve PR comments 2020-08-05 17:46:33 +05:30
bishtpawan
dd654d5576 Add pattern match for yank check and updated corresponding test cases 2020-08-05 17:31:56 +05:30
bishtpawan
a50b10af27 Refactor code 2020-08-05 17:31:56 +05:30
bishtpawan
844cde203f Add test case for yank validation check 2020-08-05 17:31:56 +05:30
bishtpawan
c180eb4990 Update approach to check for yanked version 2020-08-05 17:31:56 +05:30