]> git.proxmox.com Git - cargo.git/log
cargo.git
3 years agoFix an additional link
johnthagen [Tue, 17 Aug 2021 00:18:30 +0000 (20:18 -0400)]
Fix an additional link

3 years agoRender build-std web links as hyperlinks
johnthagen [Tue, 17 Aug 2021 00:14:30 +0000 (20:14 -0400)]
Render build-std web links as hyperlinks

3 years agoAuto merge of #9791 - nipunn1313:cargo_crash_alias_loop, r=alexcrichton
bors [Mon, 16 Aug 2021 15:01:11 +0000 (15:01 +0000)]
Auto merge of #9791 - nipunn1313:cargo_crash_alias_loop, r=alexcrichton

Teach cargo to failfast on recursive/corecursive aliases

Eg.
[alias]
test-1 = test-2
test-2 = test-3
test-3 = test-1

Previously it would stack overflow
Pulled out non controversial bits from from #9768

3 years agoAuto merge of #9789 - ehuss:fix-value-after-table-profile, r=alexcrichton
bors [Mon, 16 Aug 2021 14:09:42 +0000 (14:09 +0000)]
Auto merge of #9789 - ehuss:fix-value-after-table-profile, r=alexcrichton

Fix value-after-table error with profiles.

If the `strip`, `dir-name`, or `inherits` fields were included along with a profile override, then `cargo publish` would fail with a `ValueAfterTable` error because the fields were listed in the wrong order in the struct definition.

Fixes #9787

3 years agoTeach cargo to failfast on recursive/corecursive aliases
Nipunn Koorapati [Fri, 6 Aug 2021 00:21:13 +0000 (17:21 -0700)]
Teach cargo to failfast on recursive/corecursive aliases

Eg.
[alias]
test-1 = test-2
test-2 = test-3
test-3 = test-1

Previously it would stack overflow

It pulls out non controversial bits from from #9768

3 years agoRefactor echo cargo subcommand test helper into cargo-test-support
Nipunn Koorapati [Mon, 9 Aug 2021 17:01:04 +0000 (10:01 -0700)]
Refactor echo cargo subcommand test helper into cargo-test-support

3 years agoAuto merge of #9790 - ehuss:fix-plugin-registrar, r=alexcrichton
bors [Sun, 15 Aug 2021 05:02:47 +0000 (05:02 +0000)]
Auto merge of #9790 - ehuss:fix-plugin-registrar, r=alexcrichton

Fix plugin registrar change.

The plugin tests were broken due to a change in https://github.com/rust-lang/rust/pull/85296 which removed the `plugin_registrar` attribute.

3 years agoFix plugin registrar change.
Eric Huss [Sat, 14 Aug 2021 22:28:30 +0000 (15:28 -0700)]
Fix plugin registrar change.

3 years agoFix value-after-table error with profiles.
Eric Huss [Sat, 14 Aug 2021 21:45:25 +0000 (14:45 -0700)]
Fix value-after-table error with profiles.

3 years agoAuto merge of #9627 - whereistejas:many-bin-names, r=ehuss
bors [Wed, 11 Aug 2021 21:11:45 +0000 (21:11 +0000)]
Auto merge of #9627 - whereistejas:many-bin-names, r=ehuss

Ability to specify the output name for a bin target different from the crate name

Hi,

I have opened this to close the following issue #1706 .

I have decided to start by writing a test to outline what behavior is expected from `Cargo`.
As of now, this test fails (for obvious reasons). I will now start writing the code needed to pass this test.

This is my first time contributing to cargo. Please, feel free to let me know if there are any protocols/processes that need to be followed. I'm a newbie at this.

Closes issue #1706

3 years agoAbility to specify the output name for a bin target different from the crate name
Tejas Sanap [Sat, 26 Jun 2021 12:21:55 +0000 (17:51 +0530)]
Ability to specify the output name for a bin target different from the crate name

3 years agoAuto merge of #9773 - nipunn1313:cargo_list_dupe, r=alexcrichton
bors [Mon, 9 Aug 2021 18:40:05 +0000 (18:40 +0000)]
Auto merge of #9773 - nipunn1313:cargo_list_dupe, r=alexcrichton

Deduplicate entries in cargo --list

Fixes #6088

