Commit graph

11837 commits

Author SHA1 Message Date
Will Crichton 0a2382b6db Formatting 2021-10-28 00:38:16 -07:00
Will Crichton 11209570c9 Change scraping to apply to all workspace packages instead of just
root units. Only attach Docscrape unit dependencies to workspace Doc
units. Add test for scraping examples with complex reverse dependencies.
2021-10-28 00:35:34 -07:00
Will Crichton 0deeea8312 Remove unnecessary clones, document out_dir 2021-10-27 11:51:13 -07:00
Will Crichton e4a65b91be Fix several bugs when checking wasmtime repo:
* Docscrape unit not having dev-dependencies included
* Sources for reverse-dependencies generated to the wrong directory
* Incorrect features being selected for Docscrape units
* Panics from Docscrape-dependent packages not being available
2021-10-27 11:42:31 -07:00
Hans Kratz b5590cad79 Only run test on 64-bit little endian architectures.
Hash value is different depenidng on bitness and endianess so we
only run this test on 64-bit little endian platforms.
2021-10-25 19:30:00 +02:00
bors 6c1bc24b8b Auto merge of #10002 - TaKO8Ki:fix-clippy-warnings, r=ehuss
Fix a clippy warning

This pull request fixes a clippy warning.
2021-10-24 17:51:41 +00:00
Takayuki Maeda c3eab8d57d fix a clippy warning 2021-10-24 18:27:46 +09:00
bors dc6a1d5304 Auto merge of #10000 - alexcrichton:upgrade-edition, r=Eh2406
Upgrade Cargo to the 2021 edition

While I was poking around in the manifests I also went ahead and removed the `authors` entries since at least the one for Cargo itself is quite outdated and Cargo otherwise doesn't use these any more.
2021-10-23 18:08:27 +00:00
bors e165bc881e Auto merge of #9991 - Byron:fix-test-failure-due-to-echo-resolution, r=joshtriplett
Don't canonicalize executable path

Otherwise symbolic links may also accidentally be resolved which may lead to unexpected results in the case of 'coreutils', a binary that depends on the executable name being a symbolic link.

This means a path like /bin/echo being canonicalized to /bin/coreutils will loose all information about the desired functionality.

For example, test failures will occur if 'echo' is resolved that way and it's not trivial to find the cause of it in the provided error messages.  For example`doc_workspace_open_different_library_and_package_names` did fail for me on MacOS, Nix packages in PATH, but works with this patch.

With this patch, there is still the possibility that a path gets canonicalized for its relative path components, but still results in changing the name of the binary. I could imagine to check for binary name changes and panic if `coreutils` or `busybox` is encountered, which are known to fail without a symlink telling them which program to emulate.
2021-10-23 08:18:01 +00:00
Sebastian Thiel cf8e464d6f
Do not canonicalize the exe-candidate at all
And here is why: https://github.com/rust-lang/cargo/pull/9991#issuecomment-949727679
2021-10-23 15:29:47 +08:00
Alex Crichton cab1e3566b Fix CI testing 2021-10-22 13:30:46 -07:00
Alex Crichton ac69b05500 Update stable rust in the docs CI builder 2021-10-22 10:33:46 -07:00
Alex Crichton c687d83ada Remove authors directives from Cargo crates
Most of these are pretty dated and Cargo defaults nowadays to not
emitting an `authors` field so this commit also removes them from the
manifests.
2021-10-22 10:27:20 -07:00
Alex Crichton cabe1cca0a Upgrade Cargo to the 2021 edition
This didn't actually result in any code changes yet, for now this simply
flips the edition flag for all of our crates and documentation.
2021-10-22 10:25:52 -07:00
bors 50a0af4bfd Auto merge of #9998 - ehuss:version-bump, r=alexcrichton
Bump to 0.59.0, update changelog
2021-10-22 16:05:08 +00:00
Eric Huss 333ee58d24 Update changelog for 1.57 2021-10-22 08:18:25 -07:00
Eric Huss 88117505b8 Bump to 0.59.0 2021-10-22 07:53:17 -07:00
Sebastian Thiel 4906ef2364
Assure the binary name won't change after canonicalization, and keep looking if it does. 2021-10-21 18:21:18 +08:00
Sebastian Thiel 0d06193bf1
Only canonicalize executable path if it has relative directories
Otherwise symbolic links may also accidentally be resolved which may
lead to unexpected results in the case of 'coreutils', a binary
that depends on the executable name being a symbolic link.

This means a path like /bin/echo being canonicalized to /bin/coreutils
will loose all information about the desired functionality.

