16894 Commits

Author SHA1 Message Date
Ed Page
714359289d fix(toml): Produce warnings for virtual manifests
This is prep for shifting unused keys warnings out of `convert_toml`
2024-03-15 12:00:06 -05:00
Ed Page
fcc6981d00 refactor(toml): Centralize error wrapping 2024-03-15 12:00:06 -05:00
Ed Page
65bf96a10b fix(toml): Remove redundant trace 2024-03-15 12:00:06 -05:00
Ed Page
401c502e6a refactor(toml): Consolidate no-target errors
Moving this out for collapsing `convert_toml`
2024-03-15 12:00:06 -05:00
Ed Page
a7b70e98f9 refactor(toml): Pull out unused warning code 2024-03-15 12:00:06 -05:00
Ed Page
8cd94e4cc4 refactor(toml): Simplify virtual manifest check 2024-03-15 12:00:06 -05:00
Ed Page
069c67a9aa refactor(toml): Move steps to top-level
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`
2024-03-15 12:00:06 -05:00
Ed Page
b1743463bc refactor(toml): Pull out toml parsing
So we can track spans for diagnostics
2024-03-15 12:00:06 -05:00
Ed Page
c272cd7e37 refactor(toml): Resolve toml_edit deprecations 2024-03-15 12:00:06 -05:00
Ed Page
66b19adaa0 refactor(toml): Pull out deserialize code
- So we can eventually track the `original`
- So we can track spans for diagnostics
2024-03-15 12:00:06 -05:00
Ed Page
490583a573 refactor(toml): Pull out diagnostic emitting 2024-03-15 12:00:06 -05:00
Ed Page
69ee34a274 refactor(toml): Pull fs out as explicit step
So diagnostics can use this for reporting.
2024-03-15 12:00:06 -05:00
Ed Page
89f1cce439 refactor: Clarify what Manifest::original means
I plan to add a true `original`
2024-03-15 12:00:05 -05:00
Ed Page
c8fa7096d4 refactor: Group alt Manifest formats
This is prep for adding more
2024-03-15 10:37:30 -05:00
bors
403fbe2b49 Auto merge of #13518 - baby230211:fix/strip-feature-dev-dep, r=epage
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
2024-03-14 20:20:14 +00:00
bors
601670a218 Auto merge of #13581 - LuuuXXX:issue-12692, r=weihanglo
fix(ci): bump check error when PR is behind master

### What does this PR try to resolve?

Fixes: https://github.com/rust-lang/cargo/issues/12692
2024-03-14 14:05:25 +00:00
LuuuX
fb616a0f69 fix: bump check error 2024-03-14 21:28:14 +08:00
SeanHsieh
75130eb6e3 fix(add): strip feature dep when dep is dev dep or target dev dep 2024-03-14 14:27:21 +08:00
bors
7065f0ef4a Auto merge of #13575 - pavedroad:master, r=ehuss
chore: remove repetitive word
2024-03-12 13:25:15 +00:00
SeanHsieh
465e36150c test(add): add publish feature contains different kinds dep 2024-03-12 20:42:45 +08:00
pavedroad
b540813a90 chore: remove repetitive words
Signed-off-by: pavedroad <qcqs@outlook.com>
2024-03-12 14:40:20 +08:00
bors
685c18d17e Auto merge of #13564 - epage:r, r=weihanglo
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
2024-03-12 00:48:46 +00:00
bors
fe5de0755d Auto merge of #13567 - LuuuXXX:issue-7876, r=weihanglo
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
```
2024-03-11 15:44:10 +00:00
LuuuX
062d8ce66a Add tests for using worktrees and sparse checkouts 2024-03-11 23:00:09 +08:00
bors
d79fdf33ee Auto merge of #13548 - Turbo87:user-agent, r=weihanglo
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.
2024-03-09 16:16:37 +00:00
bors
29cf016014 Auto merge of #13537 - epage:msrv-compat, r=Eh2406
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
2024-03-08 17:36:23 +00:00
bors
36cf66a476 Auto merge of #13562 - epage:hyperlink, r=weihanglo
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
2024-03-08 16:38:59 +00:00
Ed Page
af9f1346a2 refactor(shell): Use alternate to close links 2024-03-08 08:15:51 -06:00
Ed Page
619238e86b refactor(lockfile): Pull out dep change detection 2024-03-07 19:52:56 -06:00
Ed Page
9e18941ff6 refactor(lockfile): Pull out alternatives logic 2024-03-07 19:52:56 -06:00
Ed Page
93c4446649 refactor(lockfile): Allow print code to call into Diff logic 2024-03-07 19:52:56 -06:00
Ed Page
e65e435809 refactor(lockfile): Extract PackageDiff API 2024-03-07 19:52:56 -06:00
Ed Page
f3f1447f66 refactor(lockfile): Pull out change printing 2024-03-07 19:52:46 -06:00
bors
6b27055c45 Auto merge of #13557 - epage:doc, r=weihanglo
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
2024-03-07 18:03:11 +00:00
Ed Page
7bc6044fe4 fix(doc): Collapse down Generated statuses without --verbose
Fixes #13336
2024-03-07 09:34:34 -06:00
Ed Page
7ffa09a296 test(docs): Show verbose behavior 2024-03-07 09:22:12 -06:00
Ed Page
d8bf778124 test(docs): Verify generated output 2024-03-07 09:20:42 -06:00
bors
ce3d32acdb Auto merge of #13556 - linyihai:doc-z-public, r=weihanglo
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
2024-03-07 14:13:45 +00:00
Lin Yihai
759c3adbc4 chore: Optimize log display about -Zpublic-dependency 2024-03-07 22:01:21 +08:00
Lin Yihai
2ff7cc3f40 doc: Add document for Zpublic-dependency 2024-03-07 22:01:21 +08:00
bors
5c24f04b9d Auto merge of #13547 - hi-rustin:rustin-patch-docs-link-exported_private_dependencies, r=weihanglo
docs: add link to the exported_private_dependencies lint
2024-03-07 13:40:13 +00:00
hi-rustin
aac6d0b15b docs: add link to the exported_private_dependencies lint
It would be a lot quicker for us to have a look around.

Signed-off-by: hi-rustin <rustin.liu@gmail.com>
2024-03-07 21:32:18 +08:00
bors
a4c63fe538 Auto merge of #13551 - epage:cfg, r=weihanglo
fix(cli): Skip tracing-chrome for platforms without 64bit atomics

See rust-lang/rust#122054

I also created thoren-d/tracing-chrome#27
2024-03-06 22:15:17 +00:00
Ed Page
307ad0c496 fix(cli): Skip tracing-chrome for platforms without 64bit atomics 2024-03-06 10:35:58 -06:00
Tobias Bieniek
c1f5fa6cbc
doc/registry-web-api: Adjust user-agent header 2024-03-06 16:38:19 +01:00
bors
bc0ab3dc62 Auto merge of #13550 - weihanglo:opensslv1, r=epage
chore: downgrade to openssl v1.1.1 (again)
2024-03-06 14:36:37 +00:00
Weihang Lo
949b8feca9
chore: downgrade to openssl v1.1.1 (again)
See rust-lang/cargo#13546 and sfackler/rust-openssl#2163
2024-03-06 08:51:35 -05:00
Tobias Bieniek
7eca372d92
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.
2024-03-06 13:38:21 +01:00
bors
b1b52aafe6 Auto merge of #13545 - epage:trace, r=weihanglo
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.
2024-03-06 03:06:41 +00:00
Ed Page
0d36e88c7c 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.
2024-03-05 20:58:25 -06:00