3 years agoDeduplicate entries in cargo --list
Nipunn Koorapati [Sat, 7 Aug 2021 07:11:01 +0000 (00:11 -0700)]
Deduplicate entries in cargo --list

Fixes #6088

3 years agoAuto merge of #9764 - djmitche:issue8486, r=alexcrichton
bors [Mon, 9 Aug 2021 16:15:43 +0000 (16:15 +0000)]
Auto merge of #9764 - djmitche:issue8486, r=alexcrichton

Include aliases with other commands

The principal result is that they are now automatically included in the
`cargo --list` output.  Fixes #8486.

3 years agoInclude aliases with other commands
Dustin J. Mitchell [Thu, 5 Aug 2021 01:04:24 +0000 (01:04 +0000)]
Include aliases with other commands

The principal result is that they are now automatically included in the
`cargo --list` output.  Fixes #8486.

3 years agoAuto merge of #9118 - bjorn3:profile_codegen_backend_option, r=joshtriplett
bors [Fri, 6 Aug 2021 20:43:21 +0000 (20:43 +0000)]
Auto merge of #9118 - bjorn3:profile_codegen_backend_option, r=joshtriplett

Add a profile option to select the codegen backend

This makes it possible to compile only specific crates with a certain codegen backend.

I have tested this by compiling Bevy with cg_llvm, but one of the examples using cg_clif.

By the way I noticed that many unstable profile options are not checked when using profile overrides.

3 years agoFix compile error
bjorn3 [Fri, 6 Aug 2021 18:10:26 +0000 (20:10 +0200)]
Fix compile error

3 years agoAuto merge of #9617 - danieleades:refactor/useless-conversions, r=ehuss
bors [Fri, 6 Aug 2021 17:09:04 +0000 (17:09 +0000)]
Auto merge of #9617 - danieleades:refactor/useless-conversions, r=ehuss

remove useless conversions

3 years agoAuto merge of #9613 - danieleades:refactor/collapse-if-blocks, r=ehuss
bors [Fri, 6 Aug 2021 16:44:10 +0000 (16:44 +0000)]
Auto merge of #9613 - danieleades:refactor/collapse-if-blocks, r=ehuss

collapse nested if blocks

3 years agoAuto merge of #9767 - nipunn1313:refactor, r=alexcrichton
bors [Fri, 6 Aug 2021 14:39:45 +0000 (14:39 +0000)]
Auto merge of #9767 - nipunn1313:refactor, r=alexcrichton

Refactor fake_file() away from cargo_command tests

There are already similar preexisting test helpers which
also work on windows. Port over the executable-creation
helper into the file() helper and things appear to pass.

Was inspired to do this when trying to add tests to solve a separate issue.

3 years agoRefactor fake_file() away from cargo_command tests
Nipunn Koorapati [Fri, 6 Aug 2021 00:19:42 +0000 (17:19 -0700)]
Refactor fake_file() away from cargo_command tests

There are already similar preexisting test helpers which
also work on windows. Port over the executable-creation
helper into the file() helper and things appear to pass.

3 years agoFix test
bjorn3 [Thu, 5 Aug 2021 15:17:50 +0000 (17:17 +0200)]
Fix test

3 years agoUpdate error message
bjorn3 [Thu, 5 Aug 2021 15:15:22 +0000 (17:15 +0200)]
Update error message

Co-authored-by: Josh Triplett <josh@joshtriplett.org>
3 years agoOnly allow internal backends
bjorn3 [Thu, 5 Aug 2021 13:26:01 +0000 (15:26 +0200)]
Only allow internal backends

3 years agoAuto merge of #9762 - erickt:bump, r=ehuss
bors [Thu, 5 Aug 2021 01:23:53 +0000 (01:23 +0000)]
Auto merge of #9762 - erickt:bump, r=ehuss

Update cargo-platform to 0.1.2

This preps cargo-platform for a release. The only substantial change is that this should include the license files into the archive that is uploaded to crates.io.

Closes #9758

3 years agoAuto merge of #9760 - alexcrichton:bump-jobserver, r=Eh2406
bors [Thu, 5 Aug 2021 00:59:49 +0000 (00:59 +0000)]
Auto merge of #9760 - alexcrichton:bump-jobserver, r=Eh2406

Bump to the latest jobserver dependency

