]> git.proxmox.com Git - cargo.git/log
cargo.git
20 months agobump version to 0.66.0+pve1-1~bpo11+pve1 proxmox/bullseye
Fabian Grünbichler [Wed, 11 Jan 2023 11:07:02 +0000 (12:07 +0100)]
bump version to 0.66.0+pve1-1~bpo11+pve1

Signed-off-by: Fabian Grünbichler <f.gruenbichler@proxmox.com>
20 months agoUpdate upstream source from tag 'upstream/0.66.0+pve1'
Fabian Grünbichler [Wed, 11 Jan 2023 11:04:15 +0000 (12:04 +0100)]
Update upstream source from tag 'upstream/0.66.0+pve1'

Update to upstream version '0.66.0+pve1'
with Debian dir 4ea816e19076fd3eb64fe9118177863448db11ee

20 months agoNew upstream version 0.66.0+pve1
Fabian Grünbichler [Wed, 11 Jan 2023 11:03:52 +0000 (12:03 +0100)]
New upstream version 0.66.0+pve1

20 months agoupdate unsuspicious list
Fabian Grünbichler [Wed, 11 Jan 2023 10:52:27 +0000 (11:52 +0100)]
update unsuspicious list

Signed-off-by: Fabian Grünbichler <f.gruenbichler@proxmox.com>
20 months agoupdate debcargo-conf.patch (concolor, clap)
Fabian Grünbichler [Sun, 8 Jan 2023 15:29:55 +0000 (16:29 +0100)]
update debcargo-conf.patch (concolor, clap)

Signed-off-by: Fabian Grünbichler <debian@fabian.gruenbichler.email>
20 months agoapply CVE fix for tarball generation
Fabian Grünbichler [Wed, 11 Jan 2023 09:50:21 +0000 (10:50 +0100)]
apply CVE fix for tarball generation

the fix updates and adds dependencies which we need to vendor.

Signed-off-by: Fabian Grünbichler <f.gruenbichler@proxmox.com>
20 months agoadjust CVE patches for src:cargo
Fabian Grünbichler [Wed, 11 Jan 2023 10:04:09 +0000 (11:04 +0100)]
adjust CVE patches for src:cargo

Cargo.toml files are not normalized here, since they are not obtained from
crates.io but from the upstream tarball. The bundled cargo-test-support crate
also needs to be adjusted.

Signed-off-by: Fabian Grünbichler <f.gruenbichler@proxmox.com>
20 months agoadd CVE-2022-46176 fix
Fabian Grünbichler [Wed, 11 Jan 2023 09:50:07 +0000 (10:50 +0100)]
add CVE-2022-46176 fix

Signed-off-by: Fabian Grünbichler <f.gruenbichler@proxmox.com>
21 months agobump version to 0.66.0-1~bpo11+pve1
Fabian Grünbichler [Tue, 6 Dec 2022 09:30:06 +0000 (10:30 +0100)]
bump version to 0.66.0-1~bpo11+pve1

Signed-off-by: Fabian Grünbichler <f.gruenbichler@proxmox.com>
21 months agoMerge branch 'debian/sid' into proxmox/bullseye
Fabian Grünbichler [Tue, 6 Dec 2022 09:29:47 +0000 (10:29 +0100)]
Merge branch 'debian/sid' into proxmox/bullseye

21 months agod/control: depend on rustc 1.63
Fabian Grünbichler [Mon, 5 Dec 2022 15:23:21 +0000 (16:23 +0100)]
d/control: depend on rustc 1.63

cargo requires the scoped_threads feature

Signed-off-by: Fabian Grünbichler <f.gruenbichler@proxmox.com>
21 months agoupdate to 0.66.0
Fabian Grünbichler [Mon, 5 Dec 2022 15:20:49 +0000 (16:20 +0100)]
update to 0.66.0

Signed-off-by: Fabian Grünbichler <f.gruenbichler@proxmox.com>
21 months agoPatch test macro to work around qemu vfork bug when command not found
Blair Noctis [Wed, 26 Oct 2022 07:23:32 +0000 (07:23 +0000)]
Patch test macro to work around qemu vfork bug when command not found

21 months agoRefresh patches and remove upstream applied CVE patches
Blair Noctis [Tue, 25 Oct 2022 21:43:41 +0000 (21:43 +0000)]
Refresh patches and remove upstream applied CVE patches

21 months agoUpdate upstream source from tag 'upstream/0.66.0'
Fabian Grünbichler [Mon, 5 Dec 2022 15:13:43 +0000 (16:13 +0100)]
Update upstream source from tag 'upstream/0.66.0'

Update to upstream version '0.66.0'
with Debian dir be84e243c22f7155fc112594abfb10695d595951

21 months agoNew upstream version 0.66.0
Fabian Grünbichler [Mon, 5 Dec 2022 15:13:20 +0000 (16:13 +0100)]
New upstream version 0.66.0

21 months agono longer pin git2/libgit2-sys
Fabian Grünbichler [Mon, 5 Dec 2022 13:16:49 +0000 (14:16 +0100)]
no longer pin git2/libgit2-sys

cargo 0.63 can download these just fine.

Signed-off-by: Fabian Grünbichler <f.gruenbichler@proxmox.com>
21 months agoUpdate debcargo-conf.patch, unapply tempfile patch to match vendored
Blair Noctis [Sat, 29 Oct 2022 07:48:50 +0000 (07:48 +0000)]
Update debcargo-conf.patch, unapply tempfile patch to match vendored