Test failures will occur if 'echo' is resolved that way and it's
not trivial to find the cause of it in the provided error messages.
2021-10-21 17:03:58 +08:00
bors 7fbbf4e8f2 Auto merge of #9953 - Aaron1011:nicer-incompat-report, r=ehuss
Make future-incompat-report output more user-friendly

When the user enables `--future-incompat-report`, we now display
a high-level summary of the problem, as well as several suggestions
for fixing the affected crates.

The command `cargo report future-incompatibilities` now takes
a `--crate` option, which can be used to display a report
(including the actual lint messages) for a single crate.
When this option is not used, we display the report for all
crates.

Sample output from the `actix` crate:

`> RUSTFLAGS="-Z future-incompat-test" ~/repos/cargo/target/debug/cargo build -Z future-incompat-report
`

```
    Finished dev [unoptimized + debuginfo] target(s) in 2.09s
warning: the following packages contain code that will be rejected by a future version of Rust: actix v0.11.1 (/home/aaron/repos/actix/actix), ahash v0.7.4, arc-swap v0.4.4, autocfg v1.0.0, crossbeam-utils v0.8.5, futures-macro v0.3.17, futures-util v0.3.17, lazy_static v1.4.0, libc v0.2.103, lock_api v0.4.5, log v0.4.8, mio v0.7.13, parking_lot_core v0.8.5, signal-hook-registry v1.2.0, smallvec v1.7.0, syn v1.0.77, tokio v1.12.0, tokio-util v0.6.8, unicode-xid v0.2.0, version_check v0.9.3
note: to see what the problems were, use the option `--future-incompat-report`, or run `cargo report future-incompatibilities --id 2`

```

`> RUSTFLAGS="-Z future-incompat-test" ~/repos/cargo/target/debug/cargo build -Z future-incompat-report --future-incompat-report -Z unstable-options`

