Commit graph

13301 commits

Author SHA1 Message Date
Ragnar Groot Koerkamp ac855aad08 fix(docs): fix typo learm => learn in cargo tree docs 2023-01-11 02:11:36 +01: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 d992ab4e90
known_hosts: Switch the documentation to stable.
When making the stable release, the nightly docs won't be updated, yet.
This makes sure that the link will work for the stable release.
2023-01-10 14:36:41 +01:00
Eric Huss 23c547166c
update changelog. 2023-01-10 14:36:40 +01:00
Eric Huss 67ae2dcafe
ssh known_hosts: support hashed hostnames 2023-01-10 14:36:39 +01:00
Eric Huss 018403ceaf
Add test for config Value in TOML array. 2023-01-10 14:36:37 +01:00
Eric Huss cf716fc3c2
Remove let-else, just use ? propagation.
Co-authored-by: Weihang Lo <weihanglo@users.noreply.github.com>
2023-01-10 14:36:36 +01:00
Eric Huss 302a543ddf
Add some known_hosts tests.
This also fixes a bug with the host matching when there are comma-separated hosts.
2023-01-10 14:36:34 +01:00
Eric Huss 026bda3fb5
Support configuring ssh known-hosts via cargo config. 2023-01-10 14:36:33 +01:00
Eric Huss 9f62f8440e
Add support for deserializing Vec<Value<String>> in config.
This adds the ability to track the definition location of a string
in a TOML array.
2023-01-10 14:36:31 +01:00
Eric Huss 1387fd4105
Validate SSH host keys 2023-01-10 14:36:22 +01:00
bors 247b22f225 Auto merge of #11541 - ehuss:fix-dep-unwrap, r=epage
Fix panic on target dependency errors.

Errors while processing a target dependency would cause a panic due to some calls to `unwrap` in the TOML processing code. Those unwraps should not be there, and it should just propagate the errors upwards just  like is done for normal dependencies.

Fixes #11540
2023-01-05 02:52:35 +00:00
Eric Huss fab135885c Fix panic on ignored target dependency. 2023-01-04 18:44:51 -08:00
bors c446c2001a Auto merge of #11538 - ehuss:fix-docs-links, r=weihanglo
Fix some doc links

This fixes some links that were broken during the reorganization in #11480.
2023-01-04 22:59:11 +00:00
bors 8c5cae1843 Auto merge of #11533 - weihanglo:issue-11509, r=ehuss
Cargo by default saves credentials to `.cargo/credentials.toml`
2023-01-04 21:10:54 +00:00
Eric Huss f6af2ba916 Fix some doc links 2023-01-04 10:44:22 -08:00
bors e2ccb3cceb Auto merge of #11535 - ehuss:registries-typo, r=weihanglo
Fix a typo in the registries documentation.
2023-01-04 16:35:05 +00:00
Weihang Lo cff549ba38
doc: credentials -> credentials.toml 2023-01-04 16:25:52 +00:00
Weihang Lo 3d862d8d8b
by default saves credentials to .cargo/credentials.toml 2023-01-04 16:25:52 +00:00
Eric Huss 948278d51c Fix a typo in the registries documentation. 2023-01-04 08:24:25 -08:00
bors 8c460b2237 Auto merge of #11534 - weihanglo:fix-nightly-plugins-tests, r=ehuss
test: revive nightly plugin tests to work
2023-01-04 14:30:01 +00:00
Weihang Lo 90d5e6a8c9
test: revive nightly plugin tests to work 2023-01-04 13:45:25 +00:00
bors cd792128e1 Auto merge of #11531 - ehuss:multiple-registries-release-notes, r=epage
Add note to release notes about rejecting multiple registries.

This adds a note to the changelog about a change in stable behavior as part of the implementation of RFC 3139.

cc #11524
2023-01-03 19:33:25 +00:00
Eric Huss a7cfdf664c Add note to release notes about rejecting multiple registries. 2023-01-03 11:14:51 -08:00
bors dcfde9c9e4 Auto merge of #11529 - hi-rustin:rustin-patch-typo, r=ehuss
Fix a typo `fresheness` -> `freshness`

Fix a typo `fresheness` -> `freshness`.
2023-01-03 02:39:38 +00:00
hi-rustin c379bf8cb8 Fix typo fresheness -> freshness
Signed-off-by: hi-rustin <rustin.liu@gmail.com>
2023-01-03 10:21:56 +08:00
bors dd9900585a Auto merge of #11407 - dnbln:reasons-for-rebuilding, r=weihanglo
Reasons for rebuilding
2022-12-30 13:25:46 +00:00
Dinu Blanovschi 6913486a98 Use DirtyReason::Forced for cargo install Freshness 2022-12-29 23:52:12 +01:00
Dinu Blanovschi c63b8c0a3a Minor style fixes 2022-12-29 23:43:29 +01:00
Dinu Blanovschi 7c8ee49bff cargo fmt 2022-12-29 22:26:40 +01:00
Dinu Blanovschi ef0951eb86 Apply patch
Co-authored-by: Weihang Lo <me@weihanglo.tw>
2022-12-29 22:22:28 +01: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
bors 8ba371b882 Auto merge of #11517 - Chocobo1:github, r=weihanglo
Use proper git URL for GitHub repos

Follow up of ce174d4efc.
2022-12-29 10:53:02 +00:00
Chocobo1 b864cb4278
Use proper git URL for GitHub repos
Follow up of ce174d4efc.
2022-12-29 16:18:48 +08:00
bors 09c5b26c76 Auto merge of #11516 - hi-rustin:rustin-patch-example, r=ehuss
Add `registry.default` example
2022-12-29 02:45:39 +00:00
hi-rustin 3f3eaa0f08 Add registry.default example
Signed-off-by: hi-rustin <rustin.liu@gmail.com>
2022-12-29 09:55:25 +08: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 385bba3cf2
fix: share artifact and build dependencies
This prevents collisions for transitive dependencies

Signed-off-by: Roman Volosatovs <rvolosatovs@riseup.net>
2022-12-22 16:16:12 +01: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 e99c0bbe28
fix: deduplicate dependencies by artifact target
Signed-off-by: Roman Volosatovs <rvolosatovs@riseup.net>
2022-12-22 14:45:25 +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 f114298149
Support vendoring with different revs from same git repo
Signed-off-by: Atkins Chang <atkinschang@gmail.com>
2022-12-21 11:44:27 +08:00