21 months agobump version to 0.63.1-2
Fabian Grünbichler [Sat, 19 Nov 2022 09:48:51 +0000 (10:48 +0100)]
bump version to 0.63.1-2

Signed-off-by: Fabian Grünbichler <debian@fabian.gruenbichler.email>
21 months agofix i386 build / cross tests
Fabian Grünbichler [Sat, 19 Nov 2022 09:26:24 +0000 (10:26 +0100)]
fix i386 build / cross tests

cross tests are disabled, and are broken on i386 because the testsuite's
"alternate" cross target is actually i386. guard the two previously
failing tests so that they don't run with cross tests disabled, as
intended when building packages in Debian.

patch will be filed upstreamed next week.

Signed-off-by: Fabian Grünbichler <debian@fabian.gruenbichler.email>
22 months agodisable utf-8 fs-specific test
Fabian Grünbichler [Sat, 15 Oct 2022 12:33:52 +0000 (14:33 +0200)]
disable utf-8 fs-specific test

there are file systems that don't allow arbitrary bytes in paths.

Signed-off-by: Fabian Grünbichler <debian@fabian.gruenbichler.email>
22 months agoMerge branch 'registry-paths' into 'debian/sid'
Ximin Luo [Fri, 28 Oct 2022 12:16:01 +0000 (12:16 +0000)]
Merge branch 'registry-paths' into 'debian/sid'

Fix path remapping for crate dependencies

See merge request rust-team/cargo!13

22 months agoFix path remapping for crate dependencies
Ryan Gonzalez [Fri, 28 Oct 2022 12:16:01 +0000 (12:16 +0000)]
Fix path remapping for crate dependencies

22 months agobump version to 0.63.1-1
Fabian Grünbichler [Sat, 15 Oct 2022 12:33:46 +0000 (14:33 +0200)]
bump version to 0.63.1-1

Signed-off-by: Fabian Grünbichler <debian@fabian.gruenbichler.email>
22 months agoAuto merge of #11257 - arlosi:build-deadlock-1.65.0, r=weihanglo
bors [Thu, 20 Oct 2022 06:00:42 +0000 (06:00 +0000)]
Auto merge of #11257 - arlosi:build-deadlock-1.65.0, r=weihanglo

[BETA-1.65] Fix deadlock when build scripts are waiting for input on stdin

Beta backport of #11205. Cherry picked d51ed05324d2bef147ea4bbe8366db2170d0e414.

r? `@ehuss`

22 months agoUse backticks instead of single quotes to fix rustdoc CI
Arlo Siemsen [Wed, 12 Oct 2022 15:07:15 +0000 (10:07 -0500)]
Use backticks instead of single quotes to fix rustdoc CI

23 months agoFix deadlock when build scripts are waiting for input on stdin
Arlo Siemsen [Mon, 10 Oct 2022 15:43:39 +0000 (10:43 -0500)]
Fix deadlock when build scripts are waiting for input on stdin

23 months agoFix FTCBFS: Missing Build-Depends: zlib1g-dev:native
Fabian Grünbichler [Sat, 15 Oct 2022 12:40:48 +0000 (14:40 +0200)]
Fix FTCBFS: Missing Build-Depends: zlib1g-dev:native

patch provided by Helmut Grohne <helmut@subdivi.de>

Signed-off-by: Fabian Grünbichler <debian@fabian.gruenbichler.email>
23 months agoupdate d/copyright
Fabian Grünbichler [Sat, 15 Oct 2022 12:33:41 +0000 (14:33 +0200)]
update d/copyright

Signed-off-by: Fabian Grünbichler <debian@fabian.gruenbichler.email>
23 months agod/lintian-to-copyright: handle new lintian output
Fabian Grünbichler [Sat, 15 Oct 2022 12:33:44 +0000 (14:33 +0200)]
d/lintian-to-copyright: handle new lintian output

Signed-off-by: Fabian Grünbichler <debian@fabian.gruenbichler.email>
23 months agoadd patches for CVE-2022-36113/36114
Fabian Grünbichler [Sat, 15 Oct 2022 12:33:39 +0000 (14:33 +0200)]
add patches for CVE-2022-36113/36114

dropping the src/tools/cargo/ prefix from patch paths, otherwise not
modified.

Signed-off-by: Fabian Grünbichler <debian@fabian.gruenbichler.email>
23 months agod/control: bump libgit2 to 1.5
Fabian Grünbichler [Sat, 15 Oct 2022 12:33:37 +0000 (14:33 +0200)]
d/control: bump libgit2 to 1.5

Signed-off-by: Fabian Grünbichler <debian@fabian.gruenbichler.email>
23 months agodrop patches
Fabian Grünbichler [Sat, 15 Oct 2022 12:33:34 +0000 (14:33 +0200)]
drop patches

these were either applied upstream, fixed otherwise upstream, or applied
via debcargo-conf already.

Signed-off-by: Fabian Grünbichler <debian@fabian.gruenbichler.email>
23 months agoUpdate upstream source from tag 'upstream/0.63.1'
Fabian Grünbichler [Sat, 15 Oct 2022 12:31:44 +0000 (14:31 +0200)]
Update upstream source from tag 'upstream/0.63.1'

Update to upstream version '0.63.1'
with Debian dir fb9f0a951618582a47d39eb77f418cbcb919b064