This should help mitigate #9739 at least with a better error message as
opposed to deadlocking.

3 years agoAuto merge of #9763 - erickt:fix-semver-check, r=ehuss
bors [Thu, 5 Aug 2021 00:36:09 +0000 (00:36 +0000)]
Auto merge of #9763 - erickt:fix-semver-check, r=ehuss

Fix semver check for rust 1.54.0

This updates semver.md to use the new error message for reporting missing generic arguments.

3 years agoFix semver check for rust 1.54.0
Erick Tryzelaar [Wed, 4 Aug 2021 23:59:38 +0000 (16:59 -0700)]
Fix semver check for rust 1.54.0

This updates semver.md to use the new error message for reporting missing
generic arguments.

3 years agoUpdate cargo-platform to 0.1.2
Erick Tryzelaar [Wed, 4 Aug 2021 23:11:52 +0000 (16:11 -0700)]
Update cargo-platform to 0.1.2

This preps cargo-platform for a release. The only substantial change is that
this should include the license files into the archive that is uploaded to
crates.io.

Closes #9758

3 years agoUpdate test
bjorn3 [Sun, 31 Jan 2021 17:08:47 +0000 (18:08 +0100)]
Update test

3 years agoAdd a profile option to select the codegen backend
bjorn3 [Sun, 31 Jan 2021 15:45:38 +0000 (16:45 +0100)]
Add a profile option to select the codegen backend

This makes it possible to compile only specific crates with a certain
codegen backend.

3 years agoBump to the latest jobserver dependency
Alex Crichton [Wed, 4 Aug 2021 14:25:07 +0000 (07:25 -0700)]
Bump to the latest jobserver dependency

This should help mitigate #9739 at least with a better error message as
opposed to deadlocking.

3 years agoAuto merge of #9732 - djc:rust-version-docs, r=ehuss
bors [Mon, 2 Aug 2021 20:28:08 +0000 (20:28 +0000)]
Auto merge of #9732 - djc:rust-version-docs, r=ehuss

Stabilize the rust-version field

I've tried to make the documentation here fairly comprehensive. I've also updated the first version for the 2021 edition, which should now be stable pending substantial unforeseen changes.

See #8072.

3 years agoAdd a CHANGELOG entry
Dirkjan Ochtman [Mon, 2 Aug 2021 09:28:47 +0000 (11:28 +0200)]
Add a CHANGELOG entry

3 years agoStabilize rust-version
Dirkjan Ochtman [Tue, 27 Jul 2021 18:57:46 +0000 (20:57 +0200)]
Stabilize rust-version

3 years agoDocument the rust-version field
Dirkjan Ochtman [Tue, 27 Jul 2021 14:33:57 +0000 (16:33 +0200)]
Document the rust-version field

3 years agoAuto merge of #9751 - ehuss:remove-nbsp, r=alexcrichton
bors [Fri, 30 Jul 2021 22:41:00 +0000 (22:41 +0000)]
Auto merge of #9751 - ehuss:remove-nbsp, r=alexcrichton

Remove nbsp characters.

Due to an accident due to the way I've been typing em-dash characters, a bunch of non-breaking space characters have snuck in to the source here.  I never intended that, and I think having invisible characters that are not normal spaces can be confusing, so I just replaced them with spaces. There's still a few nbsp's where they are needed.

3 years agoRemove nbsp characters.
Eric Huss [Fri, 30 Jul 2021 20:30:27 +0000 (13:30 -0700)]
Remove nbsp characters.

3 years agoAuto merge of #9750 - ehuss:update-unstable-toc, r=alexcrichton
bors [Fri, 30 Jul 2021 21:06:57 +0000 (21:06 +0000)]
Auto merge of #9750 - ehuss:update-unstable-toc, r=alexcrichton

Update unstable documentation TOC.

The unstable table of contents was slightly out-of-sync with recent changes.

3 years agoAuto merge of #9749 - ehuss:no_all-package, r=alexcrichton
bors [Fri, 30 Jul 2021 20:37:29 +0000 (20:37 +0000)]
Auto merge of #9749 - ehuss:no_all-package, r=alexcrichton

Some minor updates for package/publish package selection.

This is just a few small things I missed in the review of #9559.

