20626 Commits

Author SHA1 Message Date
Ed Page
12fa1daac8
chore: fix some typos in comment (#15877)
### What does this PR try to resolve?

fix some typos in comment

### How to test and review this PR?

No need.
2025-08-22 13:37:21 +00:00
xihuwenhua
e235d04c94 chore: fix some typos in comment
Signed-off-by: xihuwenhua <xihuwenhua@outlook.com>
2025-08-22 14:40:12 +08:00
Weihang Lo
15165cac21
Add Arm64 Windows CI jobs (#15790)
The `aarch64-pc-windows-msvc` target is on the path to being promoted to
Tier 1: <https://github.com/rust-lang/rfcs/pull/3817>

Adding Arm64 Windows runners will catch any potential issues in Cargo
before changes are merged in, instead of waiting for the Cargo submodule
to be updated.
2025-08-21 15:00:50 +00:00
Weihang Lo
4434ed8a2a
suggest workspace hints for boolean dependencies (#15507)
### What does this PR try to resolve?
via issue #15505, Cargo currently errors on
```toml
[dependencies]
crc32fast = true
```
with a message about `expected a version string or a detailed
dependency` It doesn’t hint that you can depend on a workspace member.
This PR updates `cargo` so that when you write dep = true, the error
also suggests:
```toml
dep = { workspace = true }
dep.workspace = true
```

### How should we test and review this PR?
In a workspace crate’s Cargo.toml, add
```toml
[dependencies]
crc32fast = true
```
Run `cargo build` and you should see the enhanced error with the two
workspace hints.

### Additional information

Regarding support for int/float, we only need a special case for boolean
because they’re the only values that get the `workspace hint`.
Everything else just uses the normal detailed dependency error
2025-08-21 14:31:55 +00:00
Weihang Lo
c0396feaa8
make UnitGenerator public in cargo-as-a-library (#15873)
### What does this PR try to resolve?

This PR makes `UnitGenerator` public for experimenting with unit graph
generation in cargo plumbing commands.

See https://github.com/crate-ci/cargo-plumbing/issues/39

### How to test and review this PR?

Verify that `UnitGenerator` is available when using cargo-as-a-library
2025-08-21 13:01:18 +00:00
Vito Secona
e633ba3adb refactor: make UnitGenerator public 2025-08-21 19:09:23 +07:00
Weihang Lo
81db0af861
Linting system (#15865)
This PR is just a few small improvements to the linting system.
2025-08-21 01:45:16 +00:00
Scott Schafer
069723ebff
fix(unknown_lints): Make emitted_source come before other groups 2025-08-19 16:19:40 -06:00
Scott Schafer
5ac9eb0a58
refactor(lints): Create emitted_source helper function 2025-08-19 16:19:40 -06:00
Scott Schafer
01a270f402
refactor: Add a helper for telling if a level is an error 2025-08-19 16:19:40 -06:00
Samuel Onoja
5dd597b621
impl workspace hint for boolean dependencies
hint for only bad dependency true literal and rename unit test to match
2025-08-19 18:15:32 +01:00
Samuel Onoja
7e78c54630
initial test commit 2025-08-19 18:15:32 +01:00
Weihang Lo
af9f4f677a
docs: add back src/doc README.md 2025-08-18 18:32:38 -04:00
Weihang Lo
974efef192
docs(contrib): polish documentation guide and make it a chapter 2025-08-18 18:32:37 -04:00
Weihang Lo
bfc0a59ebe
docs(contrib): move docs building process to contributor guide 2025-08-18 18:25:37 -04:00
Ed Page
b2c0aea98d
Switch to using native mdbook fragment redirects (#15861)
Mdbook recently gained the ability to redirect fragments. This removes
the embedded scripts to use this mechanism instead.
2025-08-18 21:49:40 +00:00
Eric Huss
f8dc368fe3 Switch to using native mdbook fragment redirects
Mdbook recently gained the ability to redirect fragments. This removes
the embedded scripts to use this mechanism instead.
2025-08-18 14:21:36 -07:00
Eric Huss
1840e7a507
docs(profile): revert wrong statement of lto options' optimization (#15855)
There is no clear winner between fat LTO and ThinLTO, so don't say "from
most to least optimizing" here.

See https://github.com/rust-lang/cargo/pull/15841#discussion_r2281037386
2025-08-18 17:10:47 +00:00
Ed Page
dd69fab752
docs: avoid ambiguity between update and fetch (#15860)
address
<https://github.com/rust-lang/cargo/pull/15853#discussion_r2282734460>

r? epage
2025-08-18 16:45:29 +00:00
Weihang Lo
33baa940c0
docs: avoid ambiguity between update and fetch 2025-08-18 12:16:36 -04:00
Eric Huss
62537dd3ef
docs: mention how Cargo fetch git submodules (#15853)
### What does this PR try to resolve?

Clarify how git submodules are handled in Cargo for `git` dependencies.

See
https://github.com/rust-lang/cargo/issues/4247#issuecomment-3160707916
2025-08-18 15:21:27 +00:00
Weihang Lo
33cb1c2654
feat(unstable): Added -Zbuild-dir-new-layout unstable feature (#15848)
### What does this PR try to resolve?

Added `-Zbuild-dir-new-layout` unstable feature as part of #15010

I will open a follow up PR with an initial implementation as mentioned
[here](https://github.com/rust-lang/cargo/issues/15010#issuecomment-3193725891)

r? @weihanglo
2025-08-18 05:04:24 +00:00
Weihang Lo
bff04ca05e
docs(profile): revert wrong statement of lto options' optimization
There is no clear winner between fat LTO and ThinLTO,
so don't say "from most to least optimizing" here.

See https://github.com/rust-lang/cargo/pull/15841#discussion_r2281037386
2025-08-17 20:21:11 -04:00
Weihang Lo
206e3fe6b3
Implement host-target substitution (#15838)
### What does this PR try to resolve?

This PR resolves: https://github.com/rust-lang/cargo/issues/13051

Namely, it allows users to invoke cargo subcommands that accept a
`--target` directive to specify the `host` target, which is later
substituted in the command processing layer by the host's real target
triple (for instance, on most Linux distributions, `cargo build --target
host` would effectively run `cargo build --target
x86_64-unknown-linux-gnu`).

This additionally applies to usage within `config.toml`, like so:

```toml
# .cargo/config.toml

[build]
target = "host"
```
2025-08-18 00:01:34 +00:00
zdivelbiss
d5509ebacc
amend documentation style for host target specifier
We also rebuilt the manual pages, to ensure they're up-to-date with the changes made in the `host` target specifier PR.
2025-08-17 14:39:35 -05:00
Weihang Lo
65e7c7a817
docs: mention how Cargo fetch git submodules 2025-08-17 14:59:10 -04:00
zdivelbiss
8f66af7194
simplify tests for host target specifier 2025-08-17 12:54:22 -05:00
zdivelbiss
b23e0a99b2
documentation for host target specifier 2025-08-17 12:52:11 -05:00
zdivelbiss
b3f5e052f6
tests for host target specifier 2025-08-17 12:51:34 -05:00
zdivelbiss
7794d62ced
implement "host" target substitution 2025-08-17 12:51:29 -05:00
Weihang Lo
71eb84f21a
update tests to match lint message changes from rust-lang/rust#140794 (#15849)
Needed for
[rust-lang/rust#140794](https://github.com/rust-lang/rust/pull/140794)
(not merged yet).
2025-08-17 17:18:56 +00:00
Karol Zwolak
cec8eb1d16 bump rustfix version to 0.9.3 2025-08-17 18:50:55 +02:00
Karol Zwolak
fb046a1354 update tests to match lint message changes from rust-lang/rust#140794 2025-08-17 18:50:55 +02:00
Eric Huss
9c7bc45bfa
chore: downgrade to libc@0.2.174 (#15851)
### What does this PR try to resolve?

There is incompatibility between rustix@1.0.8 and libc@0.2.175 that
leads to compilation errors.

See

* https://github.com/bytecodealliance/rustix/issues/1496
* https://github.com/rust-lang/rust/pull/145478#issuecomment-3193494156

### How to test and review this PR?

In rust-lang/rust, update the `src/tools/cargo` submodule accordingly,
and run

```
cargo run --manifest-path src/ci/citool/Cargo.toml run-local dist-loongarch64-musl
```

With this downgrade it should compile.
2025-08-17 16:05:32 +00:00
Weihang Lo
eae8d0dd30
Reorder lto options in profiles.md (#15841)
Aside from `false`, the `lto` options seem to be ordered from "most
optimizing" to "least optimizing".

If this interpretation is correct, then I think `false` should go
between `thin` and `off`.

cc: @ehuss (who I think wrote that text)
2025-08-17 15:36:33 +00:00
Weihang Lo
72dabb4487
chore: downgrade to libc@0.2.174
There is incompatibility between rustix@1.0.8 and libc@0.2.175 that
leads to compilation errors.

See

* https://github.com/bytecodealliance/rustix/issues/1496
* https://github.com/rust-lang/rust/pull/145478#issuecomment-3193494156
2025-08-17 10:37:29 -04:00
Samuel Moelius
396f8c62ed
Mention ordering rationale in profiles.md
Co-authored-by: Weihang Lo <weihanglo@users.noreply.github.com>
2025-08-17 10:29:42 -04:00
Ross Sullivan
c519405582
docs(unstable): Added -Zbuild-dir-new-layout to unstable doc 2025-08-17 14:19:58 +09:00
Ross Sullivan
8e53ef3bbf
feat(unstable): Added -Zbuild-dir-new-layout unstable feature 2025-08-17 14:17:27 +09:00
Ed Page
e04e0b65c0
feat(unstable): add -Zbuild-analysis unstable feature (#15845)
### What does this PR try to resolve?

Part of #15844

Set up `-Zbuild-analysis` flag and `build.analysis` configuration table
to lay the ground work.
when `build.analysis.enabled = true`, enables HTML timing output to
pretend we are persisting timing data for now. This will change when the
storage part is implemented.

### How to test and review this PR?
2025-08-16 14:18:21 +00:00
Weihang Lo
4373786e3f
docs(unstable): add -Zbuild-analysis doc 2025-08-16 08:28:38 -04:00
Weihang Lo
b43404de7e
feat(build-analysis): build.analysis configuration
When enabled, set timing output format to HTML to pretend
we are persisting timing data for now.
2025-08-16 08:28:38 -04:00
Weihang Lo
973f7410a8
test(build-analysis): feature gate tests 2025-08-16 08:28:37 -04:00
Ed Page
a22a25b602
refactor(unstable): group stabilized features (#15846)
This was an overlook when stabilizing doctest-xcompile
2025-08-16 11:02:12 +00:00
Weihang Lo
121b80dc98
refactor(unstable): group stabilized features 2025-08-16 00:14:17 -04:00
Weihang Lo
57fd10126c
feat(unstable): add -Zbuild-analysis unstable feature 2025-08-15 23:32:31 -04:00
Ed Page
9a0712751c
Fixes error while running the cargo clippy --all-targets -- -D warning (#15843)
Fixes #15842

Before -:

<img width="895" height="701" alt="Screenshot From 2025-08-16 01-15-35"
src="https://github.com/user-attachments/assets/5e8daca4-5fad-4fc7-bb12-f67288061704"
/>

After the fix-:

<img width="831" height="107" alt="Screenshot From 2025-08-16 01-28-50"
src="https://github.com/user-attachments/assets/eb03c852-69a0-44a3-9562-f8a99dae4033"
/>
2025-08-15 20:30:47 +00:00
Weihang Lo
d1bbe63f64
Clarify that cargo doc --no-deps is cumulative and won’t delete prev (#15800)
### What does this PR try to resolve?
clarifies that cargo doc --no-deps will not delete previously-built
dependency docs, and points users to cargo clean --doc or manual
deletion if they want a truly “fresh” doc set. This pr fixed
https://github.com/rust-lang/cargo/issues/15728

### How to test and review this PR?
No testing required.
2025-08-15 20:01:27 +00:00
Ojus Chugh
0e540b2bea Fixes error while running the cargo clippy --all-targets -- -D warnings commad 2025-08-16 01:18:59 +05:30
Ojus Chugh
ff9a9c8305 fixed documentation, which fixes the concern raised in issue 15728 and regenerated pages using cargo build-man and ran ./ci/validate-man.sh 2025-08-16 00:56:15 +05:30