```
    Finished dev [unoptimized + debuginfo] target(s) in 2.12s
warning: the following packages contain code that will be rejected by a future version of Rust: actix v0.11.1 (/home/aaron/repos/actix/actix), ahash v0.7.4, arc-swap v0.4.4, autocfg v1.0.0, crossbeam-utils v0.8.5, futures-macro v0.3.17, futures-util v0.3.17, lazy_static v1.4.0, libc v0.2.103, lock_api v0.4.5, log v0.4.8, mio v0.7.13, parking_lot_core v0.8.5, signal-hook-registry v1.2.0, smallvec v1.7.0, syn v1.0.77, tokio v1.12.0, tokio-util v0.6.8, unicode-xid v0.2.0, version_check v0.9.3
note:
To solve this problem, you can try the following approaches:

- Some affected dependencies have newer versions available.
You may want to consider updating them to a newer version to see if the issue has been fixed.

ahash v0.7.4 has the following newer versions available: 0.7.5
arc-swap v0.4.4 has the following newer versions available: 0.4.8, 1.1.0, 1.2.0, 1.3.0, 1.3.1, 1.3.2, 1.4.0
autocfg v1.0.0 has the following newer versions available: 1.0.1
log v0.4.8 has the following newer versions available: 0.4.11, 0.4.13, 0.4.14
signal-hook-registry v1.2.0 has the following newer versions available: 1.2.1, 1.2.2, 1.3.0, 1.4.0
syn v1.0.77 has the following newer versions available: 1.0.78, 1.0.79, 1.0.80
unicode-xid v0.2.0 has the following newer versions available: 0.2.1, 0.2.2

- If the issue is not solved by updating the dependencies, a fix has to be
  implemented by those dependencies. You can help with that by notifying the
  maintainers of this problem (e.g. by creating a bug report) or by proposing a
  fix to the maintainers (e.g. by creating a pull request):

  - actix:0.11.1
    - Repository: https://github.com/actix/actix
    - Detailed warning command: `cargo report future-incompatibilities --id 3 --crate "actix:0.11.1"

  - ahash:0.7.4
    - Repository: https://github.com/tkaitchuck/ahash
    - Detailed warning command: `cargo report future-incompatibilities --id 3 --crate "ahash:0.7.4"

  - arc-swap:0.4.4
    - Repository: https://github.com/vorner/arc-swap
    - Detailed warning command: `cargo report future-incompatibilities --id 3 --crate "arc-swap:0.4.4"

  - autocfg:1.0.0
    - Repository: https://github.com/cuviper/autocfg
    - Detailed warning command: `cargo report future-incompatibilities --id 3 --crate "autocfg:1.0.0"

  - crossbeam-utils:0.8.5
    - Repository: https://github.com/crossbeam-rs/crossbeam
    - Detailed warning command: `cargo report future-incompatibilities --id 3 --crate "crossbeam-utils:0.8.5"

  - futures-macro:0.3.17
    - Repository: https://github.com/rust-lang/futures-rs
    - Detailed warning command: `cargo report future-incompatibilities --id 3 --crate "futures-macro:0.3.17"

  - futures-util:0.3.17
    - Repository: https://github.com/rust-lang/futures-rs
    - Detailed warning command: `cargo report future-incompatibilities --id 3 --crate "futures-util:0.3.17"

  - lazy_static:1.4.0
    - Repository: https://github.com/rust-lang-nursery/lazy-static.rs
    - Detailed warning command: `cargo report future-incompatibilities --id 3 --crate "lazy_static:1.4.0"

  - libc:0.2.103
    - Repository: https://github.com/rust-lang/libc
    - Detailed warning command: `cargo report future-incompatibilities --id 3 --crate "libc:0.2.103"

  - lock_api:0.4.5
    - Repository: https://github.com/Amanieu/parking_lot
    - Detailed warning command: `cargo report future-incompatibilities --id 3 --crate "lock_api:0.4.5"

  - log:0.4.8
    - Repository: https://github.com/rust-lang/log
    - Detailed warning command: `cargo report future-incompatibilities --id 3 --crate "log:0.4.8"

  - mio:0.7.13
    - Repository: https://github.com/tokio-rs/mio
    - Detailed warning command: `cargo report future-incompatibilities --id 3 --crate "mio:0.7.13"

  - parking_lot_core:0.8.5
    - Repository: https://github.com/Amanieu/parking_lot
    - Detailed warning command: `cargo report future-incompatibilities --id 3 --crate "parking_lot_core:0.8.5"

  - signal-hook-registry:1.2.0
    - Repository: https://github.com/vorner/signal-hook
    - Detailed warning command: `cargo report future-incompatibilities --id 3 --crate "signal-hook-registry:1.2.0"

  - smallvec:1.7.0
    - Repository: https://github.com/servo/rust-smallvec
    - Detailed warning command: `cargo report future-incompatibilities --id 3 --crate "smallvec:1.7.0"

  - syn:1.0.77
    - Repository: https://github.com/dtolnay/syn
    - Detailed warning command: `cargo report future-incompatibilities --id 3 --crate "syn:1.0.77"

  - tokio:1.12.0
    - Repository: https://github.com/tokio-rs/tokio
    - Detailed warning command: `cargo report future-incompatibilities --id 3 --crate "tokio:1.12.0"

  - tokio-util:0.6.8
    - Repository: https://github.com/tokio-rs/tokio
    - Detailed warning command: `cargo report future-incompatibilities --id 3 --crate "tokio-util:0.6.8"

  - unicode-xid:0.2.0
    - Repository: https://github.com/unicode-rs/unicode-xid
    - Detailed warning command: `cargo report future-incompatibilities --id 3 --crate "unicode-xid:0.2.0"

  - version_check:0.9.3
    - Repository: https://github.com/SergioBenitez/version_check
    - Detailed warning command: `cargo report future-incompatibilities --id 3 --crate "version_check:0.9.3"

- If waiting for an upstream fix is not an option, you can use the `[patch]`
  section in `Cargo.toml` to use your own version of the dependency. For more
  information, see:
  https://doc.rust-lang.org/cargo/reference/overriding-dependencies.html#the-patch-section

note: this report can be shown with `cargo report future-incompatibilities -Z future-incompat-report --id 3`
```

`> RUSTFLAGS="-Z future-incompat-test" ~/repos/cargo/target/debug/cargo report future-incompatibilities -Z future-incompat-report --color never | head -n 100`

