Commit Graph

10797 Commits

Author SHA1 Message Date
Scott Schafer af1e5b3623
chore(implicit_features): Update lint description 2024-04-19 10:53:06 -06:00
bors 7e9c2ef30f Auto merge of #13775 - epage:incomplete-dep, r=weihanglo
fix(toml)!: Disallow source-less dependencies

### What does this PR try to resolve?

This is part of #13629 addressing “dependency without path, version, git, workspace specified”.

This turns deps like
```toml
foo = { optional = true }
```
from `version="*"` deps with a warning into errors. This breaking change was deemed acceptable because this behavior has been considered a bug from the beginning.
We have gotten little to no feedback about people wanting this behavior.

This improves our forwards-compatibility story as we can add new dependency sources and they won't be considered a wildcard registry dependency on older cargo.

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

I removed the `cargo_add` test because it is redundant.

We no longer get the “unused key” warnings because those warnings get deferred to after this error gets reported.

### Additional information
2024-04-18 22:02:05 +00:00
Ed Page d1f02476c2 fix(toml): Deprecate underscore fields 2024-04-18 16:15:34 -05:00
Ed Page 208d10d06d fix(toml): Switch the duplicate table warning to an unused key warning 2024-04-18 14:49:50 -05:00
Ed Page a4a3254bc3 refactor(toml): Pull conditional into deprecation fn 2024-04-18 14:45:45 -05:00
Ed Page 42939d9eff refactor(toml): Clarify function name 2024-04-18 14:45:37 -05:00
Ed Page cf23e4b538 fix(toml)!: Disallow source-less dependencies
This is part of #13629

This turns deps like
```toml
foo = { optional = true }
```
from `version="*"` deps with a warning into errors.
This breaking change was deemed acceptable because this behavior has
been considered a bug from the beginning.
We have gotten little to no feedback about people wanting this behavior.

This improves our forwards-compatibility story as we can add new
dependency sources and they won't be considered a wildcard registry
dependency on older cargo.
2024-04-18 12:55:27 -05:00
Arlo Siemsen 6207f93087 fix(credential): trim newlines in token from stdin for credential providers 2024-04-17 17:39:46 -05:00
Ed Page 18a5940046 fix(msrv): Put MSRV-aware resolver behind a config
This is a part of #13540 which is a party of #9930.

The config is `resolver.something-like-precedence` with values:
- `something-like-maximum` (default)
- `something-like-rust-version`

This is punting on the actual config schema so we can implement
`package.resolver` and `edition = "2024"` support as we want the
MSRV-aware resolver available without `cargo_features`.
2024-04-17 12:35:14 -05:00
Ed Page 1d0c6ebd8f feat(install): Including Locking message
As we switch to MSRV-aware resolver, this will help users work out why
MSRV-aware resolving isn't helping them.

This will also make it more obvious if we breaking things when
developing the MSRV-aware resolver.
2024-04-16 13:35:25 -05:00
Ed Page c38673c665 refactor(resolve): Make it easier to customize around the resolve call 2024-04-16 12:28:27 -05:00
Ed Page ea27ec1f96 docs: Clarify why we aren't printing Locking in some cases 2024-04-16 12:08:57 -05:00
bors b9d913e532 Auto merge of #13759 - epage:more-lock, r=weihanglo
feat(update): Include a Locking message

### What does this PR try to resolve?

This extends #13561 to `cargo update`.  I previously left it out because the locking message was redundant.  However the `Locking` message has been extended in #13754 to include the resolving policy which can be a useful point of interest (e.g. "why does `cargo update` do nothing? Oh, `-Zminimal-versions` is enabled").

I still left out the message for `--precise` because the user is overriding all of that.

I'd still like to extend all of this to `cargo install` (and maybe all resolves) but that is taking more investigation.

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

### Additional information
2024-04-16 02:35:06 +00:00
renovate[bot] 1a111ab753 chore(deps): update rust crate gix to 0.62.0 [security] 2024-04-15 21:30:05 +00:00
Ed Page cbd9def9dc feat(fix): Migrate from project to package on Edition 2024 2024-04-15 13:33:28 -05:00
Ed Page 98298d4966 feat(fix): Report manifest migrations 2024-04-15 13:33:27 -05:00
Ed Page 1ec1455747 refactor(fix): Reload the workspace
This opens the door for fixing the workspace
2024-04-15 13:32:17 -05:00
Ed Page ca699d264a refactor(fix): Flatten workspace loading
This misses out on features that shouldn't be relevant to fix, like
avoid-dev-deps.

However, this prepares the way for workspace re-loading.
2024-04-15 13:32:17 -05:00
Ed Page 9fb428bd05 refactor(fix): Move workspace loading closer to use 2024-04-15 13:32:17 -05:00
Ed Page 2f4d3df54d fix(toml): Error on use of [project] on 2024 Edition 2024-04-15 13:32:17 -05:00
Ed Page 77f96f5c61 fix(toml): Simplify [project] warning 2024-04-15 13:32:17 -05:00
Ed Page 8181bc8274 refactor(toml): Delay project warnings until Edition is parsed 2024-04-15 13:32:17 -05:00
Ed Page bec36fce99 fix(update): Remove locking message for --precise
We aren't locking to latest.
We could customize the message for precise but it seemed a bit
excessive.
2024-04-15 13:00:34 -05:00
bors 9f8adffe2e Auto merge of #13754 - epage:resolve-type, r=weihanglo
feat(resolve): Tell the user the style of resovle done

### What does this PR try to resolve?

This is to help with https://github.com/rust-lang/cargo/issues/9930

Example changes:
```diff
-[LOCKING] 4 packages
+[LOCKING] 4 packages to latest compatible version
-[LOCKING] 2 packages
+[LOCKING] 2 packages to latest Rust 1.60.0 compatible versions
-[LOCKING] 2 packages
+[LOCKING] 2 packages to earliest compatible versions
```

Benefits
- The package count is of "added" packages and this makes that more
  logically clear
- This gives users transparency into what is happening, especially with
  - what rust-version is use
  - the transition to this feature in the new edition
  - whether the planned config was applied or not (as I don't want it to
    require an MSRV bump)
- Will make it easier in tests to show what changed
- Provides more motiviation to show this message in `cargo update` and
  `cargo install` (that will be explored in a follow up PR)

This does come at the cost of more verbose output but hopefully not too
verbose.  This is why I left off other factors, like avoid-dev-deps.

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

### Additional information
2024-04-15 17:49:32 +00:00
Ed Page e772fc93b4 feat(update): Include a Locking message 2024-04-15 12:36:36 -05:00
bors 624233b0ed Auto merge of #13659 - RalfJung:rustc-wrapper, r=ehuss
Make sure to also wrap the initial `-vV` invocation

Fixes https://github.com/rust-lang/cargo/issues/10885 and therefore helps unblock https://github.com/rust-lang/miri/issues/3422.

This ensures that the version info actually matches the compiler that will later be doing the builds.
2024-04-15 17:18:26 +00:00
Naglis Jonaitis e9c7df3d0a docs: update `checkout` GitHub action version
Using `actions/checkout@v3` produces warnings about deprecated Node.js
16 (see also [1]).

Also, v4 is already used in the "Verifying `rust-version`" example[2].

[1]: https://github.blog/changelog/2023-09-22-github-actions-transitioning-from-node-16-to-node-20/
[2]: a9f86addbc/src/doc/src/guide/continuous-integration.md?plain=1#L174
2024-04-15 15:22:57 +03:00
David Tolnay afea119dff
Recategorize cargo test's --doc flag under "Target Selection" 2024-04-14 19:11:02 -07:00
Ed Page 1876326b6b feat(resolve): Tell the user the style of resovle done
This is to help with #9930

Example changes:
```diff
-[LOCKING] 4 packages
+[LOCKING] 4 packages to latest version
-[LOCKING] 2 packages
+[LOCKING] 2 packages to latest Rust 1.60.0 compatible versions
-[LOCKING] 2 packages
+[LOCKING] 2 packages to earliest versions
```