* Don't include the deprecated `--all` flag in `cargo package`.
* Update the man pages for the new flags.

3 years agoUpdate unstable documentation TOC.
Eric Huss [Fri, 30 Jul 2021 20:22:34 +0000 (13:22 -0700)]
Update unstable documentation TOC.

3 years agoUpdate package/publish man pages for package selection.
Eric Huss [Fri, 30 Jul 2021 20:09:14 +0000 (13:09 -0700)]
Update package/publish man pages for package selection.

3 years agoRemove duplicated code in arg_package_spec.
Eric Huss [Fri, 30 Jul 2021 20:05:17 +0000 (13:05 -0700)]
Remove duplicated code in arg_package_spec.

3 years agoRemove `--all` from `cargo package`.
Eric Huss [Fri, 30 Jul 2021 19:59:35 +0000 (12:59 -0700)]
Remove `--all` from `cargo package`.

3 years agoAuto merge of #9748 - ehuss:version-bump, r=alexcrichton
bors [Fri, 30 Jul 2021 15:35:18 +0000 (15:35 +0000)]
Auto merge of #9748 - ehuss:version-bump, r=alexcrichton

Bump to 0.57.0, update changelog

3 years agoUpdate changelog for 1.55
Eric Huss [Fri, 30 Jul 2021 15:24:21 +0000 (08:24 -0700)]
Update changelog for 1.55

3 years agoAuto merge of #9411 - joshtriplett:stabilize-configurable-env, r=alexcrichton
bors [Fri, 30 Jul 2021 15:01:55 +0000 (15:01 +0000)]
Auto merge of #9411 - joshtriplett:stabilize-configurable-env, r=alexcrichton

Stabilize `[env]` sections

`[env]` sections seem to work as advertised.

3 years agoBump to 0.57.0
Eric Huss [Fri, 30 Jul 2021 14:24:53 +0000 (07:24 -0700)]
Bump to 0.57.0

3 years agoAdd reference from unstable doc anchor to stable env documentation
Josh Triplett [Fri, 30 Jul 2021 02:42:19 +0000 (19:42 -0700)]
Add reference from unstable doc anchor to stable env documentation

3 years agoStabilize `[env]` sections
Josh Triplett [Sun, 25 Apr 2021 04:55:52 +0000 (21:55 -0700)]
Stabilize `[env]` sections

`[env]` sections seem to work as advertised.

3 years agoAuto merge of #9747 - lf-:document-pathandargs-doc-browser, r=ehuss
bors [Thu, 29 Jul 2021 21:58:18 +0000 (21:58 +0000)]
Auto merge of #9747 - lf-:document-pathandargs-doc-browser, r=ehuss

doc: Clarify [doc].browser docs, document PathAndArgs better

I was talking to someone who was confused about the [doc].browser value type as it related to using a path with a space in it, and it seemed like this area needed clarification in general.

3 years agoClarify [doc].browser docs, document PathAndArgs better
Jade [Thu, 29 Jul 2021 21:50:34 +0000 (14:50 -0700)]
Clarify [doc].browser docs, document PathAndArgs better

3 years agoAuto merge of #9745 - ehuss:cargo-util-version, r=alexcrichton
bors [Thu, 29 Jul 2021 16:57:14 +0000 (16:57 +0000)]
Auto merge of #9745 - ehuss:cargo-util-version, r=alexcrichton

Bump cargo-util version.

I neglected to bump the version when moving some APIs over to this crate.

cc #9744

3 years agoBump cargo-util version.
Eric Huss [Thu, 29 Jul 2021 16:23:23 +0000 (09:23 -0700)]
Bump cargo-util version.

3 years agoAuto merge of #9736 - hi-rustin:rustin-patch-clippy, r=ehuss
bors [Wed, 28 Jul 2021 15:41:09 +0000 (15:41 +0000)]
Auto merge of #9736 - hi-rustin:rustin-patch-clippy, r=ehuss

Make clippy happy

Make clippy happy.

3 years agoAuto merge of #9737 - ods:doc/features_typo, r=alexcrichton
bors [Wed, 28 Jul 2021 14:05:21 +0000 (14:05 +0000)]
Auto merge of #9737 - ods:doc/features_typo, r=alexcrichton

Fix typo in features doc