23 months agoNew upstream version 0.63.1
Fabian Grünbichler [Sat, 15 Oct 2022 12:31:18 +0000 (14:31 +0200)]
New upstream version 0.63.1

23 months agoupdate unsuspicious files
Fabian Grünbichler [Sat, 15 Oct 2022 12:09:38 +0000 (14:09 +0200)]
update unsuspicious files

Signed-off-by: Fabian Grünbichler <debian@fabian.gruenbichler.email>
23 months agoupdate debcargo-conf.patch / make_orig_multi-pre
Fabian Grünbichler [Sat, 15 Oct 2022 12:09:34 +0000 (14:09 +0200)]
update debcargo-conf.patch / make_orig_multi-pre

libgit2-sys is not downloadable for the current cargo version, so pin it
to one that is (and match git2 accordingly).

schannel switched to windows-sys which requires a closer analysis before
being embedded here.

Signed-off-by: Fabian Grünbichler <debian@fabian.gruenbichler.email>
23 months agod/make_orig_multi: don't use legacy GZIP env var
Fabian Grünbichler [Sat, 15 Oct 2022 12:09:29 +0000 (14:09 +0200)]
d/make_orig_multi: don't use legacy GZIP env var

pass gzip commandline directly to tar instead.

Signed-off-by: Fabian Grünbichler <debian@fabian.gruenbichler.email>
23 months agoguesst-crate-copyright: handle missing authors
Fabian Grünbichler [Sat, 15 Oct 2022 12:09:25 +0000 (14:09 +0200)]
guesst-crate-copyright: handle missing authors

Signed-off-by: Fabian Grünbichler <debian@fabian.gruenbichler.email>
23 months agoaudit-vendor-source: support filesystems with small dirs
Fabian Grünbichler [Sat, 15 Oct 2022 12:09:18 +0000 (14:09 +0200)]
audit-vendor-source: support filesystems with small dirs

like ZFS, where the tests also match (some) directories with contents,
which fail to delete and are quite noisy.

Signed-off-by: Fabian Grünbichler <debian@fabian.gruenbichler.email>
2 years agobump version to 0.63.0-1~exp1~bpo11+pve2
Fabian Grünbichler [Thu, 15 Sep 2022 07:38:49 +0000 (09:38 +0200)]
bump version to 0.63.0-1~exp1~bpo11+pve2

Signed-off-by: Fabian Grünbichler <f.gruenbichler@proxmox.com>
2 years agofix CVE-2022-36113/CVE-2022-36114
Fabian Grünbichler [Thu, 15 Sep 2022 07:38:02 +0000 (09:38 +0200)]
fix CVE-2022-36113/CVE-2022-36114

Signed-off-by: Fabian Grünbichler <f.gruenbichler@proxmox.com>
2 years agoAuto merge of #11032 - lqd:priority_pending_queue, r=Eh2406
bors [Tue, 13 Sep 2022 17:49:38 +0000 (17:49 +0000)]
Auto merge of #11032 - lqd:priority_pending_queue, r=Eh2406

Take priority into account within the pending queue

