Commit graph

3047 commits

Author SHA1 Message Date
Eric Huss 4cb9ac35bf Add network container tests 2023-01-14 15:10:16 -08:00
Eric Huss 73f19a01d0 Enable source_config_env test on Windows 2023-01-14 09:48:46 -08:00
Weihang Lo 629f763be8
Support codegen-backend and rustflags in profiles in config file 2023-01-14 11:14:40 +00:00
Weihang Lo c51c6bb6ac
chore: reflect to clap updates 2023-01-14 09:23:39 +00:00
bors abc6abe34d Auto merge of #11561 - epage:typos, r=ehuss
chore: Fix typos

Seeing several typo PRs, like #11560, I figured I'd run my source code spell checker on cargo to help catch a lot of these earlier, in one big batch.
2023-01-11 14:15:24 +00:00
Ed Page ed8b85f10e chore: Fix typos 2023-01-10 20:03:11 -06:00
bors 0849a28cc2 Auto merge of #11556 - pietroalbini:cve-2022-46176, r=weihanglo
Add fix for CVE-2022-46176

r? `@ehuss`
2023-01-10 17:26:08 +00:00
Eric Huss 018403ceaf
Add test for config Value in TOML array. 2023-01-10 14:36:37 +01:00
Eric Huss fab135885c Fix panic on ignored target dependency. 2023-01-04 18:44:51 -08:00
Weihang Lo 3d862d8d8b
by default saves credentials to .cargo/credentials.toml 2023-01-04 16:25:52 +00:00
Weihang Lo 90d5e6a8c9
test: revive nightly plugin tests to work 2023-01-04 13:45:25 +00:00
bors dd9900585a Auto merge of #11407 - dnbln:reasons-for-rebuilding, r=weihanglo
Reasons for rebuilding
2022-12-30 13:25:46 +00:00
bors 7fb01c68c1 Auto merge of #10771 - Eh2406:asymmetric_tokens, r=ehuss
Asymmetric tokens

Builds on and is blocked by #10592. This adds initial support for Asymmetric Tokens #10519.
2022-12-29 16:39:06 +00:00
Dinu Blanovschi 2071acd5ec Add -v to some feature tests 2022-12-28 18:44:05 +01:00
Dinu Blanovschi 0beb5fe93d Simple explanations for why cargo rebuilds crates 2022-12-28 16:27:50 +01:00
bors 5a574d39f3 Auto merge of #10690 - AtkinsChang:vendor, r=hi-rustin
Support vendoring with different revs from same git repo

### What does this PR try to resolve?

Fixes #10667

### How should we test and review this PR?
test case is included
2022-12-26 22:16:55 +00:00
bors 2381cbdb4e Auto merge of #11478 - rvolosatovs:fix/bindeps-target, r=weihanglo
fix: deduplicate dependencies by artifact target

### What does this PR try to resolve?

In cases when a compile target is specified for a bindep and the crate depending on it, cargo fails to deduplicate the crate dependencies and attempts to build the dependent crate only once with non-deterministic feature set, which breaks e.g. https://github.com/rvolosatovs/musl-bindep-feature-bug

Fix the issue by including the optional artifact compile target in the `Unit` in order to avoid wrongfully deduplicating the dependent crates

Fixes https://github.com/rust-lang/cargo/issues/11463
Fixes https://github.com/rust-lang/cargo/issues/10837
Fixes https://github.com/rust-lang/cargo/issues/10525

Note, that this issue is already accounted for by `cargo`, but in different context a similar situation can occur while building the build script, which:
1. may be built for different target than the actual package target
2. may contain dependencies with different feature sets than the same dependencies in the dependency graph of the package itself

That's why this PR is simply reusing the existing functionality for deduplication

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

Build https://github.com/rvolosatovs/musl-bindep-feature-bug

### Additional information

This is based on analysis by `@weihanglo` in https://github.com/rust-lang/cargo/issues/10837#issuecomment-1339365374
I experimented with adding the whole `UnitFor` to the internal unit struct, but that seems unnecessary.

It would probably be nicer to refactor `IsArtifact` and instead turn it into a 3-variant enum with a possible compile target, but I decided against that to minimize the diff. Perhaps it's worth a follow-up?
2022-12-23 12:19:27 +00:00
bors 2a4a9b48fb Auto merge of #11503 - willcrichton:scrape-dev-deps-diagnostic, r=weihanglo
Add warning if potentially-scrapable examples are skipped due to dev-dependencies

### What does this PR try to resolve?

Another point of feedback I've received on the scrape-examples feature is that the dev-dependency situation is quite confusing and subtle. To make users more aware of the issue, I added a warning where Cargo will alert users when examples are skipped due to a dev-dependency requirement, along with proposing a fix.

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

The test `docscrape::no_scrape_with_dev_deps` has been updated to reflect this new warning.

r? `@weihanglo`

