Commit Graph

12529 Commits

Author SHA1 Message Date
bors 387270bc7f Auto merge of #11097 - weihanglo:beta-backport-workspace-doc, r=epage
Beta backport #11082
2022-09-16 20:18:27 +00:00
Ed Page a1c48c56fe
docs(ref): Provide path for people to finding why shared Cargo.lock matters 2022-09-16 17:48:37 +01:00
Ed Page 7997f1e9cf
docs(ref): Include workspace inheritane 2022-09-16 17:48:37 +01:00
Ed Page 2bcf1a70b4
docs(ref): Add --workspace as a key point
This is a frequent reason I use them
2022-09-16 17:48:37 +01:00
Ed Page 5b950a3ecf
docs(ref): Remove redundant workspace description 2022-09-16 17:48:37 +01:00
Ed Page cfd1c7eb4a
docs(ref): Move metadata to last 2022-09-16 17:48:37 +01:00
Ed Page 7962dae398
docs(ref): Have workspace docs link out to patch/replace docs
The workspace behavior doesn't seem to be documented at all, so a blurb
was brought in that is like the profile blurb.  The workspace docs then
link out to it so users can be aware of this special workspace behavior.
2022-09-16 17:48:37 +01:00
Ed Page 10c3bea794
docs(ref): Have workspace docs link out to profile section docs
In a workspace, only the workspace's profile is respected.  This is
already documented in the profile documentation but we should raise
visibility of it within the workspace documentation.
2022-09-16 17:48:36 +01:00
Ed Page c0da05502a
docs(ref): Have workspace docs link out to resolver field docs
This is a part of the schema we were missing.  A first step before
encouraging people to use it is to document it!
2022-09-16 17:48:36 +01:00
Ed Page a67c465da2
docs(ref): Re-org workspace docs to be like package docs
In looking over #10625, I remembered we've been having growing pains
with the workspace documentation.  It was originally written when there
were a lot fewer workspace features.  As more workspace features have
been added, they've been tacked on to the documentation.

This re-thinks the documentation by focusing on the schema, much like
`manifest.md` does.
2022-09-16 17:48:36 +01:00
bors 099bd8a7a3 Auto merge of #11090 - weihanglo:ignore-test-on-release-mode, r=epage
[Beta] Run `reach_max_unpack_size` test only on debug build

`cargo test --release` fails on test `reach_max_unpack_size` as the binary to exercise is optimized. The alternative approach is removing `cfg!(debug_assertions)` from this line.
<9ef926dafc/src/cargo/sources/registry/mod.rs (L842)>

#11088
2022-09-15 21:27:14 +00:00
Weihang Lo ef0e888dca
Run `reach_max_unpack_size` test only on debug build 2022-09-15 19:01:13 +01:00
bors 8ddc4223c6 Auto merge of #11088 - pietroalbini:pa-cves-beta, r=weihanglo
[beta] Fix for CVE-2022-36113 and CVE-2022-36114