```
The following warnings were discovered during the build. These warnings are an
indication that the packages contain code that will become an error in a
future release of Rust. These warnings typically cover changes to close
soundness problems, unintended or undocumented behavior, or critical problems
that cannot be fixed in a backwards-compatible fashion, and are not expected
to be in wide use.

Each warning should contain a link for more information on what the warning
means and how to resolve it.

- Some affected dependencies have newer versions available.
You may want to consider updating them to a newer version to see if the issue has been fixed.

ahash v0.7.4 has the following newer versions available: 0.7.5
arc-swap v0.4.4 has the following newer versions available: 0.4.8, 1.1.0, 1.2.0, 1.3.0, 1.3.1, 1.3.2, 1.4.0
autocfg v1.0.0 has the following newer versions available: 1.0.1
log v0.4.8 has the following newer versions available: 0.4.11, 0.4.13, 0.4.14
signal-hook-registry v1.2.0 has the following newer versions available: 1.2.1, 1.2.2, 1.3.0, 1.4.0
syn v1.0.77 has the following newer versions available: 1.0.78, 1.0.79, 1.0.80
unicode-xid v0.2.0 has the following newer versions available: 0.2.1, 0.2.2

The package `actix v0.11.1 (/home/aaron/repos/actix/actix)` currently triggers the following future incompatibility lints:
> warning: use of deprecated struct `utils::Condition`: Please use tokio::sync::oneshot::Sender instead.
>   --> actix/src/utils.rs:25:9
>    |
> 25 | impl<T> Condition<T>
>    |         ^^^^^^^^^
>    |
> note: the lint level is defined here
>   --> actix/src/lib.rs:30:10
>    |
> 30 | #![allow(deprecated)]
>    |          ^^^^^^^^^^
>
> warning: use of deprecated struct `utils::Condition`: Please use tokio::sync::oneshot::Sender instead.
>   --> actix/src/utils.rs:42:21
>    |
> 42 | impl<T> Default for Condition<T>
>    |                     ^^^^^^^^^
>
> warning: use of deprecated struct `utils::Condition`: Please use tokio::sync::oneshot::Sender instead.
>   --> actix/src/utils.rs:47:9
>    |
> 47 |         Condition {
>    |         ^^^^^^^^^
>
> warning: use of deprecated struct `utils::Condition`: Please use tokio::sync::oneshot::Sender instead.
>    --> actix/src/lib.rs:120:28
>     |
> 120 |     pub use crate::utils::{Condition, IntervalFunc, TimerFunc};
>     |                            ^^^^^^^^^
>
> warning: use of deprecated associated function `std::sync::atomic::AtomicUsize::compare_and_swap`: Use `compare_exchange` or `compare_exchange_weak` instead
>    --> actix/src/address/channel.rs:512:49
>     |
> 512 |             let actual = self.inner.num_senders.compare_and_swap(curr, next, SeqCst);
>     |                                                 ^^^^^^^^^^^^^^^^
>
> warning: use of deprecated associated function `std::sync::atomic::AtomicUsize::compare_and_swap`: Use `compare_exchange` or `compare_exchange_weak` instead
>    --> actix/src/address/channel.rs:636:49
>     |
> 636 |             let actual = self.inner.num_senders.compare_and_swap(curr, next, SeqCst);
>     |                                                 ^^^^^^^^^^^^^^^^
>
> warning: use of deprecated associated function `std::sync::atomic::AtomicUsize::compare_and_swap`: Use `compare_exchange` or `compare_exchange_weak` instead
>    --> actix/src/address/channel.rs:697:49
>     |
> 697 |             let actual = self.inner.num_senders.compare_and_swap(curr, next, SeqCst);
>     |                                                 ^^^^^^^^^^^^^^^^
>
> warning: use of deprecated field `utils::Condition::waiters`: Please use tokio::sync::oneshot::Sender instead.
>   --> actix/src/utils.rs:31:9
>    |
> 31 |         self.waiters.push(tx);
>    |         ^^^^^^^^^^^^
>
> warning: use of deprecated field `utils::Condition::waiters`: Please use tokio::sync::oneshot::Sender instead.
>   --> actix/src/utils.rs:36:23
>    |
> 36 |         for waiter in self.waiters {
>    |                       ^^^^^^^^^^^^
>
> warning: use of deprecated field `utils::Condition::waiters`: Please use tokio::sync::oneshot::Sender instead.
>   --> actix/src/utils.rs:48:13
>    |
> 48 |             waiters: Vec::new(),
>    |             ^^^^^^^^^^^^^^^^^^^
>
> warning: unused variable: `ctx`
>   --> actix/src/actor.rs:78:27
>    |
> 78 |     fn started(&mut self, ctx: &mut Self::Context) {}
>    |                           ^^^ help: if this is intentional, prefix it with an underscore: `_ctx`
>    |
> note: the lint level is defined here
>   --> actix/src/actor.rs:72:9
>    |
> 72 | #[allow(unused_variables)]
>    |         ^^^^^^^^^^^^^^^^
```
2021-10-19 02:16:48 +00:00
bors 1e5be5fb8a Auto merge of #9979 - ehuss:git-fetch-force, r=alexcrichton
Fix fetching git repos after a force push.

Users have been reporting that the index has not been updating for them.  This was caused by the update to libgit2 1.3 (from 1.1) which has changed some behavior around force pushes.  The index was squashed on 2021-09-24, and if a user had the index fetched from before that point, and they used nightly-2021-10-14 or newer, then the fetch would succeed, but the `refs/remotes/origin/HEAD` would not get updated.  Cargo uses the `origin/HEAD` ref to know what to look at, and thus was looking at old data.

