15286 Commits

Author SHA1 Message Date
bors
ff768b45b3 Auto merge of #12823 - calavera:fix_remove_help_typos, r=weihanglo
Clarify flag behavior in `cargo remove --help`

### What does this PR try to resolve?

I noticed what I believe are typos in `cargo rm --help`:

```
Section:
      --dev              Remove as development dependency
      --build            Remove as build dependency
      --target <TARGET>  Remove as dependency from the given target platform
```

This change updates that section with a more appropriate description of those flags.

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

I've updated the relevant test for that help output.

### Additional information

Sorry for not opening an issue about this. I believe it's easy enough to approve it if my assumption is correct.
2023-10-17 12:51:31 +00:00
bors
8eb8acbb11 Auto merge of #12832 - weihanglo:cargo-login, r=ehuss
doc(cargo-login): mention args after `--` in manpage
2023-10-17 11:55:04 +00:00
David Calavera
8849d25218 Update rm help to be specific about the section.
Signed-off-by: David Calavera <david.calavera@gmail.com>
2023-10-17 11:53:57 +02:00
Weihang Lo
536e0b7688
doc(cargo-login): mention args after -- in manpage 2023-10-16 23:35:50 -04:00
bors
87f4b1ba07 Auto merge of #12830 - weihanglo:compat-notice, r=epage
changelog: add compat notice for `cargo login -- <arg>`
2023-10-16 14:39:46 +00:00
Weihang Lo
edfd9034b7
changelog: add compat notice for cargo login -- <arg> 2023-10-15 16:29:59 -04:00
bors
c857ebb73a Auto merge of #12827 - tompscanlan:spdx-license-bug, r=weihanglo
update SPDX License info

### What does this PR try to resolve?

fixes #12797
* link to latest license info
* update link for further info to main spdx page

Link to further info was pointing to a 2018 news update, now points to the main spdx page.
2023-10-15 14:15:00 +00:00
Tom Scanlan
eb9e7f2277
update SPDX License info
* link to latest license info
* update link for further info to main spdx page
* Update src/doc/src/reference/manifest.md
* point directly at expression syntax

Co-authored-by: Weihang Lo <weihanglo@users.noreply.github.com>

update license list
2023-10-15 10:05:50 -04:00
bors
fadb3b1c60 Auto merge of #12822 - hi-rustin:rustin-patch-version, r=weihanglo
Add test for `-V` short argument

