Before, we split things up. This makes it so everything has access to
every step so we can reap the benefits
- use `&str` and `ImDocument` for diagnostics
- access `original`
fix: strip feature dep when dep is dev dep
### What does this PR try to resolve?
This change aims to strip features dependencies without a version key to be published.
If a dev-dependency is missing the version, it will be stripped from the packaged manifest.
The features table may contains the deps in following places.
- Target
- normal
- dev
- build
- normal-and-dev
- normal
- dev
- build
- normal-and-dev
### How should we test and review this PR?
See the initial commit, it shows current behavior that will cause error when feature has deps that point to dev_dep and doesn't have a version specified.
Title | orignal toml | published toml |
---- | ---- | ---- |
Before | feature = ["dev-dep/feature"] <br/> [dev-dependencies] <br/> dev-dep = { .., features: ["feature"] } | feature = ["dev-dep/feature"] <br/> [dev-dependencies] <br/> dev-dep = { .., features: ["feature"] } |
After | feature = ["dev-dep/feature"] <br/> [dev-dependencies] <br/> dev-dep = { .., features: ["feature"] } | feature = [] <br/> [dev-dependencies] ```
Fix: #12225
refactor(lockfile): Make diffing/printing more reusable
### What does this PR try to resolve?
This is prep for #13561 so we can tailor the printing of lockfile changes to each use without a bunch of flags.
### How should we test and review this PR?
### Additional information
test: Add tests for using worktrees and sparse checkouts
### What does this PR try to resolve?
Based on `@eminence's` [comment](https://github.com/rust-lang/cargo/issues/7876#issuecomment-1325974682), Add tests for using worktrees or spase checkouts.
### How should we test and review this PR?
Checkout and run tests:
```
cargo test --package cargo --test testsuite -- git::git_worktree_with_original_repo_renamed
```
```
cargo test --package cargo --test testsuite -- git::git_worktree_with_bare_original_repo
```
util/network/http: Use `cargo/1.2.3` user-agent header
... instead of `cargo 1.2.3`.
https://developer.mozilla.org/en-US/docs/Web/HTTP/Headers/User-Agent#syntax declares that the product and product version are usually separated by a slash. This commit changes the cargo `User-Agent` header to follow that syntax instead of using whitespace for the separator.
fix: Consistently compare MSRVs
### What does this PR try to resolve?
Currently, we use several strategies to evaluate an MSRV
- Relying in `impl Ord for RustVersion` (`dep_msrv <= pkg_msrv`)
- Converting to version requirements
- Decrementing a version
This consolidates around one strategy: `RustVersion::is_compatible_with`
- Ensure the comparisons have the same behavior
- Centralize knowledge of how to handle pre-release rustc
- Losslessly allow comparing with either rustc or workspace msrv
### How should we test and review this PR?
Refactors are split out
I didn't go through and verify if or how the different approaches varied in behavior, instead consolidating on the one, so only unit tests around the consolidated behavior were added rather than trying to hit all of the corner cases within the various ways `RustVersion` is used.
### Additional information
refactor(shell): Use alternate to close links
### What does this PR try to resolve?
Simplifies the code for includign hyperlinks, especially the fact that this allows for including the variable in the format string.
### How should we test and review this PR?
Hand tested each case as we don't have SVG support for hyperlinks and we don't have SVG tests for these cases
### Additional information
fix(doc): Collapse down Generated statuses without --verbose
### What does this PR try to resolve?
This is trying to balance
- Overwhelming the user with a lot of paths
- Clarity to the user that the one path is representative of the rest
clap before:
```
Finished dev [unoptimized + debuginfo] target(s) in 3.81s
Generated /home/epage/src/personal/clap/target/doc/clap/index.html
Generated /home/epage/src/personal/clap/target/doc/stdio_fixture/index.html
Generated /home/epage/src/personal/clap/target/doc/clap_bench/index.html
Generated /home/epage/src/personal/clap/target/doc/clap_builder/index.html
Generated /home/epage/src/personal/clap/target/doc/clap_complete/index.html
Generated /home/epage/src/personal/clap/target/doc/clap_complete_fig/index.html
Generated /home/epage/src/personal/clap/target/doc/clap_complete_nushell/index.html
Generated /home/epage/src/personal/clap/target/doc/clap_derive/index.html
Generated /home/epage/src/personal/clap/target/doc/clap_lex/index.html
Generated /home/epage/src/personal/clap/target/doc/clap_mangen/index.html
```
clap after:
```
Finished `dev` profile [unoptimized + debuginfo] target(s) in 1.44s
Generated /home/epage/src/personal/clap/target/doc/clap/index.html and 9 other files
```
Fixes#13336
### How should we test and review this PR?
Tests were updated in earlier commits to help show the behavior change
### Additional information
doc: Add doc for -Zpublic-dependency
### What does this PR try to resolve?
- add doc for -Zpublic-dependency
- optimize log display about -Zpublic-dependency
### How should we test and review this PR?
### Additional information
... instead of `cargo 1.2.3`.
https://developer.mozilla.org/en-US/docs/Web/HTTP/Headers/User-Agent#syntax declares that the product and product version are usually separated by a slash. This commit changes the cargo `User-Agent` header to follow that syntax instead of using whitespace for the separator.
fix(cli): Add traces to clarify where time is going
In looking at the traces, I had a couple of questions of where the time is going, like
- Why does writing a package file take so long
- How much of manifest parsing is TOML parsing vs target discovery vs other stuff
This adds traces to help answer those.
In looking at the traces, I had a couple of questions of where the time
is going, like
- Why does writing a package file take so long
- How much of manifest parsing is TOML parsing vs target discovery vs
other stuff
This adds traces to help answer those.