20516 Commits

Author SHA1 Message Date
Weihang Lo
e602d31945
test(build-std): move away from panic_immediate_abort
The test exercises a regression of extra `-Zbuild-std-features`
overriding the entire default-features set.
However, after rust-lang/rust 146317 panic_immediate_abort
became a codegen flag not a Cargo feature anymore.
We pick another `optimize_for_size` feature flag to ensure the
regression case is still covered.

To verify `optimize_for_size` actually triggers the regression,
git revert f004691aa41449fa06b764683385558edee51428
and changes to `-Zbuild-std-features=optimize_for_size`.

Alternatively, we can just drop this test.
2025-10-04 18:05:57 -04:00
Weihang Lo
c21d525ea9
chore(ci): add rustfmt for docs job
Unclear why it wasn't missing before.

The line was added five years ago.
Seems it should be available.
https://github.com/actions/runner-images/blob/75ec4229/images/ubuntu/scripts/build/install-rust.sh#L19-L20

Maybe due to recent pin/unpin 1.89 issue?
https://github.com/actions/runner-images/commit/69c94f5b
2025-10-04 18:05:52 -04:00
Ross Sullivan
e906ad91ff
chore: Disabled reserved_windows_name test temporaily 2025-10-04 17:53:11 -04:00
Weihang Lo
e8288e980e
[Beta-1.91] fix(shell): Use a distinct style for transient status (#16020)
Beta backports
- rust-lang/cargo@b486362
- rust-lnag/cargo@92182d4
- rust-lang/cargo@d33f651 

In order to make CI pass, the following PRs are also cherry-picked:

---

Addresses a usability issue fixed in rust-lang/cargo#16019
2025-09-30 22:10:32 -04:00
Ed Page
c61a70d58d fix(shell): Use a distinct style for transient status
PR #15928 made `Checking` and `Building` the same style because the
transient state is `note:` and #15928 made `note:~ the same as our
regular headers.

This switches the transient state to `help:` until we can further
explore color choices with rustc.

See also https://rust-lang.zulipchat.com/#narrow/channel/246057-t-cargo/topic/colors.20removed.20in.201.2E91.20.28current.20beta.29.3F/near/541900531
2025-09-29 10:11:22 -05:00
Ed Page
14fcfa5d00 refactor(shell): Create separaete style definition for transient 2025-09-29 10:11:17 -05:00
Ed Page
c544807c63 refactor(shell): Clarify we're printing transient status 2025-09-29 10:11:03 -05:00
Ed Page
24bb93c388
Bump miow to 0.60.1 (#15950)
Updates the `miow` crate to 0.60.1, which removes the final use of
`windows-sys` 0.48.0.
2025-09-10 23:16:07 +00:00
Daniel Paoliello
02a61a5bac Bump miow to 0.60.1 2025-09-10 15:40:53 -07:00
Weihang Lo
5d151a9ec3
test(help): Ensure consistent behavior regardless of rustup use (#15949)
### What does this PR try to resolve?

#15928 removed the fix from #13488 which breaks rust-lang/rust. This
fixes that and makes the test less brittle for the future.

### How to test and review this PR?
2025-09-10 20:59:13 +00:00
Ed Page
da2eafe024 test(help): Ensure consistent behavior regardless of rustup use 2025-09-10 15:25:35 -05:00
Weihang Lo
2a1de96590
docs(changelog): Clarify how manifest paths are used (#15946)
### What does this PR try to resolve?

I got confused by this when refreshing myself on the changelog in prep
for the 1.90 release.

### How to test and review this PR?
2025-09-10 14:26:27 +00:00
Ed Page
0d354726ea docs(changelog): Clarify how manifest paths are used
I got confused by this when refreshing myself on the changelog in prep
for the 1.90 release.
2025-09-10 08:50:44 -05:00
Ed Page
98402ac7a4
fix(flock): check if they are marked unsupported in libstd (#15941)
### What does this PR try to resolve?

This is a follow-up of <https://github.com/rust-lang/cargo/pull/15935>.

Before this Cargo invokes syscalls and check whether it gets ENOTSUP to
determine flock is unsupported. However, now the "unsupported platforms"
are pre-defined by libstd. Cargo should perhaps return unsupported if a
platform is marked unsupported by libstd.

Without this, some people on Termux may be affected I guess?

See
e9b6085088/library/std/src/sys/fs/unix.rs (L1395-L1410)
2025-09-09 20:19:39 +00:00
Weihang Lo
8f51d7f68b
fix(flock): check if they are marked unsupported in libstd
Before this Cargo invokes syscalls and check whether it gets ENOTSUP to
determine flock is unsupported. However, now the "unsupported platforms"
are pre-defined by libstd [1]. Cargo should perhaps return unsupported
if a platform is marked unsupported by libstd.

Without this, some people on Termux may be affected I guess?

[1]: e9b6085088/library/std/src/sys/fs/unix.rs (L1395-L1410)
2025-09-09 15:46:57 -04:00
Weihang Lo
78d83495ee
test(manifest): Fix test output order (#15940)
### What does this PR try to resolve?

As this is an unordered test, sometimes snapshot updating can mess up
the line order.

### How to test and review this PR?
2025-09-09 04:21:45 +00:00
Ed Page
2e231072f4 test(manifest): Fix test output order
As this is an unordered test, sometimes snapshot updating can mess up
the line order.
2025-09-08 21:04:05 -05:00
Weihang Lo
9eb32405e9
refactor(shell): Simplify some code (#15937)
### What does this PR try to resolve?

This is from some review feedback left on #15917 which was merged in
#15920.

### How to test and review this PR?
2025-09-08 20:25:04 +00:00
Ed Page
0e07ceb3f3
fix(manifest): Report script manifest errors for the right line number (#15927)
### What does this PR try to resolve?

Currently, if you have a manifest parse error for a cargo script, the
line number will be relative to the start of the frontmatter and not the
source file. This changes it so we get the line number relative to the
start of the source file.

### How to test and review this PR?

### Notes

To do this, I added span tracking to our frontmatter parser. To make
this easier, I used some helpers from winnow which is an existing
transitive dependency.

This span tracking will also come into use when I change the frontmatter
parser to start reporting spans in errors so we get annotated snippets
of source in the error messages to users.
2025-09-08 19:59:42 +00:00
Ed Page
334f66054b refactor(shell): Simplify some code
This is from some review feedback left on #15917 which was merged
in #15920.
2025-09-08 14:32:05 -05:00
Ed Page
0603e4e3b5 docs(frontmatter): Clarify each ScriptSource field's intent 2025-09-08 14:26:28 -05:00
Eric Huss
a9e120f95e
refactor: replace flock with std flock (#15935)
### What does this PR try to resolve?

Replace flock with std flock.

### How to test and review this PR?

Given we've supported Oracle since 2022-12 and don't want to break
people,
this is blocked on std supporting flock emulation via fcntl
rust-lang/rust#146269
2025-09-08 15:12:30 +00:00
Weihang Lo
3ceb2cb250
fix(cli): Adjust messages to match rustc (#15928)
### What does this PR try to resolve?

Fixes #12740

This is also prep for #15917, #15922

Changes:
- `note` changes from Cyan to Bright Green
- `cargo info` had to be changed because the header and context colors
became the same
- Switch to Bright colors which is usually redundant with Bold but that
is theme dependent
- `warning` only changes to Bright on Windows which is to work around a
shell issue on some Windows versions
  - except for `PLACEHOLDER` to tell it apart from `LITERAL`
- the `:` in `note:` is no longer bolded to match rustc

### How to test and review this PR?

### Notes

While annotate-snippets does not have a style for every one of our
styles, I updated our manual styles to be similar to annotate snippets.

For annotate snippets color definitions, see
d38b08b81d/src/renderer/mod.rs (L41-L78)
2025-09-08 04:10:39 +00:00
Weihang Lo
8ec1a522f7
refactor: replace flock with std flock
Given we've supported Oracle since 2022-12
and don't want to break people,
this is blocked on std supporting flock emulation via fcntl
rust-lang/rust 146269
2025-09-06 07:49:29 -04:00
Eric Huss
3b379fcc54
fix: Switch from --nocapture to --no-capture (#15930)
### What does this PR try to resolve?

`--no-capture` was added in 1.88, with `--nocapture` being
soft-deprecated.

### How to test and review this PR?
2025-09-05 22:49:01 +00:00
Ed Page
fa10d65e8e
Render individual compilation sections in --timings pipeline graph (#15923)
### What does this PR try to resolve?
This PR expands the support for `--json-timings` (added in
https://github.com/rust-lang/cargo/pull/15780), by rendering the
individual compilation sections in the pipeline graph of the `--timings`
page.

Before, the linking section was only shown in the table at the bottom of
the page, now it should also be clearly visible in the compilation
graph, which should help more quickly understand how much time is spent
in linking.

<img width="1219" height="358" alt="image"
src="https://github.com/user-attachments/assets/71d0200d-4175-43b7-8aab-997008e2af47"
/>

I also added a legend to the pipeline graph, to explain what do the
colors mean.
<img width="338" height="118" alt="image"
src="https://github.com/user-attachments/assets/69f9bac6-c33f-44c5-8e45-afa97f314e4c"
/>

One wart is that the linking time actually ends a bit before the unit
ends, so there is some "vacuum" at the end where rustc does cleanup,
persists files to disk, deallocates things, etc. That's why I marked the
blue section "Frontend/rest" in the legend.

### How to test and review this PR?
Same as for https://github.com/rust-lang/cargo/pull/15780, e.g.:
```bash
export RUSTC=`rustup +nightly which rustc`
target/debug/cargo build -Zsection-timings --timings
```
on some crate, e.g. [ripgrep](https://github.com/BurntSushi/ripgrep).
2025-09-05 16:05:01 +00:00
Ed Page
19f1d1561c fix: Switch from --nocapture to --no-capture
`--no-capture` was added in 1.88, with `--nocapture` being
soft-deprecated.
2025-09-05 10:33:00 -05:00
Jakub Beránek
80912b6ac5
Add "Other" section after linking 2025-09-05 17:32:55 +02:00
Jakub Beránek
124374846a
Add legend to pipeline graph 2025-09-05 17:24:27 +02:00
Jakub Beránek
2dc90bb6b7
Add a function to draw a legend 2025-09-05 17:24:27 +02:00
Jakub Beránek
69171b7e81
Render link time in pipeline graph 2025-09-05 17:24:26 +02:00
Scott Schafer
43bb5c958b
test(credential): Switch more expected results to snapshots (#15929)
### What does this PR try to resolve?

Had to deal with manually updating these when changing notes.
This will avoid that.

### How to test and review this PR?
2025-09-05 14:59:15 +00:00
Ed Page
eac1ad1cd3 fix(shell): Don't bold the colon after error/warn/note 2025-09-05 09:40:24 -05:00
Ed Page
883cbb22e5 test(credential): Switch more expected results to snapshots
Had to deal with manually updating these when changing notes
2025-09-05 09:24:38 -05:00
Ed Page
7d6d673e23 fix(cli): Adjust terminal styles to match rustc
Fixes #12740
2025-09-04 16:35:40 -05:00
Ed Page
c6ebabd555 chore: Update annotate-snippets 2025-09-04 16:32:13 -05:00
Ed Page
4909d78973 fix(frontmatter): Report script manifest errors for the right line number 2025-09-04 16:15:04 -05:00
Ed Page
578ab7cc45 test(script): Show line numbers are off 2025-09-04 14:56:33 -05:00
Eric Huss
a154b100bc
refactor(cli): Pull out error chain iteration (#15926)
### What does this PR try to resolve?

This is some cleanup that will help with #15922

### How to test and review this PR?
2025-09-04 15:36:24 +00:00
Jakub Beránek
18915936bd
Generalize section rendering in pipeline graph 2025-09-04 10:16:38 +02:00
Jakub Beránek
8cacc027af
Remove unused Serialize derive 2025-09-04 09:59:47 +02:00
Weihang Lo
761c4658d0
refactor(shell): Prepare for Reports being generated in more places (#15920)
### What does this PR try to resolve?

This is preparation for changes like #15917 where we start to use
`annotate_snippets::Report` for handling more of the rendering of our
user messages to be more consistent with rustc and more feature rich in
what we are able to render.

### How to test and review this PR?
2025-09-04 01:25:01 +00:00
Ed Page
4d341c9925 refactor(cli): Pull out error chain iteration 2025-09-03 20:17:04 -05:00
Ed Page
a74370460b refactor(cli): Remove unused return value 2025-09-03 20:09:32 -05:00
Eric Huss
73cedc28a9
refactor(frontmatter): Pull out as a dedicated mod (#15914)
### What does this PR try to resolve?

This sets up the frontmatter logic as being more standalone in prep for
- Adding a custom error type that tracks spans for a more rustc-like
error experience
- Potentially moving this out into a dedicated package

### How to test and review this PR?

### Notes

Had this sitting around for a while but haven't been able to finish the
work that builds on it so wanted this merged to reduce conflicts.
2025-09-04 00:57:43 +00:00
Eric Huss
c50bb1860b
chore: downgrade to libc@0.2.174 (#15918)
### What does this PR try to resolve?

We have downgraded this in rust-lang/cargo#15851
We should also let renovate ignore it.

This also again downgrades libc to 0.2.174 again.

See
<https://github.com/rust-lang/rust/pull/146176#issuecomment-3251098344>.
2025-09-04 00:42:40 +00:00
Weihang Lo
9c4007c6f4
chore(ci): ignore libc from renovate updates
We have downgraded this in rust-lang/cargo#15851
We should also let renovate ignore it.
2025-09-03 16:43:58 -07:00
Weihang Lo
05aca0bded
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.
2025-09-03 16:36:45 -07:00
Ed Page
642411f01a refactor(shell): Allow callers to opt-in to quiet filtering 2025-09-03 15:59:18 -05:00
Ed Page
e3e2b07290 fix(shell): Clear lines for Reports 2025-09-03 15:48:09 -05:00