This PR includes the fixes for CVE-2022-36113 and CVE-2022-36114 targeting the beta branch. See [the advisory](https://blog.rust-lang.org/2022/09/14/cargo-cves.html) for more information about the vulnerabilities.
2022-09-14 14:26:29 +00:00
Pietro Albini ded21affaf
fix formatting 2022-09-14 16:13:31 +02:00
Weihang Lo 481cfccf1e
CVE-2022-36114: add tests 2022-09-14 10:54:35 +02:00
Josh Triplett 2b68d3c07a
CVE-2022-36114: limit the maximum unpacked size of a crate to 512MB
This gives users of custom registries the same protections, using the
same size limit that crates.io uses.

`LimitErrorReader` code copied from crates.io.
2022-09-14 10:54:34 +02:00
Weihang Lo 2bbc8a043e
CVE-2022-36113: add tests 2022-09-14 10:54:33 +02:00
Josh Triplett 15f1e4b0bf
CVE-2022-36113: avoid unpacking .cargo-ok from the crate 2022-09-14 10:54:30 +02:00
bors 4bcb3c65e4 Auto merge of #11002 - Muscraft:fix-unstable-docs-1.64.0, r=weihanglo
beta backport: remove missed reference to workspace inheritance in unstable.md

This is a beta backport of #11001

Currently, on the nightly docs, workspace inheritance is [under the  stable table](https://doc.rust-lang.org/nightly/cargo/reference/unstable.html#workspace-inheritance-1)  and the [unstable table](https://doc.rust-lang.org/nightly/cargo/reference/unstable.html#workspace-inheritance). It looks like I forgot to remove it from the unstable table when working on stabilization.

I think I did this right. If I didn't please let me know!
2022-08-17 21:01:34 +00:00
Scott Schafer c83d734c33 remove missed reference to workspace inheritance in unstable.md 2022-08-17 15:27:46 -05:00
bors ded089921b Auto merge of #10970 - epage:backport, r=ehuss
[BETA 1.64] Only override published resolver when the workspace is different

### What does this PR try to resolve?

Ensures when publishing a package that uses an implicit `resolver = "1"` to maintain an MSRV before the `resolver` key was stabilized the implicitness is retained rather than being turned into an explicit setting.

fixes #10954 (assuming that the workspace and its packages are configured with a consistent resolver)

Note: this is a backport of #10961 to beta
2022-08-11 02:40:32 +00:00
Wim Looman ee4bf08cbc Only override published resolver when the workspace is different 2022-08-10 15:35:19 -05:00
Wim Looman 76713d962f Have `Edition` know what its default resolver behaviour is 2022-08-10 15:35:12 -05:00
bors 4fd148c47e Auto merge of #10934 - ehuss:revert-jobserver, r=epage
Revert "Drop check for mingw32-make."

This reverts 8e35e2f044 which seems to be causing a problem on rust-lang/rust Windows CI. I don't have time to investigate why it is failing right now. The Windows CI runs underneath make itself, so there is some recursive make action going on.  However, I can't tell why that would cause failures. Cargo is behaving as-if it is not running underneath make.

I'll try to do some investigation at a later time, for now I'd like to get the update unblocked.
2022-08-03 15:03:52 +00:00
Eric Huss 8bf7b8b89b Revert "Drop check for mingw32-make."
This reverts commit 8e35e2f044.
2022-08-03 06:59:35 -07:00
bors 333478d0aa Auto merge of #10929 - ehuss:ignore-reason, r=weihanglo
Add reasons to all ignored tests.

This adds a reason string to all `#[ignore]` attributes. This will be displayed when running the test (since 1.61), which can help quickly see and identify why tests are being ignored. It looks roughly like:

```
test basic ... ignored, requires nightly, CARGO_RUN_BUILD_STD_TESTS must be set
test build::simple_terminal_width ... ignored, --diagnostic-width is stabilized in 1.64
test check_cfg::features_with_cargo_check ... ignored, --check-cfg is unstable
test plugins::panic_abort_plugins ... ignored, requires rustc_private
```
2022-08-03 03:54:05 +00:00
bors 9803862d16 Auto merge of #10933 - LPardue:cargo-patch-misspell-grammar, r=ehuss
Grammar fixup unused patch message

This is a minor grammar fixup to to message printed when patch source URLs mismatch (introduced in #10130).
2022-08-03 02:17:36 +00:00
lucas 02e606d799 Grammar fixup unused patch message 2022-08-03 02:22:50 +01:00
bors 5514f1e0e1 Auto merge of #10931 - ehuss:ignore-hg, r=weihanglo
Always allow hg to be missing on CI.

`hg` isn't installed on rust-lang/rust Docker images, which causes this check to fail.

Rather than trying to carefully enforce the requirements for `hg` being tested, this just ignores the test if it is unavailable on CI. I think this is something that can be revisited if Cargo ever gains more hg support.
2022-08-02 22:51:23 +00:00
Eric Huss a8e285aa18 Always allow hg to be missing on CI. 2022-08-02 15:18:16 -07:00
Eric Huss 7eb007ddbf Add reasons to all ignored tests. 2022-08-02 12:24:00 -07:00
bors 0fb9e85e45 Auto merge of #10918 - ehuss:fix-formats_source, r=Eh2406
Fix formats_source test requiring rustfmt.

The requirements added in #9892 that `rustfmt` must be present doesn't work in the `rust-lang/rust` environment. There are two issues:

* Cargo is run without using rustup. If you also have rustup installed, the test will fail because the `rustfmt` binary found in `PATH` will fail to choose a toolchain because HOME points to the sandbox home which does not have a rustup configuration.
* rust-lang/rust CI uninstalls rustup, and does not have rustfmt in PATH at all.  It is not practical to make rustfmt available there.

The solution here is to just revert the behavior back to where it was where it checks if it can run `rustfmt` in the sandbox. This should work for anyone who has a normal rustup installation (including Cargo's CI). If running the testsuite without rustup, then the test will be skipped.

This also includes a small enhancement to provide better error information when rustfmt fails.
2022-08-02 14:41:51 +00:00
bors b1dc94de9e Auto merge of #10921 - ehuss:disable-scrape_examples_complex_reverse_dependencies, r=Eh2406
Disable scrape_examples_complex_reverse_dependencies

The test `scrape_examples_complex_reverse_dependencies` no longer works on the latest nightly. It fails with the error:

```
error[E0433]: failed to resolve: could not resolve path `a::f`
 --> examples/ex.rs:1:13
  |
1 | fn main() { a::f(); }
  |             ^^^^ could not resolve path `a::f`
  |
  = note: this error was originally ignored because you are running `rustdoc`
  = note: try running again with `rustc` or `cargo check` and you may get a more detailed error

error: Compilation failed, aborting rustdoc

For more information about this error, try `rustc --explain E0433`.
error: could not document `foo`
```

It is not clear to me what this test was trying to exercise, so I'm not sure how to fix it.  It has an example that is trying to call a function from a proc-macro, but proc-macros do not export functions.

Disabling for now to get CI passing.

cc `@willcrichton`
2022-08-02 13:59:13 +00:00
Eric Huss e8d92919cf Disable scrape_examples_complex_reverse_dependencies 2022-08-02 06:57:34 -07:00
Eric Huss f62ce1e3e2 Provide better error information if rustfmt fails.
This uses ProcessBuilder which provides much better error information
(stdout and stderr).  It's also less code, which is a bonus.
2022-08-01 21:23:17 -07:00
Eric Huss 15f9c2dc06 Fix formats_source test requiring rustfmt. 2022-08-01 21:07:19 -07:00
bors 3ccf7dc93b Auto merge of #10916 - ehuss:contrib-shortcuts, r=weihanglo
Contrib: Add docs on the rustbot ready command

This adds some brief docs on the use of ``@rustbot`` [shortcuts](https://github.com/rust-lang/triagebot/wiki/Shortcuts).
2022-08-01 04:50:41 +00:00
Eric Huss a9ece2518c Contrib: Add docs on the rustbot ready command 2022-07-31 20:53:59 -07:00
bors 223e84a981 Auto merge of #10844 - yerke:yerke/negative_jobs, r=ehuss
Support for negative --jobs parameter, counting backwards from max CPUs

Fixes #9217.

Continuation of https://github.com/rust-lang/cargo/pull/9221.
2022-08-01 03:41:10 +00:00
Yerkebulan Tulibergenov 767368fd02 Merge branch 'master' into yerke/negative_jobs 2022-07-31 18:21:33 -07:00
bors 2e35678c39 Auto merge of #9892 - ehuss:cargo_test-ignore-reason, r=weihanglo
Add requirements to cargo_test.

This extends the `#[cargo_test]` attribute to support some additional requirements to control whether or not a test can run. The motivation for this is:

* Can more clearly see when a test is disabled when it prints "ignored"
* Can more easily scan for disabled tests when I do version bumps to see which ones should be enabled on stable (to pass on CI).

The form is a comma separated list of requirements, and if they don't pass the test is ignored.  The requirements can be:

* `nightly` — The test only runs on nightly.
* `>=1.55` — The test only runs on rustc with the given version or newer.
* `requires_git` — Requires the given command to be installed.  Can be things like `requires_rustfmt` or `requires_hg`, etc.

This also enforces that the author must write a reason why it is ignored (for some of the requirements) so that when I look for tests to update, I know why it is disabled.

This also removes the `CARGO_TEST_DISABLE_GIT_CLI` option, which appears to no longer be necessary since we have migrated to GitHub Actions.
2022-08-01 00:51:01 +00:00
Eric Huss 8e35e2f044 Drop check for mingw32-make.
From what I can tell, it is no longer necessary on GitHub Actions.
This removes it to help simplify things.
2022-07-31 16:06:25 -07:00
Eric Huss 7858bebb0e Remove needless is_not_nightly closure. 2022-07-31 15:28:31 -07:00
Eric Huss 0264a36ea2 Fix typos in cargo_test docs. 2022-07-31 15:19:37 -07:00
Eric Huss bcf982cf24 Add missing `requires_git` requirements. 2022-07-31 15:19:17 -07:00
Yerkebulan Tulibergenov 7c932a4713 remove duplicate check 2022-07-31 14:34:34 -07:00
Eric Huss 9d43ffc02a Remove CARGO_TEST_DISABLE_GIT_CLI
This appears to no longer be necessary since we have migrated to
GitHub Actions.
2022-07-30 19:36:58 -07:00
Eric Huss 1c3640e05c Add requirements to cargo_test. 2022-07-30 19:36:58 -07:00
bors 85e79fcc29 Auto merge of #10913 - ehuss:contrib-submodule, r=epage
Contrib: Document submodule update process

This adds some contributor documentation on the process I use to update the cargo submodule.

Of course nobody is required to use this process, but I find it works fairly smoothly.
2022-07-30 05:44:11 +00:00
bors de22d8646f Auto merge of #10912 - ehuss:contrib-crater, r=epage
Contrib: Add docs on how to use crater

This adds some contributor documentation on how to run crater with cargo changes.
2022-07-30 05:04:42 +00:00