Just found it when I randomly jumped into this file :(
2023-10-14 15:46:11 +00:00
hi-rustin
267ae195e3 Add test for -V short argument
Signed-off-by: hi-rustin <rustin.liu@gmail.com>
2023-10-14 23:16:11 +08:00
bors
f7e7cc2356 Auto merge of #12820 - linyihai:broken-symlink-target, r=weihanglo
add detailed message when target folder path is invalid

# What does this PR try to resolve?
close https://github.com/rust-lang/cargo/issues/12789

add more detailed message when target folder path is invalid

# How should we test and review this PR?

Before this PR, if the target folder refer to broken symbolic link like /a/b/c, then run cargo build, the output is:

```
error: Not a directory (os error 20)
```
the detailed error message is missing.

This PR will add the error context for it, the finall output will be
```
cargo build
error: failed to create directory `/root/workspace/playground/target`

Caused by:
  Not a directory (os error 20)
```
2023-10-14 04:43:58 +00:00
Lin Yihai
ceac419776 add detailed message when target folder path is invalid 2023-10-14 11:34:42 +08:00
bors
c3fc03e5cc Auto merge of #12761 - rust-lang:renovate/toml_edit-0.x, r=epage
chore(deps): update rust crate toml_edit to 0.20.2

[![Mend Renovate](https://app.renovatebot.com/images/banner.svg)](https://renovatebot.com)

This PR contains the following updates:

| Package | Type | Update | Change |
|---|---|---|---|
| [toml_edit](https://togithub.com/toml-rs/toml) | workspace.dependencies | minor | `0.19.14` -> `0.20.2` |

---

### Release Notes

<details>
<summary>toml-rs/toml (toml_edit)</summary>

### [`v0.20.2`](https://togithub.com/toml-rs/toml/compare/v0.20.1...v0.20.2)

[Compare Source](https://togithub.com/toml-rs/toml/compare/v0.20.1...v0.20.2)

### [`v0.20.1`](https://togithub.com/toml-rs/toml/compare/v0.20.0...v0.20.1)

[Compare Source](https://togithub.com/toml-rs/toml/compare/v0.20.0...v0.20.1)

### [`v0.20.0`](https://togithub.com/toml-rs/toml/compare/v0.19.15...v0.20.0)

[Compare Source](https://togithub.com/toml-rs/toml/compare/v0.19.15...v0.20.0)

### [`v0.19.15`](https://togithub.com/toml-rs/toml/compare/v0.19.14...v0.19.15)

[Compare Source](https://togithub.com/toml-rs/toml/compare/v0.19.14...v0.19.15)

</details>

---

### Configuration

📅 **Schedule**: Branch creation - "before 5am on the first day of the month" (UTC), Automerge - At any time (no schedule defined).

🚦 **Automerge**: Disabled by config. Please merge this manually once you are satisfied.

♻ **Rebasing**: Whenever PR becomes conflicted, or you tick the rebase/retry checkbox.

🔕 **Ignore**: Close this PR and you won't be reminded about this update again.

---

 - [ ] <!-- rebase-check -->If you want to rebase/retry this PR, check this box

---

This PR has been generated by [Mend Renovate](https://www.mend.io/free-developer-tools/renovate/). View repository job log [here](https://developer.mend.io/github/rust-lang/cargo).
<!--renovate-debug:eyJjcmVhdGVkSW5WZXIiOiIzNy4wLjMiLCJ1cGRhdGVkSW5WZXIiOiIzNy44LjEiLCJ0YXJnZXRCcmFuY2giOiJtYXN0ZXIifQ==-->
2023-10-13 18:40:05 +00:00
renovate[bot]
b22d31672c
chore(deps): update rust crate toml_edit to 0.20.2 2023-10-13 17:48:42 +00:00
bors
a9d71d291f Auto merge of #12817 - alexcrichton:workspace-public-dep, r=epage
Support `public` dependency configuration with workspace deps

This commit updates the processing of `workspace = true` dependencies in the `[dependencies]` section to process the `public` field. Previously this field was ignored and didn't get plumbed through as configured.

Also 👋 it's been awhile!
2023-10-13 14:06:12 +00:00
Alex Crichton
756fc4084e Support public dependency configuration with workspace deps
This commit updates the processing of `workspace = true` dependencies in
the `[dependencies]` section to process the `public` field. Previously
this field was ignored and didn't get plumbed through as configured.
2023-10-13 00:32:05 -07:00
bors
eb2b3f9ccb Auto merge of #12815 - chenx97:rustix-0.38.18, r=epage
Update rustix to 0.38.18
2023-10-12 15:38:45 +00:00
bors
890b664ccb Auto merge of #12812 - tshepang:patch-1, r=epage
contrib docs: add some conveniences

- AND search terms, instead of OR
- allow quick-edit, by adding a button that allows one to submit a change directly via github
2023-10-12 14:50:56 +00:00
bors
0d3f77f225 Auto merge of #12811 - hi-rustin:rustin-patch-path, r=epage
Better suggestion for unsupported `--path` flag
2023-10-12 13:49:14 +00:00
bors
e6b24be83f Auto merge of #12814 - tshepang:patch-3, r=epage
contrib docs: update rfc and roadmap links
2023-10-12 12:53:40 +00:00
bors
3bf258ecbb Auto merge of #12813 - tshepang:patch-2, r=weihanglo
contrib doc: remove extraneous word
2023-10-12 11:26:45 +00:00
hi-rustin
ded92b17ca Call arg_quiet_without_unknown_silent_arg_tip in arg_quiet
Signed-off-by: hi-rustin <rustin.liu@gmail.com>
2023-10-12 19:25:45 +08:00
hi-rustin
497e1ee307 Better suggestion for unsupported -path flag
Signed-off-by: hi-rustin <rustin.liu@gmail.com>
2023-10-12 19:24:42 +08:00
Tshepang Mbambo
7d0cf18ee5
contrib docs: update rfc and roadmap links 2023-10-12 12:04:42 +02:00
Henry Chen
fbb2fddba1 Update rustix to 0.38.18 2023-10-12 18:02:25 +08:00
Tshepang Mbambo
4e73422e19
contrib doc: remove extraneous word 2023-10-12 11:50:29 +02:00
Tshepang Mbambo
475136cc8c
contrib docs: add some conveniences
- AND search terms, instead of OR
- allow quick-edit, by adding a button that allows one to submit a change directly via github
2023-10-12 11:35:32 +02:00
hi-rustin
95d79094e0 Add test for unsupported --path flag
Signed-off-by: hi-rustin <rustin.liu@gmail.com>
2023-10-12 09:01:34 +08:00
bors
50d9f9cbfd Auto merge of #12808 - ehuss:update-curl, r=weihanglo
Update curl-sys to pull in curl 8.4.0

This updates curl-sys from 0.4.66 to 0.4.68 to pull in curl 8.4.0. This fixes two CVEs:

* CVE-2023-38546 — https://curl.se/docs/CVE-2023-38546.html
* CVE-2023-38545 — https://curl.se/docs/CVE-2023-38545.html

This also pulls in a change to fix compiling on macOS Sonoma.
2023-10-12 00:57:30 +00:00
Eric Huss
51b5c4f38f Update curl-sys to pull in curl 8.4.0
This updates curl-sys from 0.4.66 to 0.4.68 to pull in curl 8.4.0.
This fixes two CVEs:

* CVE-2023-38546 — https://curl.se/docs/CVE-2023-38546.html
* CVE-2023-38545 — https://curl.se/docs/CVE-2023-38545.html

This also pulls in a change to fix compiling on macOS Sonoma.
2023-10-11 16:59:48 -07:00
bors
71de58d5cf Auto merge of #12799 - marchiore:warn_add_package_name, r=epage
feat: add package name and version to warning messages

### What does this PR try to resolve?

Hi, this PR Fixes #8018, where i add the package name and version on warning messages.
As this is my first contribution to the project, if anything is not in compliance in the PR let me know and I will be happy to correct it.
2023-10-11 19:59:57 +00:00
Matheus Z Marchiore
380719da35 feat: add package name and version to warning messages 2023-10-11 16:52:30 -03:00
bors
90fb62fc65 Auto merge of #12796 - dtolnay-contrib:switching, r=epage
Do not call it "Downgrading" when difference is only build metadata

### What does this PR try to resolve?

When a `cargo update --precise` changes a dependency between 2 versions which differ only in build metadata, Cargo prints a log referring to it as "Updating" or "Downgrading" the dependency, depending on a comparison between the build metadatas.

This is usually not meaningful, given that build metadata is often stuff like git commit hashes, which are not meaningfully ordered.

```console
    Updating crates.io index
 Downgrading foo v0.0.1+43ef4fe -> v0.0.1+2c65d16
    Updating bar v0.0.2+bc17664 -> v0.0.2+c144a98
```

~~This PR changes to the word "Switching" when the version major, minor, patch, and pre-release value are not being changed.~~
This PR uses the word "Updating" when the version major, minor, patch, and pre-release value are unchanged, regardless of whether the build metadata is going up or down.

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

- `cargo test`
- `cargo build --release`
- `/path/to/cargo/target/release/cargo add tonic_datastore_v1`
- `/path/to/cargo/target/release/cargo update -p tonic_datastore_v1 --precise 0.1.0+3562b6cb3`
- `/path/to/cargo/target/release/cargo update -p tonic_datastore_v1 --precise 0.1.0+ee9e8e4e6`

Before:
<img src="https://github.com/rust-lang/cargo/assets/1940490/93e377e7-928e-4cec-aff6-451166ef7c81" width="500">

~~After:~~
<img src="https://github.com/rust-lang/cargo/assets/1940490/bb71459e-469a-4e09-bb8a-4083f34bce79" width="500">

After:
<img src="https://github.com/rust-lang/cargo/assets/1940490/8804e2fe-d0de-4c9e-b463-a5742daf9446" width="500">
2023-10-11 14:21:44 +00:00
David Tolnay
f1d2237b72
Call cmp_precedence where applicable 2023-10-10 20:58:55 -07:00
bors
4ae21bd58f Auto merge of #12805 - hi-rustin:rustin-patch-target, r=epage
Add unsupported short flag suggestion for `--target` and `--exclude` flags
2023-10-11 02:08:04 +00:00
hi-rustin
b514ca5e24 Add unsupported short flag suggestion for --exclude flag
Signed-off-by: hi-rustin <rustin.liu@gmail.com>
2023-10-11 09:41:05 +08:00
hi-rustin
718b69ce19 Add test for unsupported short exclude flag
Signed-off-by: hi-rustin <rustin.liu@gmail.com>
2023-10-11 09:39:13 +08:00
hi-rustin
819a836e9a Add unsupported short flag suggestion for --target flag
Signed-off-by: hi-rustin <rustin.liu@gmail.com>
2023-10-11 09:16:26 +08:00
hi-rustin
2f90430110 Add test for unsupported short target triple flag
Signed-off-by: hi-rustin <rustin.liu@gmail.com>
2023-10-11 09:13:55 +08:00
bors
6fa6fdc760 Auto merge of #12804 - weihanglo:generalize-test-assertion, r=Muscraft
test(build): generalize test assertion for non-rustup env
2023-10-10 23:06:08 +00:00
Weihang Lo
a263a7dc31
test(build): generalize test assertion for non-rustup env 2023-10-10 17:52:46 -04:00
bors
95089bebda Auto merge of #12803 - epage:sort, r=weihanglo
chore: Sort dependency tables

This will make `cargo add` put things in the right place.

Verified by doing `cargo add arcstr && git diff && git reset --hard`
2023-10-10 21:47:39 +00:00
bors
8ba1c316ee Auto merge of #12798 - epage:msrv-install, r=ehuss
fix(install): Suggest an alternative version on MSRV failure

### What does this PR try to resolve?

Moves users from a bad error message, suggesting `--locked` which won't do anything, to suggesting a version of a package to use instead.

The side benefit is errors get reported sooner
- Before downloading the `.crate`
- When installing multiple packages, before building the first

This comes at the cost of an extra `rustc` invocation.

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

Per-commit this builds it up, from tests to the final design.

### Additional information

This is also written in a way to align fairly well with how we'd likely implement #10903.
This improved error message will still be useful after that issue is resolved when the MSRV compatible version is outside of the version req.
2023-10-10 20:03:41 +00:00
Ed Page
7846fe8cb4 chore: Sort dependency tables
This will make `cargo add` put things in the right place.

Verified by doing `cargo add arcstr && git diff && git reset --hard`
2023-10-10 15:03:22 -05:00
bors
e4fe8f04e7 Auto merge of #12800 - notriddle:notriddle/version-tests, r=ehuss
rustdoc: remove the word "Version" from test cases

Needed for https://github.com/rust-lang/rust/pull/115948 to merge.

That PR gets rid of the word "Version" in rustdoc's HTML output, and it splits spaced versions on their first space, to fit in the tight horizontal spacing. This causes Cargo's test suite to fail, because it look for the word "Version", even though things are working as they should.

These tests work on both current nightly and on that pull request.
2023-10-10 18:26:44 +00:00
Michael Howell
f0d3cdf191 rustdoc: remove the word "Version" from test cases
Needed for https://github.com/rust-lang/rust/pull/115948 to merge.
2023-10-10 11:19:57 -07:00
bors
c97c906b79 Auto merge of #12788 - hi-rustin:rustin-patch-short-Z, r=epage
Add unsupported lowercase `-z` flag suggestion for `-Z` flag
2023-10-10 01:33:31 +00:00
Ed Page
9b32be7f89 fix(install): Suggest an alternative version on MSRV failure
The next step would be to also automatically install an MSRV compatible
version if compatible with the version req (#10903).
This improved error message will still be useful if the MSRV compatible
version is outside of the version req.

I did this as the first step
- Helps people now, not needing to wait on `-Zmsrv-policy` to be stabilized
- Has fewer questions on how it should be done (or if it should be)
2023-10-09 20:22:54 -05:00
hi-rustin
d1540ccd7e Move arg_config and arg_unstable_feature out of command prelude
Signed-off-by: hi-rustin <rustin.liu@gmail.com>
2023-10-10 08:59:14 +08:00
David Tolnay
c0ed70ef5e
Use semver::Version's cmp_precedence for deciding what is downgrade 2023-10-09 16:08:27 -07:00