3 years agoFix typo in features doc
ods [Wed, 28 Jul 2021 13:20:44 +0000 (16:20 +0300)]
Fix typo in features doc

3 years agoMake clippy happy
hi-rustin [Wed, 28 Jul 2021 06:59:43 +0000 (14:59 +0800)]
Make clippy happy

Signed-off-by: hi-rustin <rustin.liu@gmail.com>
3 years agoAuto merge of #9730 - hi-rustin:rustin-patch-doc-test, r=alexcrichton
bors [Tue, 27 Jul 2021 15:05:14 +0000 (15:05 +0000)]
Auto merge of #9730 - hi-rustin:rustin-patch-doc-test, r=alexcrichton

doc test supports silent output

close https://github.com/rust-lang/cargo/issues/9728

3 years agodoc test supports silent output
hi-rustin [Tue, 27 Jul 2021 07:49:59 +0000 (15:49 +0800)]
doc test supports silent output

Signed-off-by: hi-rustin <rustin.liu@gmail.com>
3 years agoAuto merge of #9727 - ehuss:fix-version, r=alexcrichton
bors [Mon, 26 Jul 2021 20:23:21 +0000 (20:23 +0000)]
Auto merge of #9727 - ehuss:fix-version, r=alexcrichton

Fix version string.

The version string for `cargo version` was inadvertently changed in #9657 so that it does not include the leading `cargo` as in `cargo 1.53.0 (4369396ce 2021-04-27)`.

3 years agoAuto merge of #9559 - tcmal:master, r=ehuss
bors [Mon, 26 Jul 2021 19:58:01 +0000 (19:58 +0000)]
Auto merge of #9559 - tcmal:master, r=ehuss

Allow publishing from workspace root.

Adds -p, --workspace, and --exclude to package and publish commands.

Uses ephemeral workspaces to avoid changing the existing functions too much.
There might be more `Finished dev [unoptimized + debuginfo] target` messages when packaging than there should be, I couldn't figure out what was generating them.
The tests aren't super extensive, as all the specs from arguments code should already be tested elsewhere.

Closes #7345

3 years agoRemove unnecessary format!
Eric Huss [Mon, 26 Jul 2021 19:56:53 +0000 (12:56 -0700)]
Remove unnecessary format!

3 years agoAuto merge of #9723 - hi-rustin:rustin-patch-better-msg, r=ehuss
bors [Mon, 26 Jul 2021 19:24:32 +0000 (19:24 +0000)]
Auto merge of #9723 - hi-rustin:rustin-patch-better-msg, r=ehuss

Better msg for wrong position

close https://github.com/rust-lang/cargo/issues/9717

3 years agoFix version string.
Eric Huss [Mon, 26 Jul 2021 19:18:22 +0000 (12:18 -0700)]
Fix version string.

3 years agoAuto merge of #9557 - danielframpton:extra-link-args, r=ehuss
bors [Mon, 26 Jul 2021 18:54:29 +0000 (18:54 +0000)]
Auto merge of #9557 - danielframpton:extra-link-args, r=ehuss

Stabilize the rustc-link-arg option