Benefits
- The package count is of "added" packages and this makes that more
  logically clear
- This gives users transparency into what is happening, especially with
  - what rust-version is use
  - the transition to this feature in the new edition
  - whether the planned config was applied or not (as I don't want it to
    require an MSRV bump)
- Will make it easier in tests to show what changed
- Provides more motiviation to show this message in `cargo update` and
  `cargo install` (that will be explored in a follow up PR)

This does come at the cost of more verbose output but hopefully not too
verbose.  This is why I left off other factors, like avoid-dev-deps.
2024-04-13 20:39:59 -05:00
jw013 341a4645cc
Reword sentence describing workspace toml for clarity
Judging by the commit history, the original sentence was written before the `[patch]` and `[profile]` sections were added and since those sections do not go underneath the workspace table the original sentence needed to be updated.
2024-04-13 12:45:08 -04:00
bors 29189d9908 Auto merge of #13751 - epage:msrv-docs, r=weihanglo
docs(ref): Update unstable docs for msrv-policy
2024-04-13 13:35:46 +00:00
Ed Page cb2bdea521 refactor(resolve): Pull put locking message 2024-04-12 20:41:51 -05:00
Ed Page 17a11e493c refactor(resolve): Give printing access to the workspace 2024-04-12 17:05:56 -05:00
Ed Page bb46cce363 refactor(config): Consistently use kebab-case
This shouldn't change the behavior but makes it safer if
- We add new fields where it will matter
- Copy/paste these for new structs

I did not change things related to the Index because we are already
stuck with that case (whether we want it or not)
2024-04-12 15:21:21 -05:00
Ed Page 079f4d12e3 docs(ref): Update unstable docs for msrv-policy 2024-04-12 15:07:13 -05:00
Ralf Jung 8a7ba8f8d9 Also wrap the initial `-vV` invocation in the rustc_(workspace_)wrapper
Based on an earlier draft by oli-obk
2024-04-12 12:33:34 +02:00
Ed Page 38718eaa93 feat(resolve): Fallback to 'rustc -V' for MSRV resolving 2024-04-11 14:40:52 -05:00
Ed Page b7b3874d09 refactor(resolve): Make it easier to extend MSRV logic 2024-04-11 14:38:02 -05:00
bors 7dc84a2d31 Auto merge of #13742 - epage:msrv-update, r=Muscraft
feat(cli): Add --ignore-rust-version to update/generate-lockfile

### What does this PR try to resolve?

This is part of #9930 and extends `--ignore-rust-version` to `cargo update` and `cargo generate-lockfile`

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

First commit sets up tests

### Additional information
2024-04-12 16:57:51 +00:00
bors 7ac5d58f36 Auto merge of #13735 - linyihai:package-no-match, r=epage
`cargo package -p no-exist` emitt  error when the -p `package` not found

### What does this PR try to resolve?

Fixes #13719

If `-p` is used, and the spec doesn't match any member, we emit an error  like `cargo publish -p` does.

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

The first commit add a test to show the issue, the next commit add the check logic to fix it.

### Additional information
2024-04-12 16:27:02 +00:00
Lin Yihai decbadb36f fix: `cargo package -p` includes all packages if no match is found 2024-04-12 10:57:58 +08:00
Ed Page c7d89c64f1 feat(cli): Add --ignore-rust-version to update/generate-lockfile 2024-04-11 14:27:57 -05:00
Ed Page a0ba72918a fix(help): Generalize --ignore-rust-version 2024-04-11 13:45:39 -05:00
bors c375398f3b Auto merge of #13738 - epage:msrv, r=Muscraft
feat(reslve): Respect '--ignore-rust-version'

### What does this PR try to resolve?

This is a part of #9930.

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

I had considered several ways of implementing this.  I first looked at passing this into `ops::resolve*`.
.This would get a bit annoying with the function signature, so I considered moving it to a builder..
Each of the entry points is slightly different with different ownership needs, making it hard to have a common abstraction.
In doing this, I noticed we currently pass some state around to the resolver via `Workspace`, so I mirrored that.

The nice thing about this location is it provides a good place to hook in config and `package.resolve` so they affect this.

### Additional information
2024-04-11 22:12:03 +00:00
Scott Schafer d77faa68af
refactor: Remove `rust_2024_compatibility` lint group 2024-04-11 14:36:30 -06:00
Ed Page cd3d31b361 feat(reslve): Respect '--ignore-rust-version' 2024-04-11 12:56:53 -05:00
Ed Page 11448b44fe refactor(resolve): Abstract out MSRV policy tracking 2024-04-11 12:07:05 -05:00
Ed Page 789eda2b83 fix: Correct fn name in log statement 2024-04-11 11:40:33 -05:00
bors 40ce8ace29 Auto merge of #13728 - weihanglo:dedup-suggestion, r=epage
fix(cargo-fix): dont apply same suggestion twice
2024-04-10 16:50:17 +00:00
bors e366699d7f Auto merge of #13727 - weihanglo:patch, r=epage
refactor: make `resolve_with_previous` clearer
2024-04-10 16:19:21 +00:00
Weihang Lo 95edc06e5b
fix(rustfix): dont apply same suggestion twice
This assumes that if any of the machine applicable fixes in
a diagnostic suggestion is a duplicate, we should see the
entire suggestion as a duplicate.
2024-04-10 11:54:33 -04:00
bors f8a73f7d7a Auto merge of #13729 - epage:slash, r=Muscraft
fix(package): Normalize paths in `Cargo.toml`

### What does this PR try to resolve?