This is the PR for the work discussed in [this zulip thread](https://rust-lang.zulipchat.com/#narrow/stream/246057-t-cargo/topic/pending.20queue.20scheduling.20experiments) and whose detailed description and some results are available [here](https://github.com/lqd/rustc-benchmarking-data/tree/main/experiments/cargo-schedules/pending-queue-sorted) with graphs, summaries and raw data -- much of which was shown in the thread as well.

Units of works have a computed priority that is used in the dependency queue, so that higher priorities are dequeued sooner, as documented [here](https://github.com/rust-lang/cargo/blob/996a6363ce4b9109d4ca757407dd6dcb4805c86f/src/cargo/util/dependency_queue.rs#L34-L35).

This PR further applies that principle to the next step before being executed: if multiple pieces of work are waiting in the pending queue, we can sort that according to their priorities. Here as well, higher priorities should be scheduled sooner.

They are more often than not wider than pure chains of dependencies, and this should create more parallelism opportunities earlier in the pipeline: a high priority piece of work represents more future pieces of work down the line, and try to sustain CPU utilization longer (at the potential cost of this parallelism being distributed differently than today, between cargo invoking rustc and rustc's own codegen threads -- when applicable).

This is a scheduling tradeoff that behaves differently for each project, machine configuration, amount of available parallelism at a given point in time, etc, but seems to help more often than hinders: at low-core counts and with enough units of work to be done, so that there is jobserver token contention where choosing a "better" piece of work to work on next may be possible.

There's of course a bit of noise in the results linked above and 800 or so of the most popular crates.io crates is still a limited sample, but they're mostly meant to show a hopefully positive trend: while there are improvements and regressions, that trend looks to be more positive than negative, with the wins being more numerous and with higher amplitudes than the corresponding losses.

(A report on another scheduling experiment -- a superset of this PR, where I also simulate users manually giving a higher priority to `syn`, `quote`, `serde_derive` -- [is available here](https://github.com/lqd/rustc-benchmarking-data/tree/main/experiments/cargo-schedules/pending-queue-prioritized) and also improves this PR's results: the regressions are decreased in number and amplitude, whereas the improvements are bigger and more numerous. So that could be further work to iterate upon this one)

Since this mostly applies to clean builds, for low core counts, and with a sufficient number of dependencies to have some items in the pending queue, I feel this also applies well to CI use-cases (esp. on the free tiers).

Somewhat reassuring as well, and discussed in the thread but not in the report: I've also tried to make sure cargo and bootstrapping rustc are not negatively affected. cargo saw some improvements, and bootstrap stayed within today's variance of +/- 2 to 3%. Similarly, since 3y old versions of some tokio crates (`0.2.0-alpha.1`) were the most negatively affected, I've also checked that recent tokio versions (`1.19`) are not disproportionately impacted: their simple readme example, the more idiomatic `mini-redis` sample, and some of my friends' tokio projects were either unaffected or saw some interesting improvements.

And here's a `cargo check -j2` graph to liven up this wall of text:

![some results of `cargo check -j2`](https://github.com/lqd/rustc-benchmarking-data/raw/main/experiments/cargo-schedules/pending-queue-sorted/images/check-j2-sorted.png)

---

I'm not a cargo expert so I'm not sure whether it would be preferable to integrate priorities deeper than just the dependency queue, and e.g. have `Unit`s contain a dedicated field or similar. So in the meantime I've done the simplest thing: just sort the pending queue and ask the units' priorities to the dep queue.

We could just as well have the priority recorded as part of the pending queue tuples themselves, or have that be some kind of priority queue/max heap instead of a Vec.

Let me know which you prefer, but it's in essence a very simple change as-is.

2 years agoAuto merge of #11075 - epage:feat, r=weihanglo
bors [Tue, 13 Sep 2022 17:08:01 +0000 (17:08 +0000)]
Auto merge of #11075 - epage:feat, r=weihanglo

fix(add): Clarify which version the features are added for

### What does this PR try to resolve?

This gives a hint to users that we might not be showing the feature list
for the latest version but the earliest version.

Also when using a workspace dependency, this is a good reminder of what the version requirement is that was selected.  That could also be useful for reused dependencies but didn't want to bother with the relevant plumbing for that.

ie we are going from
```console
$ cargo add chrono@0.4
    Updating crates.io index
      Adding chrono v0.4 to dependencies.
             Features:
             - rustc-serialize
             - serde
```
to
```console
$ cargo add chrono@0.4
    Updating crates.io index
      Adding chrono v0.4 to dependencies.
             Features as of v0.4.2:
             - rustc-serialize
             - serde
```

### How should we test and review this PR?

I'd recommend looking at this commit-by-commit.  This is broken up into several refactors leading up the main change.  The refactors are focused on pulling UI logic out of dependency editing so we can more easily evolve the UI without breaking the editing API.  I then tweaked the behavior in the final commit to be less redundant / noisy.

The existing tests are used to demonstrate this is working.

### Additional information

I'm also mixed on whether the meta version should show up.

Fixes #11073

2 years agoAuto merge of #11079 - weihanglo:issue-10991, r=epage
bors [Tue, 13 Sep 2022 16:20:12 +0000 (16:20 +0000)]
Auto merge of #11079 - weihanglo:issue-10991, r=epage

doc: clarify config-relative paths for `--config <path>`

2 years agostyle(add): Use implicit argument capture
Ed Page [Tue, 13 Sep 2022 16:18:00 +0000 (11:18 -0500)]
style(add): Use implicit argument capture

2 years agochore: Document new add implementation
Ed Page [Tue, 13 Sep 2022 16:17:29 +0000 (11:17 -0500)]
chore: Document new add implementation

2 years agoCall out rule of relative path of `--config KEY=VALUE`
Weihang Lo [Tue, 13 Sep 2022 15:46:08 +0000 (16:46 +0100)]
Call out rule of relative path of `--config KEY=VALUE`

2 years agoAuto merge of #11023 - dpc:cargo-cmd-path-order, r=epage
bors [Tue, 13 Sep 2022 15:09:18 +0000 (15:09 +0000)]
Auto merge of #11023 - dpc:cargo-cmd-path-order, r=epage

Do not add home bin path to PATH if it's already there

This is to allow users to control the order via PATH if they so desire.

Tested by preparing two different `cargo-foo` scripts in `$HOME/.cargo/bin` and `$HOME/bin`:

```
> env PATH="/usr/bin/:$HOME/bin:$HOME/.cargo/bin" ./target/debug/cargo foo
Inside ~/bin/
> env PATH="$HOME/.cargo/bin:/usr/bin/:$HOME/bin" ./target/debug/cargo foo
Inside ~/.cargo/bin/
> env PATH="/usr/bin/:$HOME/bin" ./target/debug/cargo foo
Inside ~/.cargo/bin/
```

and trailing slash:

```
> env PATH="$HOME/.cargo/bin/:/usr/bin/:$HOME/bin" ./target/debug/cargo foo
Inside ~/.cargo/bin/
> env PATH="/usr/bin/:$HOME/bin:$HOME/.cargo/bin/" ./target/debug/cargo foo
Inside ~/bin/
```

Fix https://github.com/rust-lang/cargo/issues/11020

2 years agorefactor(add): Clarify DepednencyEx's name
Ed Page [Tue, 13 Sep 2022 14:52:37 +0000 (09:52 -0500)]
refactor(add): Clarify DepednencyEx's name

2 years agoAuto merge of #11081 - WaffleLapkin:no_for_in_option, r=epage
bors [Tue, 13 Sep 2022 14:30:07 +0000 (14:30 +0000)]
Auto merge of #11081 - WaffleLapkin:no_for_in_option, r=epage

Don't use `for` loop on an `Option`

This PR removes a single `for` loop over `Option`, replacing it with an `if let` to improve code clarity. This currently blocks https://github.com/rust-lang/rust/pull/99696 that adds a lint against this pattern.

2 years agoAuto merge of #11080 - hi-rustin:rustin-patch-dead-code, r=epage
bors [Tue, 13 Sep 2022 13:51:57 +0000 (13:51 +0000)]
Auto merge of #11080 - hi-rustin:rustin-patch-dead-code, r=epage

Remove dead code

### What does this PR try to resolve?

Remove the dead code. I found it when I tried to build cargo.

r? `@epage`

2 years agoDon't use `for` loop on an `Option`
Maybe Waffle [Tue, 13 Sep 2022 13:20:19 +0000 (17:20 +0400)]
Don't use `for` loop on an `Option`

2 years agoClarify config-relative paths for `--config <path>`
Weihang Lo [Tue, 13 Sep 2022 08:25:13 +0000 (09:25 +0100)]
Clarify config-relative paths for `--config <path>`

2 years agoRemove dead code
hi-rustin [Tue, 13 Sep 2022 12:48:26 +0000 (20:48 +0800)]
Remove dead code

Signed-off-by: hi-rustin <rustin.liu@gmail.com>
2 years agoExpand details for `--config` cli arg
Weihang Lo [Tue, 13 Sep 2022 08:54:33 +0000 (09:54 +0100)]
Expand details for `--config` cli arg

2 years agofix(add): Remove redundant version in build metadata cases
Ed Page [Mon, 12 Sep 2022 14:51:38 +0000 (09:51 -0500)]
fix(add): Remove redundant version in build metadata cases

2 years agofix(add): Limit 'Features as of vX.Y.Z' to when relevant
Ed Page [Mon, 12 Sep 2022 14:46:22 +0000 (09:46 -0500)]
fix(add): Limit 'Features as of vX.Y.Z' to when relevant

This will only show the messaeg if we didn't already show a version req
with full precision specified ... mostly.  We'll also skip it if its a
local or git dependency but we never show the version in those cases
because it doesn't matter.

The `precise_version` logic came from cargo-upgrade.

2 years agofix(add): Clarify which version the features are added for
Ed Page [Mon, 12 Sep 2022 14:37:05 +0000 (09:37 -0500)]
fix(add): Clarify which version the features are added for

This gives a hint to users that we might not be showing the feature list
for the latest version but the earliest version.

Also when using a workspace dependency or re-using an existing
dependency, this is a good reminder of what the version requirement is
that was selected.

However, when the user or add (the common case) selected a full
precision requirement, this is redundant.

I'm also mixed on whether the meta version should show up.

Fixes #11073

2 years agorefactor(add): Make it easier to add more summary info
Ed Page [Mon, 12 Sep 2022 14:26:14 +0000 (09:26 -0500)]
refactor(add): Make it easier to add more summary info

2 years agorefactor(add): Pull UI concerns out of edit logic
Ed Page [Mon, 12 Sep 2022 14:22:24 +0000 (09:22 -0500)]
refactor(add): Pull UI concerns out of edit logic

2 years agorefactor(add): Consolidate looking up available features
Ed Page [Mon, 12 Sep 2022 14:18:15 +0000 (09:18 -0500)]
refactor(add): Consolidate looking up available features

This optimization doesn't really make a difference and it makes it
harder to separate UI / edit concerns.

2 years agorefactor(add): Decouple available features from inheritance
Ed Page [Mon, 12 Sep 2022 14:11:14 +0000 (09:11 -0500)]
refactor(add): Decouple available features from inheritance

2 years agostyle(add): Clean up Context import
Ed Page [Mon, 12 Sep 2022 13:59:10 +0000 (08:59 -0500)]
style(add): Clean up Context import

2 years agoAuto merge of #11068 - arlosi:progress, r=epage
bors [Fri, 9 Sep 2022 21:31:22 +0000 (21:31 +0000)]
Auto merge of #11068 - arlosi:progress, r=epage

Change progress indicator for sparse registries

The progress indicator for sparse registries previously could go backwards as new dependencies are discovered, which confused users.

The new indicator looks like this:
```
    Updating crates.io index
       Fetch [====================>            ] 46 complete; 29 pending
```

The progress bar percentage is based the current depth in the dependency tree, with a hard coded limit at `10/11`. This provides natural feeling progress for many projects that I tested.

`complete` represents the number of index files downloaded, `pending` represents the number of index files that Cargo knows need to be downloaded but have not yet finished.

Fixes #10820

2 years agoChange progress indicator for sparse registries
Arlo Siemsen [Fri, 9 Sep 2022 20:14:02 +0000 (15:14 -0500)]
Change progress indicator for sparse registries

It's now based on an estimate of the depth of the dependency tree, so the progress bar
will never go backwards.

2 years agoAuto merge of #11055 - epage:docs, r=ehuss
bors [Fri, 9 Sep 2022 00:16:27 +0000 (00:16 +0000)]
Auto merge of #11055 - epage:docs, r=ehuss

chore(ci): Ensure intradoc links are valid

The plan is to move the architecture documents over to rustdoc so they can more easily stay up-to-date.  To do so, we'll need to enforce that the intradoc links stay valid.

As part of this, the PR run for `cargo doc` was updated to the command in #11019

2 years agoDo not add home bin path to PATH if it's already there
Dawid Ciężarkiewicz [Thu, 25 Aug 2022 19:15:34 +0000 (12:15 -0700)]
Do not add home bin path to PATH if it's already there

This is to allow users to control the order via PATH if they so desire.

Fix #11020

2 years agoAuto merge of #11044 - Eh2406:file_hash, r=weihanglo
bors [Thu, 8 Sep 2022 01:14:07 +0000 (01:14 +0000)]
Auto merge of #11044 - Eh2406:file_hash, r=weihanglo

Cache index files based on contents hash

Since #10507 Cargo has known how to read registry cached files whose index version starts with the hash of the file contents. Git makes it very cheap to determine the hash of a file. This PR switches cargo to start writing the new format.

Cargoes from before #10507 will not know how to read, and therefore overwrite, cached files written by Cargos after this PR.

Cargos after this PR can still read, and will consider up-to-date cached files written by all older Cargos.

As I'm writing this out I'm thinking that there may not be any point in writing a file that has both. An alternative implementation just writes the file contents hash. 🤔

2 years agoAuto merge of #11051 - EstebanBorai:fix/specify-crate-name-maxlength, r=weihanglo
bors [Thu, 8 Sep 2022 00:35:22 +0000 (00:35 +0000)]
Auto merge of #11051 - EstebanBorai:fix/specify-crate-name-maxlength, r=weihanglo

fix: specifies the max length for crate name

Provides the maximum length on the crate name as is defined
in the [crate's validation source code from crates.io][1].

[1]: https://github.com/rust-lang/crates.io/blob/3fc08ba57e782cff422a2f92503f09287d1a5140/src/models/krate.rs#L74

2 years agochore(ci): Ensure intradoc links are valid
Ed Page [Tue, 6 Sep 2022 14:19:03 +0000 (09:19 -0500)]
chore(ci): Ensure intradoc links are valid

2 years agofix: remove wrapping for sentence
Esteban Borai [Tue, 6 Sep 2022 01:01:56 +0000 (21:01 -0400)]
fix: remove wrapping for sentence

2 years agofix: add periods to list items
Esteban Borai [Tue, 6 Sep 2022 00:57:30 +0000 (21:57 -0300)]
fix: add periods to list items

Co-authored-by: Weihang Lo <weihanglo@users.noreply.github.com>
2 years agofix: list under restrictions
Esteban Borai [Sun, 4 Sep 2022 19:53:16 +0000 (15:53 -0400)]
fix: list under restrictions

2 years agofix: specifies the max length for crate name
Esteban Borai [Sun, 4 Sep 2022 18:46:50 +0000 (14:46 -0400)]
fix: specifies the max length for crate name

Provides the maximum length on the crate name as is defined
in the [crate's validation source code from crates.io][1].

[1]: https://github.com/rust-lang/crates.io/blob/3fc08ba57e782cff422a2f92503f09287d1a5140/src/models/krate.rs#L74

2 years agostore jobs priorities in the pending queue
Rémy Rakic [Fri, 2 Sep 2022 15:55:42 +0000 (17:55 +0200)]
store jobs priorities in the pending queue

This cleans up the priority-sorted scheduling by removing the need
for a priority accessor that would hash the nodes, and allows inserting
in the queue at the correctly sorted position to remove the insert +
sort combination.

2 years agosort the pending queue according to cost/priority
Rémy Rakic [Mon, 29 Aug 2022 14:24:17 +0000 (16:24 +0200)]
sort the pending queue according to cost/priority

If multiple pieces of work are waiting in the pending queue, we can sort it according to
their priorities: higher priorities should be scheduled sooner.

They are more often than not wider than pure chains, and this should create more parallelism
opportunities earlier in the pipeline: a high priority piece of work represents more future
pieces of work down the line.

This is a scheduling tradeoff that behaves differently for each project, machine configuration,
amount of available parallelism at a given point in time, etc, but seems to help more often than
hinders, at low-core counts and with enough units of work to be done, so that there is jobserver
token contention where choosing a "better" piece of work to work on next is possible.

2 years agoonly wright contents hash
Jacob Finkelman [Thu, 1 Sep 2022 20:08:14 +0000 (20:08 +0000)]
only wright contents hash

2 years agoAuto merge of #10511 - weihanglo:issue-10477, r=ehuss
bors [Fri, 2 Sep 2022 14:29:28 +0000 (14:29 +0000)]
Auto merge of #10511 - weihanglo:issue-10477, r=ehuss

Support inheriting jobserver fd for external subcommands

2 years agoCache based on contents hash
Jacob Finkelman [Thu, 1 Sep 2022 19:47:52 +0000 (19:47 +0000)]
Cache based on contents hash

2 years agoAuto merge of #11029 - epage:config, r=weihanglo
bors [Thu, 1 Sep 2022 06:05:27 +0000 (06:05 +0000)]
Auto merge of #11029 - epage:config, r=weihanglo

refactor(cli): Lazy load config

This is trying to clarify `-C` support when it is implemented in #10952

Cargo currently has two initialization states for Config, `Config::default` (process start) and `config.configure` (after parsing args).  The most help we provide for a developer touching this code is a giant `CAUTION` comment in one of the relevant functions.

Currently, #10952 adds another configuration state in the middle where the `current_dir` has been set.

The goal of this PR is to remove that third configuration state by
- Lazy loading `Config::default` so it can be called after parsing `-C`
- Allowing `-C` support to assert that the config isn't loaded yet to catch bugs with it

The hope is this will make the intent of the code clearer and reduce the chance for bugs.

In doing this, there are two intermediate refactorings
- Make help behave like other subcommands
  - Before, we had hacks to intercept raw arguments and to intercept clap errors and assume what their intention was to be able to implement our help system.
  - This flips it around and makes help like any other subcommand,
simplifying cargo initialization.
  - We had to upgrade clap because this exposed a bug where `Command::print_help` wasn't respecting `disable_colored_help(true)`
- Delay fix's access to config

Personally, I also find both changes make the intent of the code clearer.

To review this, I recommend looking at the individual commits.   As this is just refactors, this has no impact on testing.

2 years agorefactor(cli): Lazily do first-pass config loading
Ed Page [Mon, 29 Aug 2022 17:06:19 +0000 (12:06 -0500)]
refactor(cli): Lazily do first-pass config loading

This will be a help for cases like #10952 which I would expect would
assert that the config is not loaded before changing the current_dir.

2 years agorefactor(cli): Delay fix's access to config
Ed Page [Mon, 29 Aug 2022 16:46:54 +0000 (11:46 -0500)]
refactor(cli): Delay fix's access to config

My hope is to make it so we can lazy load the config.  This makes it so
we only load the config for the fix proxy if needed.

I also feel like this better clarifies the intention of the code that we
are running in a special mode.

2 years agorefactor(cli): Make help behave like other subcommands
Ed Page [Mon, 29 Aug 2022 16:29:11 +0000 (11:29 -0500)]
refactor(cli): Make help behave like other subcommands

Before, we had hacks to intercept raw arguments and to intercept clap
errors and assume what their intention was to be able to implement our
help system.

This flips it around and makes help like any other subcommand,
simplifying cargo initialization.

2 years agoAuto merge of #11040 - epage:confusion, r=ehuss
bors [Thu, 1 Sep 2022 00:00:35 +0000 (00:00 +0000)]
Auto merge of #11040 - epage:confusion, r=ehuss

chore: Don't show genned docs in ripgrep

The goal is to help new (and existing) users more quickly find the
appropriate files to edit (like in #11033).  The main downside is for
someone trying to find output to verify what it looks like, a simple
search won't turn up results but there are other ways around that
(`--no-ignore`, `git status` after doing a man generation, etc).

2 years agoAuto merge of #11019 - weihanglo:doc-private-items-cargo-itself, r=epage
bors [Wed, 31 Aug 2022 21:57:00 +0000 (21:57 +0000)]
Auto merge of #11019 - weihanglo:doc-private-items-cargo-itself, r=epage

Document private items for Cargo and publish under contributor guide

2 years agoAuto merge of #11039 - ehuss:ci-names, r=epage
bors [Wed, 31 Aug 2022 21:14:13 +0000 (21:14 +0000)]
Auto merge of #11039 - ehuss:ci-names, r=epage

Add names to CI jobs

This adds names to the CI jobs. I've often found the existing auto-generated names to be confusing, and I think it would help to make them a little more succinct and clearer.

Before:
<img width="314" alt="image" src="https://user-images.githubusercontent.com/43198/187777515-6237f765-d747-4d74-8e06-baa86fbe8b2f.png">

After:
<img width="295" alt="image" src="https://user-images.githubusercontent.com/43198/187777559-6e21f08a-cf4c-4aaf-86ba-201bdd90c84f.png">

2 years agochore: Don't show genned docs in ripgrep
Ed Page [Wed, 31 Aug 2022 21:11:36 +0000 (16:11 -0500)]
chore: Don't show genned docs in ripgrep

The goal is to help new (and existing) users more quickly find the
appropriate files to edit (like in #11033).  The main downside is for
someone trying to find output to verify what it looks like, a simple
search won't turn up results but there are other ways around that
(`--no-ignore`, `git status` after doing a man generation, etc).

2 years agoAdd names to CI jobs
Eric Huss [Wed, 31 Aug 2022 20:36:42 +0000 (13:36 -0700)]
Add names to CI jobs

2 years agoAuto merge of #11028 - ehuss:test-errors, r=weihanglo
bors [Tue, 30 Aug 2022 22:59:43 +0000 (22:59 +0000)]
Auto merge of #11028 - ehuss:test-errors, r=weihanglo

Rework test error handling

This reworks how errors are handled when running tests and benchmarks. There were some cases where Cargo was eating the actual error and not displaying it. For example, if a test process fails to launch, it only displayed the `could not execute process` message, but didn't explain why it failed to execute. This fixes it to ensure that the full error chain is displayed.

This also tries to simplify how the errors are handled, and makes them more uniform across `test` and `bench`, and with doctests.

This also changes the `--no-fail-fast` behavior to report errors as they happen instead of grouped at the end (and prints a summary at the end). This helps to make it clearer when a nonstandard error happens. For example, before:

```
     Running tests/t1.rs (target/debug/deps/t1-bb449dfa37379ba1)

running 1 test
     Running tests/t2.rs (target/debug/deps/t2-1770ae8367bc97ce)

running 1 test
test bar ... FAILED

failures:

---- bar stdout ----
thread 'bar' panicked at 'y', tests/t2.rs:3:5
note: run with `RUST_BACKTRACE=1` environment variable to display a backtrace

failures:
    bar

test result: FAILED. 0 passed; 1 failed; 0 ignored; 0 measured; 0 filtered out; finished in 0.00s

error: test failed.

Caused by:
  process didn't exit successfully: `/Users/eric/Temp/z12/target/debug/deps/t1-bb449dfa37379ba1` (signal: 11, SIGSEGV: invalid memory reference)
  process didn't exit successfully: `/Users/eric/Temp/z12/target/debug/deps/t2-1770ae8367bc97ce` (exit status: 101)
```

and the changes to that are:

```diff
`@@` -1,6 +1,10 `@@`
      Running tests/t1.rs (target/debug/deps/t1-bb449dfa37379ba1)

 running 1 test
+error: test failed, to rerun pass `--test t1`
+
+Caused by:
+  process didn't exit successfully: `/Users/eric/Temp/z12/target/debug/deps/t1-bb449dfa37379ba1` (signal: 11, SIGSEGV: invalid memory reference)
      Running tests/t2.rs (target/debug/deps/t2-1770ae8367bc97ce)

 running 1 test
`@@` -18,8 +22,7 `@@`

 test result: FAILED. 0 passed; 1 failed; 0 ignored; 0 measured; 0 filtered out; finished in 0.00s

-error: test failed.
-
-Caused by:
-  process didn't exit successfully: `/Users/eric/Temp/z12/target/debug/deps/t1-bb449dfa37379ba1` (signal: 11, SIGSEGV: invalid memory reference)
-  process didn't exit successfully: `/Users/eric/Temp/z12/target/debug/deps/t2-1770ae8367bc97ce` (exit status: 101)
+error: test failed, to rerun pass `--test t2`
+error: 2 targets failed:
+    `--test t1`
+    `--test t2`
```

In the first example, when it says `Running tests/t1.rs`, there is no error message displayed until after all the tests finish, and that error message is not associated with the original test. This also includes the "to rerun" hint with `--no-fail-fast`.

2 years agoAuto merge of #11033 - buggymcbugfix:buggymcbugfix/cargo-add-docs, r=epage
bors [Tue, 30 Aug 2022 21:50:14 +0000 (21:50 +0000)]
Auto merge of #11033 - buggymcbugfix:buggymcbugfix/cargo-add-docs, r=epage

Very slight `cargo add` documentation improvements

As discussed in https://github.com/rust-lang/book/pull/3331, a quick explanation of the `Features` part of the message that gets printed to stdout when adding some dependency.

Consider the following example:

```
cargo add my-crate
    Updating crates.io index
      Adding my-crate v0.1.0 to dependencies.
             Features:
             + foo
             - bar
```

It was not clear to me what `+foo` and `-bar` meant until `@carols10cents'` kindly explained it to me. Hopefully the documentation now clarifies this.

TODO:

- [x] Run `./build-man.sh`

2 years agoDocument cargo-add's feature message
Vilem Liepelt [Tue, 30 Aug 2022 20:58:34 +0000 (22:58 +0200)]
Document cargo-add's feature message

This refers to the `Features` part of the message that gets printed to
stderr after successfully adding some dependency, e.g.:

```
cargo add my-crate
    Updating crates.io index
      Adding my-crate v0.1.0 to dependencies.
             Features:
             + foo
             - bar
```

This tells us that the `foo` feature is enabled and `bar` is disabled.

2 years agoAuto merge of #11030 - ehuss:update-installation-requirements, r=epage
bors [Tue, 30 Aug 2022 00:26:35 +0000 (00:26 +0000)]
Auto merge of #11030 - ehuss:update-installation-requirements, r=epage

Update compiling requirements.

This updates the requirements for building cargo itself. It adds a little more clarification on exactly what is needed, and what some of the options are.

This may be a little bit too much detail, as usually I suspect most users will just run `cargo build` and follow the error message instructions on what to install next.

2 years agoUpdate compiling requirements.
Eric Huss [Mon, 29 Aug 2022 23:07:17 +0000 (16:07 -0700)]
Update compiling requirements.

2 years agoRework test error handling
Eric Huss [Sun, 28 Aug 2022 00:45:11 +0000 (17:45 -0700)]
Rework test error handling

2 years agoAuto merge of #11027 - tshepang:patch-1, r=ehuss
bors [Sat, 27 Aug 2022 18:41:39 +0000 (18:41 +0000)]
Auto merge of #11027 - tshepang:patch-1, r=ehuss

doc: pause, for readability

2 years agopause, for readability
Tshepang Mbambo [Sat, 27 Aug 2022 17:57:40 +0000 (19:57 +0200)]
pause, for readability

2 years agoAuto merge of #11004 - jonhoo:bump-git2, r=weihanglo
bors [Sat, 27 Aug 2022 09:22:12 +0000 (09:22 +0000)]
Auto merge of #11004 - jonhoo:bump-git2, r=weihanglo

Bump git2 to 0.15 and libgit2-sys to 0.14

This will allow cargo to avoid vendored builds of git2 in up-to-date
environments going forward, and brings in the [libgit2 1.4.4 CVE fix].

[libgit2 1.4.4 CVE fix]: https://github.com/libgit2/libgit2/releases/tag/v1.4.4

2 years agoAuto merge of #11025 - hi-rustin:rustin-patch-typo, r=Eh2406
bors [Sat, 27 Aug 2022 04:27:39 +0000 (04:27 +0000)]
Auto merge of #11025 - hi-rustin:rustin-patch-typo, r=Eh2406

Fix typo

Just fix a typo. bacwkards -> backwards

2 years agoFix typo
hi-rustin [Sat, 27 Aug 2022 03:20:52 +0000 (11:20 +0800)]
Fix typo

Signed-off-by: hi-rustin <rustin.liu@gmail.com>