This change removes the unstable option (tracked by #9426) and unconditionally accepts additional linker arguments (as implemented in #7811 and #8441). Documentation is moved from unstable to what appeared to be the correct location.

I am not aware of any significant concerns with the option and it appears consistent with some other existing stable linker options.

Please let me know if this is not the appropriate process or if there is anything that I am missing from the PR.

3 years agofeat(package+publish): package arguments
tcmal [Wed, 21 Jul 2021 17:33:19 +0000 (18:33 +0100)]
feat(package+publish): package arguments

adds -p, --workspace, and --exclude to package command,
and -p to publish command, as well as tests for both.

closes #7345

3 years agoRefine name
hi-rustin [Sat, 24 Jul 2021 16:35:09 +0000 (00:35 +0800)]
Refine name

Signed-off-by: hi-rustin <rustin.liu@gmail.com>
3 years agoBetter msg for wrong position
hi-rustin [Sat, 24 Jul 2021 02:44:44 +0000 (10:44 +0800)]
Better msg for wrong position

Signed-off-by: hi-rustin <rustin.liu@gmail.com>
3 years agoAuto merge of #9681 - hi-rustin:rustin-patch-reject, r=ehuss
bors [Fri, 23 Jul 2021 18:53:25 +0000 (18:53 +0000)]
Auto merge of #9681 - hi-rustin:rustin-patch-reject, r=ehuss

Warning when using features in replace

close https://github.com/rust-lang/cargo/issues/3034
close https://github.com/rust-lang/cargo/issues/2582

r? `@ehuss`

3 years agoAuto merge of #9721 - In-line:refactor-if-let-chains, r=ehuss
bors [Fri, 23 Jul 2021 18:29:49 +0000 (18:29 +0000)]
Auto merge of #9721 - In-line:refactor-if-let-chains, r=ehuss

Refactor if let chains to matches! macro

3 years agoRefactor if let chains to matches! macro
Alik Aslanyan [Fri, 23 Jul 2021 14:53:09 +0000 (18:53 +0400)]
Refactor if let chains to matches! macro

3 years agoAuto merge of #9720 - In-line:weather-is-not-nice-today, r=ehuss
bors [Fri, 23 Jul 2021 13:37:24 +0000 (13:37 +0000)]
Auto merge of #9720 - In-line:weather-is-not-nice-today, r=ehuss

Weather is not nice today..

3 years agoWeather is not nice today..
Alik Aslanyan [Fri, 23 Jul 2021 13:15:14 +0000 (17:15 +0400)]
Weather is not nice today..

3 years agoWarning when using features in replace
hi-rustin [Fri, 23 Jul 2021 07:00:50 +0000 (15:00 +0800)]
Warning when using features in replace

Signed-off-by: hi-rustin <rustin.liu@gmail.com>
3 years agoStabilize the extra link arg option
Daniel Frampton [Fri, 4 Jun 2021 23:15:31 +0000 (16:15 -0700)]
Stabilize the extra link arg option

3 years agoAuto merge of #9653 - bjorn3:update_should_use_metadata, r=alexcrichton
bors [Thu, 22 Jul 2021 14:16:04 +0000 (14:16 +0000)]
Auto merge of #9653 - bjorn3:update_should_use_metadata, r=alexcrichton

Update should_use_metadata function

* Correct the reason for not renaming dylibs
* Add todo for -install-name/-soname usage
* Limit wasm32 executable metadata omission to emscripten. Wasm file don't contain any filename themself.
* Don't omit metadata for executables on macOS. backtrace-rs is now able to load debuginfo for renamed .dSYM files: https://github.com/rust-lang/backtrace-rs/blob/ed3689c2f2b9a31546d75fae389a32a572957dbd/src/symbolize/gimli/macho.rs#L51-L65
* Mention another reason to include the metadata hash for libstd.

3 years agoAuto merge of #9714 - PTNobel:fix-force-warn, r=ehuss
bors [Thu, 22 Jul 2021 13:01:52 +0000 (13:01 +0000)]
Auto merge of #9714 - PTNobel:fix-force-warn, r=ehuss

Changes rustc argument from `--force-warns` to `--force-warn`

The rustc argument was renamed in rust-lang/rust#87346 breaking `cargo fix` on the nightly toolchain.

I encountered this while attempting to test Edition 2021 migrations.

I ran `RUSTC=/path/to/nightly/rustc cargo test` and encountered a few failing tests, but none of them seemed at all related to the 1 line I changed, so if they crop up in CI as well, would love some help on identifying what's causing that.

Closes rust-lang/rust#87360

3 years agoChanges rustc argument from `--force-warns` to `--force-warn`
Parth Nobel [Thu, 22 Jul 2021 06:44:24 +0000 (23:44 -0700)]
Changes rustc argument from `--force-warns` to `--force-warn`

The rustc argument was renamed in rust-lang/rust#87346.

3 years agocollapse nested if blocks
Daniel Eades [Wed, 23 Jun 2021 09:57:27 +0000 (10:57 +0100)]
collapse nested if blocks

3 years agoAuto merge of #9632 - weihanglo:issue-6691, r=ehuss
bors [Wed, 21 Jul 2021 17:14:20 +0000 (17:14 +0000)]
Auto merge of #9632 - weihanglo:issue-6691, r=ehuss

Display registry name instead of registry URL when possible

Fixes #6691

This PR can be divided into several parts:

c5be3de: Try to display registry names instead of URLs for `impl Dipslay for SourceId`. This benefits almost all kinds of messages using`SourceId` directly or indrectly.
9394d48: This fixes `Updating <name> index` part of `[source]` replacement, which previously didn't preserve the registry name information.
4c2f9b5: This makes its best effort to show registry names for deps from `Cargo.lock`. Since current lockfile format does not serialize any registry name. We here try the best effort to restore registry name from either `[registries]` table or `[source]` replacement table. This is done by manually implementing `Hash` and `PartialEq` for `SourceIdInner`, of which two traits previously are simply derived.
    To make `SourceIdInner` generate the same hash no matter it contains `name` field or not, here we remove `name` field from hashing and only concern about `kind`, `precise` and `canonical_url`.

Feel free to ask me for adding more tests, though I am not sure what tests should be added ðŸ˜…

3 years agoUpdate tests to use registry names
Weihang Lo [Sun, 27 Jun 2021 19:18:36 +0000 (03:18 +0800)]
Update tests to use registry names

3 years agoUse `crates-io` instead of `crates.io` as registry name
Weihang Lo [Sun, 27 Jun 2021 18:33:47 +0000 (02:33 +0800)]
Use `crates-io` instead of `crates.io` as registry name

3 years agoShow registry name for SourceId from lockfile
Weihang Lo [Sun, 27 Jun 2021 16:28:39 +0000 (00:28 +0800)]
Show registry name for SourceId from lockfile

Since current lockfile does not serialize any registry names. We here
try best effort to restore registry name from either `[registries]`
table or `[source]` replacement table. This is done by manually
implementing `Hash` and `PartialEq` for `SourceIdInner`, of which two
traits previously are simply `derive`d.

To make `SourceIdInner` generate the same hash whether contains `name`
field or not, here we remove `name` field from hashing and only concern
about `kind`, `precise` and `canonical_url`.

3 years agoShow registry name when using source replacment
Weihang Lo [Sun, 27 Jun 2021 06:46:56 +0000 (14:46 +0800)]
Show registry name when using source replacment

3 years agoShow registry name in messages if possible
Weihang Lo [Sun, 27 Jun 2021 06:12:47 +0000 (14:12 +0800)]
Show registry name in messages if possible

This fixes most messages to display registry names instead of URLs.

3 years agoReuse crate-io constant
Weihang Lo [Sat, 26 Jun 2021 13:35:07 +0000 (21:35 +0800)]
Reuse crate-io constant

3 years agoAuto merge of #9685 - ehuss:named-profile-updates, r=alexcrichton
bors [Tue, 20 Jul 2021 21:55:45 +0000 (21:55 +0000)]
Auto merge of #9685 - ehuss:named-profile-updates, r=alexcrichton

Named profile updates

A few updates for named profiles to push them closer to stabilization:

- Disable the `dir-name` profile setting. `dir-name` primarily exists for translating the built-in profiles or sharing artifacts between profiles. In order to simplify the UI, we would like to not expose it to the user for the initial stabilization. The code to support it is kept in case we want to add it in the future.
- Reserve some profile names. Just to give a little flexibility in the future in case we want to use these, or that they could cause confusion. Also updated the error text a little.
- Add support for custom profiles to legacy commands. Their old behavior is still retained for backwards compatibility. That is:
    * `cargo check`
        * `--profile=test`: This forces the test mode. For example, `cargo check --lib --profile=test` will check the library as a unit test (with `--test`).
    * `cargo fix`
        * `--profile=test`: Forces test mode, same as above.
    * `cargo rustc`
        * `--profile=test`: Forces test mode, same as above.
        * `--profile=bench`: Forces bench mode.
        * `--profile=check`: Forces check mode.
    - These commands also allow mixing the above options with `--release`, which is normally not allowed.
- Fix `cargo bench` to support the `--profile` option. I think it was just forgotten.

3 years agoAuto merge of #9601 - jonhoo:fix-9600, r=ehuss
bors [Tue, 20 Jul 2021 21:27:35 +0000 (21:27 +0000)]
Auto merge of #9601 - jonhoo:fix-9600, r=ehuss

Inform build scripts of rustc compiler context

Fixes #9600.

3 years agoAuto merge of #9703 - djmitche:versionprefs, r=alexcrichton
bors [Mon, 19 Jul 2021 14:33:56 +0000 (14:33 +0000)]
Auto merge of #9703 - djmitche:versionprefs, r=alexcrichton

Factor version preferences into a struct

This concentrates all of the "prefer this version" logic previously
handled with `try_to_use` and `prefer_patch_deps` parameters into a
struct that hides both the reason a package version might be preferred
and the form that preference took (Dependency or PackageId).  Besides
simplifying `RegistryQuerier::query` slightly, this invites further
refinements to version preferences to support new cargo features.

3 years agoAuto merge of #9704 - LightSage:update-link, r=alexcrichton
bors [Mon, 19 Jul 2021 14:08:15 +0000 (14:08 +0000)]
Auto merge of #9704 - LightSage:update-link, r=alexcrichton

docs: Fix sentence & update link for GitLab CI docs

This just adds a missing word in the sentence and updates the link for gitlab's ci docs.

3 years agoFix sentence & update link for GitLab CI docs
LightSage [Mon, 19 Jul 2021 02:44:26 +0000 (02:44 +0000)]
Fix sentence & update link for GitLab CI docs

3 years agoFactor version preferences into a struct
Dustin J. Mitchell [Sun, 18 Jul 2021 19:31:05 +0000 (19:31 +0000)]
Factor version preferences into a struct

This concentrates all of the "prefer this version" logic previously
handled with `try_to_use` and `prefer_patch_deps` parameters into a
struct that hides both the reason a package version might be preferred
and the form that preference took (Dependency or PackageId).  Besides
simplifying `RegistryQuerier::query` slightly, this invites further
refinements to version preferences to support new cargo features.

3 years agoAuto merge of #9675 - ehuss:diagnostic-dedupe, r=alexcrichton
bors [Fri, 16 Jul 2021 15:22:58 +0000 (15:22 +0000)]
Auto merge of #9675 - ehuss:diagnostic-dedupe, r=alexcrichton

Deduplicate compiler diagnostics.

This adds some logic to deduplicate diagnostics emitted across rustc invocations. There are some situations where different targets can emit the same message, and that has caused confusion particularly for new users. A prominent example is running `cargo test` which will build the library twice concurrently (once as a normal library, and once as a test).

As part of this, the "N warnings emitted" message sent by rustc is intercepted, and instead cargo generates its own summary. This is to prevent potentially confusing situations where that message is either deduplicated, or wrong. It also provides a little more context to explain exactly *what* issued the warnings.  Example:

```warning: `foo` (lib) generated 1 warning```

This only impacts human-readable output, it does not change JSON behavior.

Closes #9104

3 years agoRename show_warnings.
Eric Huss [Fri, 16 Jul 2021 15:16:03 +0000 (08:16 -0700)]
Rename show_warnings.

3 years agoAuto merge of #9698 - ehuss:enable-future-incompat, r=alexcrichton
bors [Fri, 16 Jul 2021 14:06:56 +0000 (14:06 +0000)]
Auto merge of #9698 - ehuss:enable-future-incompat, r=alexcrichton

Re-enable future-incompatible tests.

This re-enables the future-incompatible tests that were disabled in #9638.

rustc now has a `-Zfuture-incompat-test` flag we can use to test the future-incompatible reporting system. It causes rustc to treat every lint as future-incompatible, so we can just pick some arbitrary lint that should be stable over time.

3 years agoRe-enable future-incompatible tests.
Eric Huss [Fri, 16 Jul 2021 12:45:29 +0000 (05:45 -0700)]
Re-enable future-incompatible tests.

3 years agoRemove RUSTC_VERSION envvar
Jon Gjengset [Fri, 16 Jul 2021 00:52:33 +0000 (17:52 -0700)]
Remove RUSTC_VERSION envvar

3 years agoAuto merge of #9695 - alexcrichton:flaky, r=ehuss
bors [Fri, 16 Jul 2021 00:50:39 +0000 (00:50 +0000)]
Auto merge of #9695 - alexcrichton:flaky, r=ehuss

Flag another curl error as possibly spurious

cc rust-lang/crates.io#3782

3 years agoAdd test demonstrating deduplication of errors.
Eric Huss [Fri, 16 Jul 2021 00:37:21 +0000 (17:37 -0700)]
Add test demonstrating deduplication of errors.