On the surface, this resolves problems that aren't too big of a deal
- Clean up redundant information in paths (e.g. `.////.//foo.rs` being `foo.rs`) which is just visual
- Switch paths with `\` in them to `/`

However, this is prep for #13713 where these will be a much bigger deal
- If the user does `./foo.rs`, we might fail to compare that with the list of files included in the package
- We'll generate paths with `\` and need to make sure the packages can still be used on Windows

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

### Additional information
2024-04-10 15:49:08 +00:00
Ed Page 2e75d66c7c refactor: Track when MSRV is explicitly set, either way
This will hopefully help when merging between CLI and config with #13540.
2024-04-10 08:34:41 -05:00
Weihang Lo 80d0d94342
doc: add commment to `summary_for_patch` 2024-04-10 09:00:26 -04:00
Weihang Lo f9786711a6
refactor: unify naming of `keep` closure 2024-04-10 09:00:26 -04:00
Ed Page 8b593e5ba7 fix(package): Normalize path separators
A windows user could use `\` and no Linux or Mac user could use the
package.
This normalizes the separator to what works on all platforms.
2024-04-09 21:29:08 -05:00
Ed Page 5539293cf6 fix(package): Normalize paths in published `Cargo.toml`
For now, this is more for visual consistency.
However, this blocks #13713 as we need to be able to make these paths
comparable to what is included in the package.
2024-04-09 20:57:25 -05:00
Weihang Lo 57c814eeda
refactor: extract patch registration to a function 2024-04-09 14:33:49 -04:00
Weihang Lo e55c205aed
refactor: move to_avoid closure to `cargo update` 2024-04-09 01:17:31 -04:00
bors bd1cf584af Auto merge of #13560 - heisen-li:build_flag, r=weihanglo
[fix]:Build script not rerun when target rustflags change

### What does this PR try to resolve?

Fixes https://github.com/rust-lang/cargo/issues/13003
2024-04-08 15:54:04 +00:00
bors 3d16d65e93 Auto merge of #13608 - epage:msrv-add, r=weihanglo
feat(add): Stabilize MSRV-aware version req selection

### What does this PR try to resolve?

This is part of #9930 for rust-lang/rfcs#3537

This will make it easier to maintain an MSRV-compliant `Cargo.toml` but leaves validation up to the user as the resolver will pick newer versions.
This helps the MSRV-aware workflows enumerated in
rust-lang/rfcs#3537

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

As for determining if this is ready for stabilization:

By stabilizing this without the MSRV-aware resolver, this could be confusing to the workflow with an MSRV-compatible lockfile.
PR #13561 at least raises awareness of that discrepancy.
In general there was interest in the RFC discussions to stabilize this ASAP, regardless of what resolver direction we went.

There is an unresolved question on differences in the resolver vs `cargo add` for dealing with an unset `rust-version` (noted in the tracking issue). However, we are only stabilizing the `cargo add` side which is a very light two-way door as this is a UX-focused command and not a programmatic command.

This hasn't gotten much end-user acceptance testing but, as its UX focused, that seems fine (light, two way door)

As such, this seems like it is ready to stabilize.

### Additional information
2024-04-08 15:20:12 +00:00
heisen-li db7afeba4e
fix: rerun build script when target rustflags changed
fixes #13003
2024-04-08 10:48:20 -04:00
Eric Huss 5836a96d3c Fix github fast path redirect. 2024-04-06 13:31:17 -07:00
bors ec2b323fda Auto merge of #13715 - weihanglo:remove-semverver, r=epage
doc(semver): remove mention of deprecated tool rust-semverver

See also

* https://rust-lang.zulipchat.com/#narrow/stream/242791-t-infra/topic/Creating.20a.20release.20for.20rust-semverver
* https://github.com/rust-lang/team/pull/1390
* https://github.com/rust-lang/rust-semverver/issues/373
2024-04-06 14:36:42 +00:00
Weihang Lo 3c652b7bc0
doc(semver): remove mention of deprecated tool rust-semverver
See also

* https://rust-lang.zulipchat.com/#narrow/stream/242791-t-infra/topic/Creating.20a.20release.20for.20rust-semverver
* https://github.com/rust-lang/team/pull/1390
* https://github.com/rust-lang/rust-semverver/issues/373
2024-04-06 10:12:37 -04:00
guqicun 663143593d chore: fix some typos
Signed-off-by: guqicun <guqicun@outlook.com>
2024-04-06 18:19:13 +08:00
Ed Page ff4186836c refactor(toml): Use relative paths in resolved targets 2024-04-05 13:12:41 -05:00
Ed Page f1f7bbf6ac refactor(toml): Simplify file/dir target inference 2024-04-05 13:12:41 -05:00
Ed Page f38136eeca refactor(toml): Give higher level info to target inference 2024-04-05 13:12:41 -05:00
Ed Page b6c7544bd9 refactor(toml): Avoid incomplete constant for bin dir name 2024-04-05 13:12:41 -05:00
Ed Page b2ca065552 refactor(toml): Prefer common constant for bench dir name 2024-04-05 13:12:41 -05:00
Ed Page f243c91f68 refactor(toml): Move target resolving up a level 2024-04-05 13:12:41 -05:00
Ed Page e8f56df032 refactor(toml): Clarify meaning of target 'clean' fn's 2024-04-05 13:12:41 -05:00
Ed Page 8439a4b21a refactor(toml): Split target discovery from Target creation 2024-04-05 13:12:41 -05:00
Ed Page 36891bacfd refactor(toml): Move unique name validation out of resolving 2024-04-05 13:12:41 -05:00
Ed Page 943f9bc871 refactor(toml): Track paths in TomlTarget, rather than next to it 2024-04-05 13:12:41 -05:00
Ed Page c699941d13 refactor(toml): Move bin resolving up a level 2024-04-05 13:12:41 -05:00
Ed Page 72ee140548 refactor(toml): Split bin discovery from Target creation 2024-04-05 13:12:41 -05:00
Ed Page b061bc5e83 refactor(toml): Abstract out bin name validation 2024-04-05 13:12:41 -05:00
Ed Page f2b0678436 refactor(toml): Pull out legacy_bin_path 2024-04-05 13:12:41 -05:00
Ed Page b08d19779c refactor(toml): Move lib resolving up a level 2024-04-05 13:12:41 -05:00
Ed Page f900b3f776 refactor(toml): Split lib discovery from Target creation 2024-04-05 13:12:41 -05:00
Ed Page 019bae2efb refactor(toml): Consolidate lib discovery 2024-04-05 13:12:41 -05:00
Ed Page 6ef9779752 refactor(toml): Abstract out lib name validation 2024-04-05 13:12:41 -05:00
Ed Page 74e8d760f0 refactor(toml): Simplify lib resolving 2024-04-05 13:12:41 -05:00
Ed Page b86b4b4fe5 refactor(toml): Clarify conversion nature of target fn's 2024-04-05 13:12:41 -05:00
Ed Page d3cfa7fc75 refactor(toml): Clarify which manifest is being used 2024-04-05 13:12:41 -05:00
Ed Page cc9710e957 refactor(toml): Be consistent in readme resolve name 2024-04-05 13:12:41 -05:00
Arlo Siemsen db6a42b2f3 fix: adjust tracing verbosity in list_files_git 2024-04-04 16:23:32 -05:00
bors 4113935ebd Auto merge of #13698 - weihanglo:registry-doc, r=ehuss
doc: comments on `PackageRegistry`
2024-04-04 03:51:20 +00:00
bors 81ca704784 Auto merge of #13696 - arlosi:gitoxide-list-files-default, r=weihanglo
Switch to using gitoxide by default for listing files

### What does this PR try to resolve?

Uses gitoxide by for listing the contents of a git repository by default. Fixes #10150

It's possible out-opt of this change with the environment variable `__CARGO_GITOXIDE_DISABLE_LIST_FILES=1`. This opt-out mechanism is temporary and will be removed before the next release.

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

The newly added test fails with the `git2` implementation.
2024-04-04 03:21:55 +00:00
Weihang Lo bbb752088a
doc: comments on `PackageRegistry` 2024-04-03 23:09:08 -04:00
Arlo Siemsen 312e2aab7f Use strip_path_canonical for getting the relative path
This resolve an issue where the package path contains a symlink that's resolved by git
2024-04-03 12:59:49 -05:00
Arlo Siemsen 45c390a2a5 Switch to using gitoxide by default for listing files 2024-04-03 12:05:26 -05:00
bors 6774b8503c Auto merge of #13626 - linyihai:pre-update, r=weihanglo
Allow precise update to prerelease.

### What does this PR try to resolve?

This is a feature that attempts to support updates to pre-release versions via `cargo update --precise`.

when `precise-pre-release` used, the prerelase version will be taking consider as compatible version.  That said, we can update to any compatible pre-release version. The logic of checking the compatibility of pre-release versions is currently tentative and does not take many conditions into account, this part of the logic makes more sense when implemented in semver.

Use `-Zunstable-options`  instead of  `-Zprecise-pre-release`.

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

### Additional information
Part of https://github.com/rust-lang/cargo/issues/13290
2024-04-03 15:44:08 +00:00
bors 09d5e964ad Auto merge of #13693 - epage:resolve-toml, r=Muscraft
refactor(toml): Split out an explicit step to resolve `Cargo.toml`

### What does this PR try to resolve?

This builds on #13664 and #13666.   Currently, once we have deserialized `Cargo.toml`, we pass it to a large machinery (`to_real_manifest`, `to_virtual_manifest`) so that
- `Cargo.toml` is resolved
- `Summary` is created
- `Manifest` is created

This splits out the resolving of `Cargo.toml` which is mostly workspace inheritance today.

While splitting logic conjoined like this can be a bit messy in the short term, the hope is that overall this makes the logic easier to follow (more condensed, focused sections to view; more explicit inputs/outputs).

In particular, I hope that this will make it clearer and easier to shift more logic into the resolving step, specifically the inferring of build targets for #13456.

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

This is broken up into very small steps in the hope that it makes it easier to analyze a step.

### Additional information
2024-04-03 14:47:35 +00:00
Lin Yihai 179f2f1066 Allow precise update to prerelease. 2024-04-03 22:44:36 +08:00
bors 0637083df5 Auto merge of #13674 - rust-lang:renovate/compatible, r=epage
chore(deps): update compatible

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

This PR contains the following updates:

| Package | Type | Update | Change |
|---|---|---|---|
| [anyhow](https://togithub.com/dtolnay/anyhow) | workspace.dependencies | patch | `1.0.80` -> `1.0.81` |
| [clap](https://togithub.com/clap-rs/clap) | workspace.dependencies | patch | `4.5.1` -> `4.5.4` |
| [git2](https://togithub.com/rust-lang/git2-rs) | workspace.dependencies | patch | `0.18.2` -> `0.18.3` |
| [handlebars](https://togithub.com/sunng87/handlebars-rust) | workspace.dependencies | patch | `5.1.0` -> `5.1.2` |
| [libloading](https://togithub.com/nagisa/rust_libloading) | workspace.dependencies | patch | `0.8.1` -> `0.8.3` |
| [memchr](https://togithub.com/BurntSushi/memchr) | workspace.dependencies | patch | `2.7.1` -> `2.7.2` |
| [os_info](https://togithub.com/stanislav-tkach/os_info) | workspace.dependencies | minor | `3.7.0` -> `3.8.2` |
| [pulldown-cmark](https://togithub.com/raphlinus/pulldown-cmark) | workspace.dependencies | patch | `0.10.0` -> `0.10.2` |
| [regex](https://togithub.com/rust-lang/regex) | workspace.dependencies | patch | `1.10.3` -> `1.10.4` |
| [security-framework](https://lib.rs/crates/security_framework) ([source](https://togithub.com/kornelski/rust-security-framework)) | workspace.dependencies | minor | `2.9.2` -> `2.10.0` |
| [serde_json](https://togithub.com/serde-rs/json) | workspace.dependencies | patch | `1.0.114` -> `1.0.115` |
| [similar](https://togithub.com/mitsuhiko/similar) | dev-dependencies | minor | `2.4.0` -> `2.5.0` |
| [snapbox](https://togithub.com/assert-rs/trycmd/tree/main/crates/snapbox) ([source](https://togithub.com/assert-rs/trycmd)) | workspace.dependencies | patch | `0.5.7` -> `0.5.9` |
| [thiserror](https://togithub.com/dtolnay/thiserror) | workspace.dependencies | patch | `1.0.57` -> `1.0.58` |
| [toml](https://togithub.com/toml-rs/toml) | workspace.dependencies | patch | `0.8.10` -> `0.8.12` |
| [tracing-chrome](https://togithub.com/thoren-d/tracing-chrome) | workspace.dependencies | patch | `0.7.1` -> `0.7.2` |
| [walkdir](https://togithub.com/BurntSushi/walkdir) | workspace.dependencies | minor | `2.4.0` -> `2.5.0` |

---

### Release Notes

<details>
<summary>dtolnay/anyhow (anyhow)</summary>

### [`v1.0.81`](https://togithub.com/dtolnay/anyhow/releases/tag/1.0.81)

[Compare Source](https://togithub.com/dtolnay/anyhow/compare/1.0.80...1.0.81)

-   Make backtrace support available when using -Dwarnings ([#&#8203;354](https://togithub.com/dtolnay/anyhow/issues/354))

</details>

<details>
<summary>clap-rs/clap (clap)</summary>

### [`v4.5.4`](https://togithub.com/clap-rs/clap/blob/HEAD/CHANGELOG.md#454---2024-03-25)

[Compare Source](https://togithub.com/clap-rs/clap/compare/v4.5.3...v4.5.4)

##### Fixes

-   *(derive)* Allow non-literal `#[arg(id)]` attributes again