(PS thank you for the reviews Weihang. I know I'm doing lots of little patches right now to get this feature finalized. If you want to share the reviewing burden on scrape-examples with anyone else, let me know!)
2022-12-22 23:55:20 +00:00
Jacob Finkelman b6adac1a6b count calls to credential process 2022-12-22 21:53:45 +00:00
Will Crichton 1c4065c52e Simplify code and output of skipped_examples warning 2022-12-22 12:37:11 -08:00
Roman Volosatovs 548b2528fb
test: reproduce bindep dependency collision bug
Signed-off-by: Roman Volosatovs <rvolosatovs@riseup.net>
2022-12-22 16:16:12 +01:00
Roman Volosatovs 6d43fa64ec
refactor: simplify rust-lang#10525 test case
Signed-off-by: Roman Volosatovs <rvolosatovs@riseup.net>
2022-12-22 14:45:25 +01:00
bstrie 386645e990
test: add test for #10525 2022-12-22 14:45:25 +01:00
Roman Volosatovs 4677a7cce5
test: reproduce transitive bindep dependency bug
This is a unit test reproducing the bindep transitive dependency bug based upon examples from
- https://github.com/rust-lang/cargo/issues/10837
- https://github.com/rust-lang/cargo/issues/11463

Signed-off-by: Roman Volosatovs <rvolosatovs@riseup.net>
2022-12-22 14:45:21 +01:00
Atkins Chang 0200d3b3ca
Add test for vendor with different revs from same git repo
Signed-off-by: Atkins Chang <atkinschang@gmail.com>
2022-12-21 11:44:23 +08:00
Will Crichton 6b9a28eb21 Add warning if potentially-scrapable examples are skipped due to dev-dependencies 2022-12-20 14:32:31 -08:00
bors 74c7aab19a Auto merge of #11499 - willcrichton:example-analyzer, r=weihanglo
Don't scrape examples from library targets by default

### What does this PR try to resolve?

Based on some [early feedback](https://www.reddit.com/r/rust/comments/zosle6/feedback_requested_rustdocs_scraped_examples/) about the scrape-examples feature, both documentation authors and consumers did not consider examples useful if they are scraped from a library's internals, at least in the common case. Therefore this PR changes the default behavior of `-Zrustdoc-scrape-examples` to *only* scrape from example targets, although library targets can still be configured for scraping.

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

I have updated the `docscrape` tests to reflect this new policy, as well as the Unstable Options page in the Cargo book.

r? `@weihanglo`
2022-12-20 21:10:16 +00:00
Will Crichton eb829cfb35 Improve failed scrape diagnostic 2022-12-20 12:13:41 -08:00
bors 1d8cdaa01e Auto merge of #11494 - ehuss:stabilize-diagnostic-width, r=weihanglo
Stabilize terminal-width

This stabilized the passing of the `--diagnostic-width` flag to rustc and rustdoc so that they will format diagnostics to fit within the terminal size. Previously they always assume the width is 140. The diagnostics are trimmed with `...` to elide parts of extra-long lines.

In cases where the width isn't known (such as not when used on a tty, or with mintty), then cargo does not pass the flag and the default of 140 is still used.

At this time there is no way for the user to override the width (unlike with the progress bar width). That can be added in the future if there is demand. https://github.com/rust-lang/rust/issues/84673#issuecomment-1179096971 contains some thoughts on some different ideas.

Closes https://github.com/rust-lang/rust/issues/84673
2022-12-19 22:00:52 +00:00
Jacob Finkelman d464dbbb5e add tests 2022-12-19 21:16:04 +00:00
Eric Huss 1709f0aee2 Stabilize terminal-width 2022-12-19 12:17:52 -08:00
bors 3f6c685285 Auto merge of #11477 - kylematsuda:workspace_lockfile, r=weihanglo
Use workspace lockfile when running `cargo package` and `cargo publish`

### What does this PR try to resolve?

Fix #11148.

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

Please run the integration test in `tests/testsuite/publish_lockfile.rs` or try the steps from the issue.
2022-12-19 18:16:27 +00:00
Kyle Matsuda 8c4f27fd5b make test clearer 2022-12-19 10:50:55 -07:00
Will Crichton 818debbf90 Don't scrape examples from library targets by default 2022-12-18 22:15:08 -08:00
Will Crichton d588298c3f Fix examples of proc-macro crates being scraped for examples 2022-12-18 10:41:21 -08:00
Weihang Lo 0523f42cc2
Revert "temporarily disable test lto::test_profile"
This reverts commit d5cac16d07.
2022-12-17 22:51:57 +00:00
Eric Huss b1bcc9c834 Fix collision_doc_profile test error 2022-12-15 20:04:50 -08:00
Scott Schafer 33c32088fa fix: Make auto-fix note work with clippy 2022-12-15 10:54:35 -06:00
Philpax 249683b456
fix(tests): update to match add change 2022-12-15 09:34:23 +01:00
Jacob Finkelman 6b83b3dc54 more tests 2022-12-14 21:45:25 +00:00
Jacob Finkelman f20ab0fa9b move login tests 2022-12-14 20:40:59 +00:00
Jacob Finkelman 6f8b15ce51 add a test for the unstableness of registry-auth 2022-12-14 20:10:55 +00:00
bors cc0a320879 Auto merge of #11434 - weihanglo:issue/10526, r=ehuss
artifact deps should works when target field specified coexists with `optional = true`
2022-12-14 14:46:57 +00:00
Jacob Finkelman 29ff25f6d9 cleanups round 1 2022-12-13 23:49:07 +00:00
Jacob Finkelman c2a1daab63 print the public key on login 2022-12-13 19:09:57 +00:00
Jacob Finkelman 83387da305 put some RFC text into documentation 2022-12-13 17:09:53 +00:00
Kyle Matsuda 4d86b26a68 fix test 2022-12-12 15:47:31 -07:00
Jacob Finkelman 2ac15086fb end-to-end tests 2022-12-12 21:50:08 +00:00
Kyle Matsuda 4cda74a1a3 add test with current behavior 2022-12-12 11:07:43 -07:00
Jacob Finkelman 40325c4d4a generate and check secret_key 2022-12-12 17:52:49 +00:00