The solution here is to use `+` on the refspec to force libgit2 to do a forced update (a fast-forward). I think this may have been introduced in libgit2 1.2 via https://github.com/libgit2/libgit2/pull/5854, though that is just a guess.

Fixes #9976
2021-10-18 22:00:14 +00:00
Eric Huss 8d5576ba81 Fix fetching git repos after a force push. 2021-10-18 14:08:33 -07:00
Aaron Hill 7ffba677fd
Run fmt 2021-10-18 12:06:32 -05:00
Aaron Hill 5c3b38086f
Adjust comments 2021-10-18 12:06:23 -05:00
Aaron Hill 958f2fc962
Display more information in report 2021-10-18 12:01:07 -05:00
Aaron Hill 085f04adf9
Adjust suggestions 2021-10-18 11:42:52 -05:00
Aaron Hill f57be6f680
Adjust message and move code to future_incompat module 2021-10-16 12:10:02 -05:00
Will Crichton b948fc86c0 Add test / documentation for scrape-examples cycle-avoidance, add map for doc unit -> metadata to Context 2021-10-14 16:06:26 -07:00
bors bd6a512206 Auto merge of #9916 - chansuke:issue-9895, r=ehuss
Add rustc-link-args to doctest build

Fix #9895
2021-10-14 03:22:12 +00:00
chansuke 2fabe52ccd Add rustc-link-args to doctest build 2021-10-14 10:24:16 +09:00
Will Crichton e52a9d9f69 Add comments and todos 2021-10-13 17:20:16 -07:00
Will Crichton 8b06a0f2f7 Update rustdoc tests with -Cmetadata flag 2021-10-12 19:33:23 -07:00
Will Crichton 17c6df70a1 Remove references to "lib" argument 2021-10-12 19:24:26 -07:00
Will Crichton 470556603e Add documentation and a test 2021-10-12 19:11:07 -07:00
Will Crichton 19c8f05fcc Fix issues compiling build scripts 2021-10-12 17:57:20 -07:00
Aaron Hill 6f18507092
Display update message in report 2021-10-12 17:02:13 -05:00
bors c8b38af5d0 Auto merge of #9955 - ehuss:benchsuite, r=Eh2406
Add the start of a basic benchmarking suite.

This adds the start of a basic benchmarking suite for cargo.  This is fairly rough, but I figure it will change and evolve over time based on what we decide to add and how we use it.

There is some documentation in the `benches/README.md` file which gives an overview of what is here and how to use it.

Closes #9935
2021-10-12 21:59:48 +00:00
Aaron Hill 704540d629
Use double-quotes for package spec 2021-10-12 16:35:02 -05:00
Aaron Hill 5afcce6b3e
Run fmt 2021-10-12 16:35:01 -05:00
Aaron Hill 49ae189b3b
Combined newer versions into single list 2021-10-12 16:35:01 -05:00
Aaron Hill ce259228cd
Change package spec 2021-10-12 16:35:01 -05:00
Aaron Hill 315d605bb3
Rename to per_package 2021-10-12 16:35:01 -05:00
Aaron Hill 20340e1e79
Rename arg and adjust tests 2021-10-12 16:35:01 -05:00
Aaron Hill d5538c3869
Make future-incompat-report output more user-friendly
When the user enables `--future-incompat-report`, we now display
a high-level summary of the problem, as well as several suggestions
for fixing the affected crates.

The command `cargo report future-incompatibilities` now takes
a `--crate` option, which can be used to display a report
(including the actual lint messages) for a single crate.
When this option is not used, we display the report for all
crates.
2021-10-12 16:35:01 -05:00
Will Crichton 223adaca55 Formatting 2021-10-12 14:25:36 -07:00
Will Crichton 8331d7d151 Remove more unused code 2021-10-12 14:22:17 -07:00
Eric Huss e4da5b2e3c Add the start of a basic benchmarking suite. 2021-10-12 13:23:56 -07:00
Will Crichton d29ac156f2 Remove unused code 2021-10-12 13:19:58 -07:00
Will Crichton 70f38213da Change scraping strategy to embed in existing unit graph, add CompileMode::Docscrape 2021-10-12 13:17:40 -07:00
bors ad85ec9fc0 Auto merge of #9970 - ehuss:issue-template-forms, r=alexcrichton
Use forms for issue templates.

This switches the GitHub issue templates to use the new forms functionality.  This makes it so that the user doesn't need to fuss with editing the placeholder text, and instead can just start writing text.

I'm mostly just curious how this will work out. If people have trouble with it, or there are complaints, it can be reverted pretty easily.
2021-10-12 15:11:01 +00:00