### [`v4.5.3`](https://togithub.com/clap-rs/clap/blob/HEAD/CHANGELOG.md#453---2024-03-15)

[Compare Source](https://togithub.com/clap-rs/clap/compare/v4.5.2...v4.5.3)

##### Internal

-   *(derive)* Update `heck`

### [`v4.5.2`](https://togithub.com/clap-rs/clap/blob/HEAD/CHANGELOG.md#452---2024-03-06)

[Compare Source](https://togithub.com/clap-rs/clap/compare/v4.5.1...v4.5.2)

##### Fixes

-   *(macros)* Silence a warning

</details>

<details>
<summary>rust-lang/git2-rs (git2)</summary>

### [`v0.18.3`](https://togithub.com/rust-lang/git2-rs/blob/HEAD/CHANGELOG.md#0183---2024-03-18)

[Compare Source](https://togithub.com/rust-lang/git2-rs/compare/git2-0.18.2...git2-0.18.3)

[0.18.2...0.18.3](https://togithub.com/rust-lang/git2-rs/compare/git2-0.18.2...git2-0.18.3)

##### Added

-   Added `opts::` functions to get / set libgit2 mwindow options
    [#&#8203;1035](https://togithub.com/rust-lang/git2-rs/pull/1035)

##### Changed

-   Updated examples to use clap instead of structopt
    [#&#8203;1007](https://togithub.com/rust-lang/git2-rs/pull/1007)

</details>

<details>
<summary>sunng87/handlebars-rust (handlebars)</summary>

### [`v5.1.2`](https://togithub.com/sunng87/handlebars-rust/blob/HEAD/CHANGELOG.md#512---2024-03-24)

[Compare Source](https://togithub.com/sunng87/handlebars-rust/compare/v5.1.1...v5.1.2)

-   \[Changed] Improved error message and syntax rule naming \[[#&#8203;638](https://togithub.com/sunng87/handlebars-rust/issues/638)]
-   \[Changed] Updated `heck` to 0.5 \[[#&#8203;635](https://togithub.com/sunng87/handlebars-rust/issues/635)]

### [`v5.1.1`](https://togithub.com/sunng87/handlebars-rust/blob/HEAD/CHANGELOG.md#-511---2024-01-18-Yanked)

[Compare Source](https://togithub.com/sunng87/handlebars-rust/compare/v5.1.0...v5.1.1)

-   \[Changed] Turned off pub access of `chain` in `HelperTemplate`

</details>

<details>
<summary>nagisa/rust_libloading (libloading)</summary>

### [`v0.8.3`](https://togithub.com/nagisa/rust_libloading/compare/0.8.2...0.8.3)

[Compare Source](https://togithub.com/nagisa/rust_libloading/compare/0.8.2...0.8.3)

### [`v0.8.2`](https://togithub.com/nagisa/rust_libloading/compare/0.8.1...0.8.2)

[Compare Source](https://togithub.com/nagisa/rust_libloading/compare/0.8.1...0.8.2)

</details>

<details>
<summary>BurntSushi/memchr (memchr)</summary>

### [`v2.7.2`](https://togithub.com/BurntSushi/memchr/compare/2.7.1...2.7.2)

[Compare Source](https://togithub.com/BurntSushi/memchr/compare/2.7.1...2.7.2)

</details>

<details>
<summary>stanislav-tkach/os_info (os_info)</summary>

### [`v3.8.2`](https://togithub.com/stanislav-tkach/os_info/blob/HEAD/CHANGELOG.md#382-2024-03-22)

[Compare Source](https://togithub.com/stanislav-tkach/os_info/compare/v3.8.1...v3.8.2)

-   Build on FreeSBD has been fixed once again. ([#&#8203;377](https://togithub.com/stanislav-tkach/os_info/issues/377))

### [`v3.8.1`](https://togithub.com/stanislav-tkach/os_info/blob/HEAD/CHANGELOG.md#381-2024-03-17)

[Compare Source](https://togithub.com/stanislav-tkach/os_info/compare/v3.8.0...v3.8.1)

-   Build on FreeSBD has been fixed. ([#&#8203;372](https://togithub.com/stanislav-tkach/os_info/issues/372))

-   Build on Illumos has been fixed. ([#&#8203;373](https://togithub.com/stanislav-tkach/os_info/issues/373))

-   Build on NetBSD has been fixed. ([#&#8203;374](https://togithub.com/stanislav-tkach/os_info/issues/374))

-   Few more regressions introduced in the `3.8.0` release were (hopefully) fixed.

### [`v3.8.0`](https://togithub.com/stanislav-tkach/os_info/blob/HEAD/CHANGELOG.md#380-2024-03-12)

[Compare Source](https://togithub.com/stanislav-tkach/os_info/compare/v3.7.0...v3.8.0)

-   The `windows-sys` crate instead of `winapi` is now used internally. ([#&#8203;341](https://togithub.com/stanislav-tkach/os_info/issues/341))

-   Architecture information for Windows targets has been added. ([#&#8203;345](https://togithub.com/stanislav-tkach/os_info/issues/345))

-   Artix Linux detection has been fixed. ([#&#8203;348](https://togithub.com/stanislav-tkach/os_info/issues/348))

-   AIX support has been added. ([#&#8203;349](https://togithub.com/stanislav-tkach/os_info/issues/349))

-   Kali Linux support has been added. ([#&#8203;350](https://togithub.com/stanislav-tkach/os_info/issues/350))

-   openSUSE Tumbleweed detection has been fixed. ([#&#8203;353](https://togithub.com/stanislav-tkach/os_info/issues/353))

-   Version parsing from `lsb_release` has been added. ([#&#8203;354](https://togithub.com/stanislav-tkach/os_info/issues/354))

-   HardenedBSD detection has been fixed. ([#&#8203;358](https://togithub.com/stanislav-tkach/os_info/issues/358))

-   Ultramarine Linux support has been added. ([#&#8203;359](https://togithub.com/stanislav-tkach/os_info/issues/359))

-   AlmaLinux and Rocky Linux support has been added. ([#&#8203;360](https://togithub.com/stanislav-tkach/os_info/issues/360))

-   Ultramarine Linux support has been added. ([#&#8203;363](https://togithub.com/stanislav-tkach/os_info/issues/363))

-   Void Linux support has been added. ([#&#8203;365](https://togithub.com/stanislav-tkach/os_info/issues/365))

</details>

<details>
<summary>raphlinus/pulldown-cmark (pulldown-cmark)</summary>

### [`v0.10.2`](https://togithub.com/pulldown-cmark/pulldown-cmark/releases/tag/v0.10.2)

New release with some fixes and improvements. Note the 0.10.1 is missing (yanked from crates.io) due to a conflict with the clap version and the Rust minimum version (1.74 now instead of 1.70).

Thanks to all people that contributed to this release!

#### What's Changed

-   Limit link def expansion by [`@&#8203;notriddle](https://togithub.com/notriddle)` in [https://github.com/pulldown-cmark/pulldown-cmark/pull/845](https://togithub.com/pulldown-cmark/pulldown-cmark/pull/845)
-   Do not look for HTML tags that start with backslash by [`@&#8203;notriddle](https://togithub.com/notriddle)` in [https://github.com/pulldown-cmark/pulldown-cmark/pull/849](https://togithub.com/pulldown-cmark/pulldown-cmark/pull/849)
-   Count a blank line at end of indented code block towards list by [`@&#8203;notriddle](https://togithub.com/notriddle)` in [https://github.com/pulldown-cmark/pulldown-cmark/pull/851](https://togithub.com/pulldown-cmark/pulldown-cmark/pull/851)
-   Use same limit for refdef as inline links by [`@&#8203;notriddle](https://togithub.com/notriddle)` in [https://github.com/pulldown-cmark/pulldown-cmark/pull/854](https://togithub.com/pulldown-cmark/pulldown-cmark/pull/854)
-   Don't exit `scan_attribute` with the ix pointing at block quote by [`@&#8203;notriddle](https://togithub.com/notriddle)` in [https://github.com/pulldown-cmark/pulldown-cmark/pull/858](https://togithub.com/pulldown-cmark/pulldown-cmark/pull/858)
-   Check indentation on the closing fence relative to the line by [`@&#8203;notriddle](https://togithub.com/notriddle)` in [https://github.com/pulldown-cmark/pulldown-cmark/pull/862](https://togithub.com/pulldown-cmark/pulldown-cmark/pull/862)
-   Adjust strikethrough flanking rule to better fit Rustdoc Crater run by [`@&#8203;notriddle](https://togithub.com/notriddle)` in [https://github.com/pulldown-cmark/pulldown-cmark/pull/864](https://togithub.com/pulldown-cmark/pulldown-cmark/pull/864)
-   perf: cargo-wizard default recommendations for runtime perf by [`@&#8203;Martin1887](https://togithub.com/Martin1887)` in [https://github.com/pulldown-cmark/pulldown-cmark/pull/868](https://togithub.com/pulldown-cmark/pulldown-cmark/pull/868)

#### New Contributors

-   [`@&#8203;ehuss](https://togithub.com/ehuss)` made their first contribution in [https://github.com/pulldown-cmark/pulldown-cmark/pull/848](https://togithub.com/pulldown-cmark/pulldown-cmark/pull/848)
-   [`@&#8203;jimblandy](https://togithub.com/jimblandy)` made their first contribution in [https://github.com/pulldown-cmark/pulldown-cmark/pull/865](https://togithub.com/pulldown-cmark/pulldown-cmark/pull/865)
-   [`@&#8203;max-heller](https://togithub.com/max-heller)` made their first contribution in [https://github.com/pulldown-cmark/pulldown-cmark/pull/866](https://togithub.com/pulldown-cmark/pulldown-cmark/pull/866)
-   [`@&#8203;blinxen](https://togithub.com/blinxen)` made their first contribution in [https://github.com/pulldown-cmark/pulldown-cmark/pull/875](https://togithub.com/pulldown-cmark/pulldown-cmark/pull/875)

**Full Changelog**: https://github.com/pulldown-cmark/pulldown-cmark/compare/v0.10.0...v0.10.2

</details>

<details>
<summary>rust-lang/regex (regex)</summary>

### [`v1.10.4`](https://togithub.com/rust-lang/regex/compare/1.10.3...1.10.4)

[Compare Source](https://togithub.com/rust-lang/regex/compare/1.10.3...1.10.4)

</details>

<details>
<summary>kornelski/rust-security-framework (security-framework)</summary>

### [`v2.10.0`](https://togithub.com/kornelski/rust-security-framework/compare/v2.9.2...v2.10.0)

[Compare Source](https://togithub.com/kornelski/rust-security-framework/compare/v2.9.2...v2.10.0)

</details>

<details>
<summary>serde-rs/json (serde_json)</summary>

### [`v1.0.115`](https://togithub.com/serde-rs/json/releases/tag/v1.0.115)

[Compare Source](https://togithub.com/serde-rs/json/compare/v1.0.114...v1.0.115)

-   Documentation improvements

</details>

<details>
<summary>mitsuhiko/similar (similar)</summary>

### [`v2.5.0`](https://togithub.com/mitsuhiko/similar/blob/HEAD/CHANGELOG.md#250)

[Compare Source](https://togithub.com/mitsuhiko/similar/compare/2.4.0...2.5.0)

-   Added support for `TextDiff::iter_inline_changes_deadline`.  [#&#8203;61](https://togithub.com/mitsuhiko/similar/issues/61)
-   Raise MSRV to 1.60.  [#&#8203;62](https://togithub.com/mitsuhiko/similar/issues/62)
-   Bump bstr dependency to 1.0.  [#&#8203;62](https://togithub.com/mitsuhiko/similar/issues/62)

</details>

<details>
<summary>assert-rs/trycmd (snapbox)</summary>

### [`v0.5.9`](https://togithub.com/assert-rs/trycmd/compare/snapbox-v0.5.8...snapbox-v0.5.9)

[Compare Source](https://togithub.com/assert-rs/trycmd/compare/snapbox-v0.5.8...snapbox-v0.5.9)

### [`v0.5.8`](https://togithub.com/assert-rs/trycmd/compare/snapbox-v0.5.7...snapbox-v0.5.8)

[Compare Source](https://togithub.com/assert-rs/trycmd/compare/snapbox-v0.5.7...snapbox-v0.5.8)

</details>

<details>
<summary>dtolnay/thiserror (thiserror)</summary>

### [`v1.0.58`](https://togithub.com/dtolnay/thiserror/releases/tag/1.0.58)

[Compare Source](https://togithub.com/dtolnay/thiserror/compare/1.0.57...1.0.58)

-   Make backtrace support available when using -Dwarnings ([#&#8203;292](https://togithub.com/dtolnay/thiserror/issues/292))

</details>

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

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

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

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

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

</details>

<details>
<summary>thoren-d/tracing-chrome (tracing-chrome)</summary>

### [`v0.7.2`](https://togithub.com/thoren-d/tracing-chrome/releases/tag/v0.7.2)

[Compare Source](https://togithub.com/thoren-d/tracing-chrome/compare/v0.7.1...v0.7.2)

-   Support platforms that lack `AtomicU64` support.

</details>

<details>
<summary>BurntSushi/walkdir (walkdir)</summary>

### [`v2.5.0`](https://togithub.com/BurntSushi/walkdir/compare/2.4.0...2.5.0)

[Compare Source](https://togithub.com/BurntSushi/walkdir/compare/2.4.0...2.5.0)

</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.

👻 **Immortal**: This PR will be recreated if closed unmerged. Get [config help](https://togithub.com/renovatebot/renovate/discussions) if that's undesired.

---

 - [ ] <!-- 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:eyJjcmVhdGVkSW5WZXIiOiIzNy4yNjkuMiIsInVwZGF0ZWRJblZlciI6IjM3LjI2OS4yIiwidGFyZ2V0QnJhbmNoIjoibWFzdGVyIn0=-->
2024-04-02 23:55:05 +00:00
bors 88d55a89e0 Auto merge of #13682 - Flowrey:fixes-13578, r=epage
Maintain sorting of dependency features

Fixes #13578
2024-04-02 21:58:38 +00:00
renovate[bot] bfbdfa7a17 chore(deps): update compatible 2024-04-02 15:23:20 -05:00
Ed Page 58b6501a48 refactor(toml): Attempt to logically group everything 2024-04-02 14:21:54 -05:00
Ed Page 1e761a1528 refactor(toml): Gather dependency gathering 2024-04-02 12:58:55 -05:00
Ed Page ecf97cff51 refactor(toml): Simplify dependency validation 2024-04-02 12:55:25 -05:00
Ed Page 70ad920e74 refactor(toml): Prefer making a Manifest from resolved_toml 2024-04-02 12:31:18 -05:00
Ed Page 7640081cda Group logic for fields dependent on package
I'm somewhat tempted to flatten the function call.
The parallel between the package an virtual-manifest cases would help to
keep them in sync.
2024-04-02 12:25:34 -05:00
Ed Page 9eb7c09463 refactor(toml): Scope package-related tables to package scope 2024-04-02 12:17:37 -05:00
Ed Page 2811c15485 refactor(toml): Build up resolved manifest as we go
Normally, I prefer directly constructing something but I feel this works
better in this case so I can limit a lot of work that is coupled to a
`package` being present.

Since we still directly construct, just with `None`, I think this still
works.
2024-04-02 12:13:35 -05:00
Ed Page 8a6fa8bcb4 refactor(toml): Extract package resolving 2024-04-02 11:55:07 -05:00
Ed Page e9d28d8813 refactor(toml): Simplify how we pass around inheritable data 2024-04-01 21:25:06 -05:00
Ed Page 9cc5b90932 refactor(toml): Extract resolve_toml 2024-04-01 21:10:28 -05:00
Ed Page c921f52b4f refactor(toml): Centralize creation of workspace_config 2024-04-01 20:53:40 -05:00
Ed Page 0f5b562e62 refactor(toml): Centralize cargo-features parsing 2024-04-01 20:53:04 -05:00
Ville Skyttä c1ffe80d61 fix: bash completion fallback in `nounset` mode
With the shell in `nounset` mode, the intended fallback to filename
completion provokes an error:

```
$ cargo foo <TAB>bash: !opt_var: unbound variable
```
2024-04-01 21:45:23 +00:00
Flowrey 318072f3cf preserve dependency features order 2024-04-01 19:26:09 +02:00
heisen-li 7fa0e81090 fmt 2024-04-01 11:36:52 +08:00
heisen-li 88b19af01d Remove legacy parameters 2024-04-01 11:36:32 +08:00
Ed Page 5d8bdf4f41 refactor(toml): Separate resolving from other in same fn 2024-03-28 13:33:23 -05:00
Ed Page 3d1da63222 refactor(toml): Rely on resolved badges 2024-03-28 13:33:23 -05:00
Ed Page 611b6889a6 refactor(toml): Separate resolve/validate dependencies 2024-03-28 13:33:23 -05:00
Ed Page 21ca8ab647 refactor(toml): Remove ManifestContext from dependency_inherit_with 2024-03-28 13:33:23 -05:00
Ed Page b517320f1a refactor(toml): Remove ManifestContext from default_feature_msg 2024-03-28 13:33:23 -05:00
Ed Page 772539a03a refactor(toml): Group resolving of lints with package
We can't have validation depend on `TomlManifest::resolved_lints` yet
because we need to pull out the resolving of deps first.
2024-03-28 13:33:23 -05:00
Ed Page a2033965a8 refactor(toml): Directly initialize TomlPackage
This will make it easier to evaluate what needs to be resolved in the
future.
2024-03-28 13:33:23 -05:00
Ed Page 2ea1ac6fac refactor(toml): Rely on resolved publish 2024-03-28 13:33:23 -05:00
Ed Page 20302b34b7 refactor(toml): Rely on resolved include/exclude 2024-03-28 13:33:23 -05:00
Ed Page 00ba5780e4 refactor(toml): Rely on resolved authors 2024-03-28 13:33:23 -05:00
Ed Page 425a8ae478 refactor(toml): Rely on resolved repository 2024-03-28 13:33:23 -05:00
Ed Page 18550b2512 refactor(toml): Rely on resolved license-file 2024-03-28 13:33:23 -05:00
Ed Page b942be5bc1 refactor(toml): Rely on resolved license 2024-03-28 13:33:23 -05:00
Ed Page 047c1fe9d0 refactor(toml): Rely on resolved categories 2024-03-28 13:33:23 -05:00
Ed Page 258d8447a9 refactor(toml): Rely on resolved keywords 2024-03-28 13:33:23 -05:00
Ed Page d435d0e72a refactor(toml): Rely on resolved readme 2024-03-28 13:33:23 -05:00
Ed Page c62a559d82 refactor(toml): Rely on resolved documentation 2024-03-28 13:33:23 -05:00
Ed Page 5b5f64460b refactor(toml): Rely on resolved homepage 2024-03-28 13:33:23 -05:00
Ed Page f96638ea3b refactor(toml): Rely on resolved description 2024-03-28 13:33:23 -05:00
Ed Page 102b5890be refactor(toml): Rely on resolved edition
Returning a `&String` is unusual but this keeps things easier on both
sides.
2024-03-28 13:33:23 -05:00
Ed Page b3183596cc refactor(toml): Rely on resolved rust-version
This also removes duplicated inheritance and one of them specifying the
wrong field.
2024-03-28 13:33:23 -05:00
Ed Page 6ad976912d refactor(toml): Rely on resolved version 2024-03-28 13:33:23 -05:00
Ed Page ca706a494b refactor(toml): Be consistent in how we initialize warnings
This resolves feedback from #13664
2024-03-28 13:32:28 -05:00
Ed Page 8a7489952f refactor(package): Consolidate creation of published package 2024-03-28 13:29:24 -05:00
Ed Page 866d51d090 refactor(package): Make prepare for publish a higher level operation 2024-03-28 13:29:24 -05:00
Ed Page 3c3a8cf33c refactor(package): Flatten manifest prep for packaging 2024-03-28 13:29:24 -05:00
Ed Page cad9673785 refactor(package): Move preamble to Manifest 2024-03-28 13:29:24 -05:00
bors 97ed4ff1ad Auto merge of #13664 - epage:refactor-toml, r=weihanglo
fix(toml): Warn on unused workspace.dependencies keys on virtual workspaces

### What does this PR try to resolve?

This splits out refactors that build on #13589 in preparation for resolving #13456.

As part of those refactors, I noticed an inconsistency on when we warn for unused keys.  We have parallel code paths between `to_virtual_manifest` and `to_real_manifest` and only one got updated on a change.  This syncs them up.  Hopefully the end state this builds to will reduce duplication.

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

### Additional information
2024-03-28 17:49:42 +00:00
bors 3d9dea672a Auto merge of #13665 - weihanglo:locked-frozen, r=epage
docs: clarify `--locked` ensures Cargo uses dependency versions in lockfile
2024-03-28 16:49:40 +00:00
Weihang Lo 26b2e74e55
docs: clarify `--locked` disallows changes in `Cargo.lock` 2024-03-28 12:08:57 -04:00
bors acd673bcc4 Auto merge of #13648 - RalfJung:RUSTC_WORKSPACE_WRAPPER, r=weihanglo
RUSTC_WORKSPACE_WRAPPER: clarify docs

Follow-up to [Zulip discussion](https://rust-lang.zulipchat.com/#narrow/stream/246057-t-cargo/topic/Question.20about.20RUSTC_WORKSPACE_WRAPPER)
2024-03-28 15:23:13 +00:00
Ralf Jung 27a474180c
fix typo
Co-authored-by: Weihang Lo <weihanglo@users.noreply.github.com>
2024-03-28 16:16:09 +01:00
Weihang Lo e549bc809b
fix(cli): resolve confusion between `--frozen` and `--locked` 2024-03-27 22:05:03 -04:00
Ed Page 8a82df2c21 refactor(toml): Consolidate workspace dependency verification 2024-03-27 15:23:26 -05:00
Ed Page 453f39f40e refactor(toml): Centralize workspace config processing 2024-03-27 15:21:45 -05:00
Ed Page 931259032e refator(tom): Give up and allow warnings anywhere 2024-03-27 15:18:03 -05:00
bors 07253b7ea6 Auto merge of #13655 - epage:add-comment, r=weihanglo
fix(add): Preserve comments when updating simple deps

### What does this PR try to resolve?

Fixes https://github.com/rust-lang/cargo/issues/13645

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

A case the tests showed but isn't covered here is when a `[features]`
table is created, the dependencies-end comment gets attached to that,
e.g. see cargo_add/overwrite_optional

### Additional information
2024-03-27 20:13:01 +00:00
Ed Page 573fe524cf fix(toml): Warn on unused workspace.dependencies keys on virtual workspaces 2024-03-27 13:00:43 -05:00
Ed Page 5d2fa4497f refactor(toml): Consolidate public nightly check with clearing it 2024-03-27 13:00:43 -05:00
Ed Page e4f1eb01c9 refactor(toml): Decouple Dep and TomlDep creation 2024-03-27 13:00:43 -05:00
Ed Page 1855a4ad24 refactor(toml): Pull out the dep resolve/validate code 2024-03-27 13:00:43 -05:00
Ed Page 3b7fddb737 refactor(toml): Delay pkgid/summary creation 2024-03-27 12:53:49 -05:00
Ed Page 386c4b6a65 refactor(toml): Consistently don't include pkgid
This is the only error we do this for and we have the context for what
manifest we are parsing.
By removing this, it makes it easier to adjust lifetimes in the short
term.
2024-03-27 12:53:49 -05:00
Ed Page b63e385a89 refactor(toml): Group workspace inheritance functions 2024-03-27 12:53:49 -05:00
Weihang Lo f1c139624f
fix(generate-lockfile): hold lock before querying index 2024-03-26 16:57:28 -04:00
Weihang Lo 5587af7caf
refactor: remove unnecessary export so no need to deal with lock acquisitions 2024-03-26 16:57:27 -04:00
Ed Page e476bd5254 fix(add): Preserve comments when updating simple deps
A case the tests showed but isn't covered here is when a `[features]`
table is created, the dependencies-end comment gets attached to that,
e.g. see cargo_add/overwrite_optional

Fixes #13645
2024-03-26 12:49:01 -05:00
Ed Page 309cd9387c
test: Add asserts to catch BorrowMutError's
This intentionally borrows from `RefCell`s before conditional code
to try to prevent regressions like #13646 without exhaustively
covering every case that could hit these `BorrowMutError`s with
complicated tests.

I tested this by ensuring the registry code path panicked before
rebasing on top of #13647.
Once I rebased, the panic went away.

Co-authored-by: Ed Page <eopage@gmail.com>
2024-03-26 13:04:07 -04:00
Paul Mabileau 29c45d0e66
Docs(process/release): Update to include test tools in publication
Signed-off-by: Paul Mabileau <paulmabileau@hotmail.fr>
2024-03-26 11:17:34 +01:00
Ralf Jung f5f33d17c1 RUSTC_WORKSPACE_WRAPPER: clarify docs 2024-03-26 08:34:41 +01:00
Weihang Lo 667803c741
fix: do not borrow shell across registry query 2024-03-25 23:28:10 -04:00
bors fa619a9d16 Auto merge of #13630 - Kobzol:msvc-disable-release-strip, r=weihanglo
Do not strip debuginfo by default for MSVC

This PR disables the logic which enables debuginfo stripping by default in release mode (https://github.com/rust-lang/cargo/pull/13257) for MSVC, since it causes problems there (https://github.com/rust-lang/rust/issues/122857).

I'm not sure if this is the correct way to gate the logic on a specific target triple.

The root of the issue is that `-Cstrip=debuginfo` currently behaves like `-Cstrip=symbols` on MSVC, which causes the original optimization to break backtraces on Windows. Ultimately, this should probably be fixed in `rustc`, but that might take some further design work, therefore a faster solution would be to just special case this in Cargo for now, and remove the special case later, once it gets fixed on the `rustc` side.

Related issue: https://github.com/rust-lang/rust/issues/122857
2024-03-26 00:22:51 +00:00
Ed Page dd8f8dc645 refactor(toml): Group workspace inheritance logic 2024-03-25 16:19:33 -05:00
Ed Page e30ddc4f94 refactor(toml): Remove a variable that doesnt need tracking 2024-03-25 16:19:33 -05:00
Eric Huss 3adb796e87 Fix doc collision for lib/bin with a dash in the inferred name. 2024-03-25 13:35:52 -07:00
bors bc844af45d Auto merge of #13635 - Muscraft:lint-names-snake-case, r=epage
refactor: Make lint names snake_case

When working on #13621, I somehow missed that lint names should be `snake_case` according to the [`rustc-dev-guide`](https://rustc-dev-guide.rust-lang.org/diagnostics.html#lint-naming) as well as [`RFC #344`](https://rust-lang.github.io/rfcs/0344-conventions-galore.html#lints).

This PR renames:
- `implicit-features` => `implicit_featires`
- `rust-2024-compatibility` => `rust_2024_compatibility`.

<hr>

Note: We should probably have some tooling to enforce this, but I was unsure if it belonged to this PR or another one. One solution would be to use a macro to create the `const LINT_NAME: Lint = {...}`, where `LINT_NAME` would be the `ident` as well as the `name: &'static str` and then have a method on `Lint` to make it lowercase as needed. This is what `rustc` does, and it could work well here. It would ensure snake case as `const` names need to be [`SCREAMING_SNAKE_CASE`](https://rust-lang.github.io/rfcs/0430-finalizing-naming-conventions.html#general-naming-conventions), or a warning is shown.
2024-03-25 18:51:29 +00:00
Scott Schafer 0a400d5ef0
refactor: Make lint names snake_case 2024-03-25 12:44:12 -06:00
bors a5b31ebafa Auto merge of #13592 - Byron:gix-for-list-files-git, r=arlosi
Use `gitoxide` for `list_files_git`

Related to #10150.

### Tasks

* [x] update `gix` to v0.60
* [x] assure this is tested (currently only git-tests run with `git2` and `gitoxide`)
* [x] allow `list_files_git` to use `gitoxide` if it is enabled as feature.
* [x] use dirwalk iterator
* [x] use new release of `gix` with necessary updates

### Review Notes

As this PR has come a long way, I decided to keep a few of the steps leading up to the final state, showing the PR's evolution in the hope it helps the review.

* Would it be better to simply use `gitoxide` for this without a switch? I don't think
  it will cause more trouble than `git2`, and if there is an issue I will fix it with priority.
* In one test, the walk resolves a symlink to a submodule to individual files, including the `.git/*` folder contained in the submodule which is ignored by the walk, i.e. `submodule/*` does not contain it, but `submodule-link/*` does. This is fixed in the gitoxide version, and the `git2` version.
* I noticed that symlinks are resolved for packaging *and* are allowed to point to anywhere, even outside of package root. I left it, but felt that maybe this should be reconsidered.

### Remarks

* I love the test-suite! It's incredibly exhaustive to the point where it uncovers shortcomings in `gitoxide`, which I greatly appreciate.
* I also love `git2` as it's API for many things leads to pretty idiomatic code, and sometimes I really have to work to match it. The example here is the initial `dirwalk()` method which requires a delegate as it doesn't just collect into a `Vec` like `git2` does (for good reason). Turning that into an iterator via `dirwalk_iter()` makes it far more usable, and will definitely be good for performance as the dirwalk work is offloaded into its own thread.
2024-03-24 20:01:45 +00:00
Jakub Beránek ab285e97a0
Do not strip debuginfo by default for MSVC 2024-03-24 09:38:59 +01:00
Scott Schafer c006a307f7
fix: Warn on -Zlints 2024-03-23 13:53:14 -06:00
bors 61855e72a2 Auto merge of #13621 - Muscraft:linting-system, r=weihanglo
feat: Add a basic linting system

This PR adds a basic linting system, the first step towards [User control over cargo warnings](https://github.com/rust-lang/cargo/issues/12235). To demonstrate the system, a lint for #12826 is added. It supports controlling cargo lints via the `[lints.cargo]` table. Lints can be controlled either by a group or individually.

This is meant to lay down some fundamental infrastructure for the whole linting system and is not meant to be fully featured. Over time, features will be added that will help us reach a much more solid state.
2024-03-23 18:39:37 +00:00
Scott Schafer 307c7f825c
feat: Add a basic linting system 2024-03-23 10:26:02 -06:00
Scott Schafer abf0953292
feat: Add `-Zcargo-lints` 2024-03-23 10:24:50 -06:00
Weihang Lo 1195206581
docs: remove untrue TODO for `native_dirs`
`native_dirs` is still in use.

See <https://github.com/rust-lang/cargo/pull/6194>
2024-03-23 10:36:40 -04:00
Sebastian Thiel 91781609a5
Assure top-level refspecs and tailing '/' for target prefix
Top-level pathspecs are needed to assure they are not affected by
the CWD. The trailing `/` in `'target` is needed to assure excluded
items are in a folder, and that only entries in that folder are extracted
from the index.
2024-03-23 08:52:12 +01:00
Sebastian Thiel dbf1b6affd
Simplify pathspec generation in `list_files_gix`
Co-authored-by: Arlo Siemsen <arkixml@gmail.com>
2024-03-23 08:41:27 +01:00
Sebastian Thiel ac68aa1c7c
Don't call .ok() before `unwrap_or()`
It's not necessary, and adds noise.
2024-03-22 07:24:06 +01:00
bors 8bcecfeed4 Auto merge of #13618 - ehuss:always-rebuild-unit-graph, r=epage
Fix debuginfo strip when using `--target`

This fixes an issue where automatic `strip` of debuginfo added in https://github.com/rust-lang/cargo/pull/13257 wasn't working when the `--target` flag was used.

The problem is that the adjustment code was only running in the optimization pass that is done when `--target` is *not* specified.

The solution is to just always run the unit graph rebuild. I believe it should be safe to do so, since the adjustments it makes should be conditional on just the scenarios that matter when `--target` is not specified. The downside is that this might be a small performance hit when `--target` is used. Trying to avoid that I think would be quite challenging.

Fixes #13617
2024-03-21 21:37:26 +00:00
Ed Page 69bbb2c1ae refactor(toml): Push diagnostic complex on annotate-snippets 2024-03-21 15:51:32 -05:00
Eric Huss e0e000e1e5 Fix debuginfo strip when using `--target` 2024-03-21 13:39:45 -07:00
Sebastian Thiel 8375cf40ee
assure user and system configuration for .gitignore/exclude files is picked up 2024-03-21 07:07:41 +01:00
Weihang Lo 46214f3c79
fix(alias): dont panic when resolving an empty alias 2024-03-21 00:44:18 -04:00
Sebastian Thiel acef08407b
add custom feature toggle for `gitoxide` usage in `list_files()` 2024-03-20 22:11:27 +01:00
bors f0ae765191 Auto merge of #13609 - Muscraft:update-annotate-snippets, r=epage
Update annotate snippets

This updates `annotate-snippets` to `0.11.0`, which introduces the new builder API as well as a few rendering fixes.
2024-03-20 21:08:00 +00:00
Weihang Lo 9f96d7b937
refactor: use a dense pattern matching for str 2024-03-20 15:38:25 -04:00
Weihang Lo 75712e1e30
refactor: reuse `Package::root()` instead 2024-03-20 14:18:05 -04:00
Scott Schafer f983e2028c
feat: Set `term_width` for `Renderer` 2024-03-20 11:01:54 -06:00
Scott Schafer 96bbaa11bf
chore: Update annotate-snippets 2024-03-20 10:42:10 -06:00
Ed Page 6e4e31bec0 feat(add): Stabilize MSRV-aware version req selection
This is part of #9930 for rust-lang/rfcs#3537

This will make it easier to maintain an MSRV-compliant `Cargo.toml` but
leaves validation up to the user as the resolver will pick newer
versions.
This helps the MSRV-aware workflows enumerated in
rust-lang/rfcs#3537 though it could be confusing to the workflow with an
MSRV-compatible lockfile.
PR #13561 at least raises awareness of that discrepancy.

There is an unresolved question on differences in the resolver vs
`cargo add` for dealing with an unset `rust-version`.
However, we are only stabilizing the `cargo add` side which is a very
light two-way door as this is a UX-focused command and not a
programmatic command.

This hasn't gotten much end-user testing but, as its UX focused, that
seems fine.

As such, this seems like it is ready to stabilize.
2024-03-20 11:19:06 -05:00
Ed Page 80124ada8f feat(cli): Add shell completions for 'cargo add -ignore-rust-version' 2024-03-20 11:19:06 -05:00
Sebastian Thiel 363d2da187
address PR review (see details)
* remove renovate group as it's not needed anymore
* repository discovery will open with isolation
2024-03-18 15:35:50 +01:00
Sebastian Thiel 9bf91497db
Use the new dirwalk iterator for comparable ergonomics 2024-03-18 10:17:47 +01:00
Sebastian Thiel 5312586492
Assure the extra-logic in dirwalks applies to index files as well
This is the case for the git2 implementation naturally, but as
`gitoxide` doesn't yet have a dirwalk iterator, it's much
less intuitive here.
2024-03-18 10:12:51 +01:00
Sebastian Thiel a710d459af
assure repositories are always walked into to avoid `.git` folders.
With a traditional walk, `.git` will be picked up, and so will be
ignored directories. This commit also doesn't give submodules special
treatment - instead it just tries to open directories as repositories,
or walks them if that fails.
2024-03-18 10:07:04 +01:00