Skip to content

codegen: classify localized MSVC linker progress as linker_info - #160445

Merged
rust-bors[bot] merged 1 commit into
rust-lang:mainfrom
rabindra789:fix/msvc-localized-linker-output
Aug 8, 2026
Merged

codegen: classify localized MSVC linker progress as linker_info#160445
rust-bors[bot] merged 1 commit into
rust-lang:mainfrom
rabindra789:fix/msvc-localized-linker-output

Conversation

@rabindra789

@rabindra789 rabindra789 commented Aug 3, 2026

Copy link
Copy Markdown
Contributor

Fixes #159133.

report_linker_output currently recognizes only a small set of English link.exe progress messages as informational. When the linker output is localized, equivalent progress messages are instead emitted through the linker_messages lint.

Instead of matching specific English strings, classify MSVC linker output based on locale-independent LNK#### diagnostic codes.Lines without an LNK#### code are routed to linker_info, while diagnostics continue to be emitted through linker_messages. The existing LNK6004 incremental-link exception is preserved.

Testing

  • Added a run-make regression test for localized link.exe progress output.
  • Verified the existing MSVC linker-info tests continue to pass.

@rustbot rustbot added A-run-make Area: port run-make Makefiles to rmake.rs S-waiting-on-review Status: Awaiting review from the assignee but also interested parties. T-compiler Relevant to the compiler team, which will review and decide on the PR/issue. labels Aug 3, 2026
@rustbot

rustbot commented Aug 3, 2026

Copy link
Copy Markdown
Collaborator

r? @nnethercote

rustbot has assigned @nnethercote.
They will have a look at your PR within the next two weeks and either review your PR or reassign to another reviewer.

Use r? to explicitly pick a reviewer

Why was this reviewer chosen?

The reviewer was selected based on:

  • Owners of files modified in this PR: compiler
  • compiler expanded to 75 candidates
  • Random selection from 19 candidates

@rustbot

This comment has been minimized.

@rabindra789
rabindra789 force-pushed the fix/msvc-localized-linker-output branch from a757efd to 1b5e16b Compare August 3, 2026 14:54
@rabindra789
rabindra789 marked this pull request as draft August 3, 2026 15:06
@rustbot rustbot added S-waiting-on-author Status: This is awaiting some action (such as code changes or more information) from the author. and removed S-waiting-on-review Status: Awaiting review from the assignee but also interested parties. labels Aug 3, 2026
@rabindra789
rabindra789 force-pushed the fix/msvc-localized-linker-output branch from 1b5e16b to c94079b Compare August 3, 2026 15:11
@rust-log-analyzer

This comment has been minimized.

@rabindra789
rabindra789 force-pushed the fix/msvc-localized-linker-output branch from c94079b to 9c49052 Compare August 4, 2026 07:28
@rabindra789
rabindra789 marked this pull request as ready for review August 4, 2026 08:51
@rustbot rustbot added S-waiting-on-review Status: Awaiting review from the assignee but also interested parties. and removed S-waiting-on-author Status: This is awaiting some action (such as code changes or more information) from the author. labels Aug 4, 2026
Comment thread compiler/rustc_codegen_ssa/src/back/link.rs Outdated
Comment thread tests/run-make/msvc-localized-linker-output/rmake.rs
Comment thread tests/run-make/msvc-localized-linker-output/rmake.rs Outdated
@nnethercote

Copy link
Copy Markdown
Contributor

This looks ok to me but I'm no expert on this stuff. jyn did #136096 so I will defer to them:

r? @jyn514

@rustbot

rustbot commented Aug 6, 2026

Copy link
Copy Markdown
Collaborator

Failed to set assignee to jyn514: invalid assignee

Note: Only org members with at least the repository "read" role, users with write permissions, or people who have commented on the PR may be assigned.

@nnethercote

Copy link
Copy Markdown
Contributor

Failed to set assignee to jyn514: invalid assignee

Doesn't have review privileges? Huh. Should probably still take a look...

@rabindra789
rabindra789 force-pushed the fix/msvc-localized-linker-output branch from 9c49052 to a082aa0 Compare August 6, 2026 13:06
@rabindra789

rabindra789 commented Aug 6, 2026

Copy link
Copy Markdown
Contributor Author

Thanks for the review! @nnethercote I've addressed the comments:

Wrapped the long comments.
Added //@ ignore-cross-compile.
Replaced the hardcoded target triple with run_make_support::target().

Force-pushed the updated commit

@jyn514

jyn514 commented Aug 6, 2026

Copy link
Copy Markdown
Member

this seems like a good idea but i don’t think i’m a good reviewer for stuff involving link.exe.

r? @ChrisDenton

@rustbot rustbot assigned ChrisDenton and unassigned nnethercote Aug 6, 2026
@rustbot

rustbot commented Aug 6, 2026

Copy link
Copy Markdown
Collaborator

ChrisDenton is not on the review rotation at the moment.
They may take a while to respond.

@ChrisDenton ChrisDenton left a comment

Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Looks reasonable to me. Could you add a test for the ilk_but_no_exe case? EDIT: oh there's already a test for that, never mind!

Comment thread compiler/rustc_codegen_ssa/src/back/link.rs Outdated
link.exe progress messages (e.g. "Creating library ...") are detected
by matching their English text, which fails when the English language
pack is not installed and the output is localized despite VSLANG=1033.
Since all actual warnings and errors carry a locale-independent LNK####
code, classify every line without one as linker_info instead of
linker_messages.

Diagnostics are recognized by their structured form, `LINK : warning
LNK####:`: the code must be followed by a `:` that is the second colon
in the line, so the matcher cannot accidentally hit file names.

The one code-bearing informational line, LNK6004 ("performing full
link"), keeps the exception that was previously handled by matching its
English text.
@rabindra789
rabindra789 force-pushed the fix/msvc-localized-linker-output branch from a082aa0 to a1b86a7 Compare August 6, 2026 14:45
@rabindra789
rabindra789 requested a review from ChrisDenton August 6, 2026 17:06
@ChrisDenton

Copy link
Copy Markdown
Member

Thanks!

@bors r+ rollup

@rust-bors

rust-bors Bot commented Aug 7, 2026

Copy link
Copy Markdown
Contributor

📌 Commit a1b86a7 has been approved by ChrisDenton

It is now in the queue for this repository.

🌲 The tree is currently closed for pull requests below priority 6. This pull request will be tested once the tree is reopened.

Reason for tree closure: Github problems

@rust-bors rust-bors Bot added S-waiting-on-bors Status: Waiting on bors to run and complete tests. Bors will change the label on completion. and removed S-waiting-on-review Status: Awaiting review from the assignee but also interested parties. labels Aug 7, 2026
jhpratt added a commit to jhpratt/rust that referenced this pull request Aug 7, 2026
…ker-output, r=ChrisDenton

codegen: classify localized MSVC linker progress as linker_info

Fixes rust-lang#159133.

`report_linker_output` currently recognizes only a small set of English `link.exe` progress messages as informational. When the linker output is localized, equivalent progress messages are instead emitted through the `linker_messages` lint.

Instead of matching specific English strings, classify MSVC linker output based on locale-independent `LNK####` diagnostic codes.Lines without an `LNK####` code are routed to `linker_info`, while diagnostics continue to be emitted through `linker_messages`. The existing `LNK6004` incremental-link exception is preserved.

Testing

- Added a run-make regression test for localized `link.exe` progress output.
- Verified the existing MSVC linker-info tests continue to pass.
rust-bors Bot pushed a commit that referenced this pull request Aug 7, 2026
Rollup of 14 pull requests

Successful merges:

 - #150885 (Revive L4Re target)
 - #159643 (Add support for splatted function pointers)
 - #160433 (delegation: add support for wrapping of the return value with `From::from`)
 - #160530 (refactor handling of target features in Session)
 - #160606 (bootstrap: Store and use an explicit CheckKind in `check::Rustc`)
 - #160628 (fix ICE in `suggest_add_reference_to_arg` for non-callable items)
 - #160634 (miri subtree update)
 - #158904 (Fix FutureDropPoll shim for by-move async closures)
 - #160335 (dlopen offload)
 - #160445 (codegen: classify localized MSVC linker progress as linker_info)
 - #160504 (cleanup borrowck, improve c-variadic handling)
 - #160587 (Add regression test for associated type outlives bound at call site)
 - #160625 (platform-support/netbsd.md: No longer mention 8.x, due to EoL.)
 - #160636 (derive(Diagnostic): link to proper docs)
JonathanBrouwer added a commit to JonathanBrouwer/rust that referenced this pull request Aug 7, 2026
…ker-output, r=ChrisDenton

codegen: classify localized MSVC linker progress as linker_info

Fixes rust-lang#159133.

`report_linker_output` currently recognizes only a small set of English `link.exe` progress messages as informational. When the linker output is localized, equivalent progress messages are instead emitted through the `linker_messages` lint.

Instead of matching specific English strings, classify MSVC linker output based on locale-independent `LNK####` diagnostic codes.Lines without an `LNK####` code are routed to `linker_info`, while diagnostics continue to be emitted through `linker_messages`. The existing `LNK6004` incremental-link exception is preserved.

Testing

- Added a run-make regression test for localized `link.exe` progress output.
- Verified the existing MSVC linker-info tests continue to pass.
rust-bors Bot pushed a commit that referenced this pull request Aug 7, 2026
…uwer

Rollup of 21 pull requests

Successful merges:

 - #159784 (Hint that memchr returns an in-bounds index)
 - #150885 (Revive L4Re target)
 - #159643 (Add support for splatted function pointers)
 - #160433 (delegation: add support for wrapping of the return value with `From::from`)
 - #160530 (refactor handling of target features in Session)
 - #160606 (bootstrap: Store and use an explicit CheckKind in `check::Rustc`)
 - #160628 (fix ICE in `suggest_add_reference_to_arg` for non-callable items)
 - #160634 (miri subtree update)
 - #157641 (Do not promote extern statics)
 - #158904 (Fix FutureDropPoll shim for by-move async closures)
 - #160103 (Add regression test for GAT bound mismatched type error)
 - #160335 (dlopen offload)
 - #160445 (codegen: classify localized MSVC linker progress as linker_info)
 - #160499 (rustc_resolve: move diagnostic attribute linting to attr parsing)
 - #160504 (cleanup borrowck, improve c-variadic handling)
 - #160577 (expand: Feature gate AST-based attribute macros on expressions and statements)
 - #160587 (Add regression test for associated type outlives bound at call site)
 - #160625 (platform-support/netbsd.md: No longer mention 8.x, due to EoL.)
 - #160636 (derive(Diagnostic): link to proper docs)
 - #160644 (Clean up some manual debug impls)
 - #160649 (move naked function ui tests)
JonathanBrouwer added a commit to JonathanBrouwer/rust that referenced this pull request Aug 7, 2026
…ker-output, r=ChrisDenton

codegen: classify localized MSVC linker progress as linker_info

Fixes rust-lang#159133.

`report_linker_output` currently recognizes only a small set of English `link.exe` progress messages as informational. When the linker output is localized, equivalent progress messages are instead emitted through the `linker_messages` lint.

Instead of matching specific English strings, classify MSVC linker output based on locale-independent `LNK####` diagnostic codes.Lines without an `LNK####` code are routed to `linker_info`, while diagnostics continue to be emitted through `linker_messages`. The existing `LNK6004` incremental-link exception is preserved.

Testing

- Added a run-make regression test for localized `link.exe` progress output.
- Verified the existing MSVC linker-info tests continue to pass.
rust-bors Bot pushed a commit that referenced this pull request Aug 7, 2026
…uwer

Rollup of 20 pull requests

Successful merges:

 - #159784 (Hint that memchr returns an in-bounds index)
 - #150885 (Revive L4Re target)
 - #159643 (Add support for splatted function pointers)
 - #160433 (delegation: add support for wrapping of the return value with `From::from`)
 - #160530 (refactor handling of target features in Session)
 - #160606 (bootstrap: Store and use an explicit CheckKind in `check::Rustc`)
 - #160628 (fix ICE in `suggest_add_reference_to_arg` for non-callable items)
 - #160634 (miri subtree update)
 - #157641 (Do not promote extern statics)
 - #158904 (Fix FutureDropPoll shim for by-move async closures)
 - #160103 (Add regression test for GAT bound mismatched type error)
 - #160335 (dlopen offload)
 - #160445 (codegen: classify localized MSVC linker progress as linker_info)
 - #160499 (rustc_resolve: move diagnostic attribute linting to attr parsing)
 - #160504 (cleanup borrowck, improve c-variadic handling)
 - #160577 (expand: Feature gate AST-based attribute macros on expressions and statements)
 - #160587 (Add regression test for associated type outlives bound at call site)
 - #160625 (platform-support/netbsd.md: No longer mention 8.x, due to EoL.)
 - #160636 (derive(Diagnostic): link to proper docs)
 - #160644 (Clean up some manual debug impls)
jhpratt added a commit to jhpratt/rust that referenced this pull request Aug 7, 2026
…ker-output, r=ChrisDenton

codegen: classify localized MSVC linker progress as linker_info

Fixes rust-lang#159133.

`report_linker_output` currently recognizes only a small set of English `link.exe` progress messages as informational. When the linker output is localized, equivalent progress messages are instead emitted through the `linker_messages` lint.

Instead of matching specific English strings, classify MSVC linker output based on locale-independent `LNK####` diagnostic codes.Lines without an `LNK####` code are routed to `linker_info`, while diagnostics continue to be emitted through `linker_messages`. The existing `LNK6004` incremental-link exception is preserved.

Testing

- Added a run-make regression test for localized `link.exe` progress output.
- Verified the existing MSVC linker-info tests continue to pass.
rust-bors Bot pushed a commit that referenced this pull request Aug 7, 2026
…uwer

Rollup of 28 pull requests

Successful merges:

 - #159784 (Hint that memchr returns an in-bounds index)
 - #160673 (Improve `canonical_param_env_cache`)
 - #150885 (Revive L4Re target)
 - #159643 (Add support for splatted function pointers)
 - #160433 (delegation: add support for wrapping of the return value with `From::from`)
 - #160530 (refactor handling of target features in Session)
 - #160606 (bootstrap: Store and use an explicit CheckKind in `check::Rustc`)
 - #160628 (fix ICE in `suggest_add_reference_to_arg` for non-callable items)
 - #160683 (Add regression test for unknown feaeture name reported with other errors)
 - #157641 (Do not promote extern statics)
 - #158904 (Fix FutureDropPoll shim for by-move async closures)
 - #159816 (added note/help about iterator invalidation when mutating a collection inside a for loop)
 - #160103 (Add regression test for GAT bound mismatched type error)
 - #160335 (dlopen offload)
 - #160445 (codegen: classify localized MSVC linker progress as linker_info)
 - #160499 (rustc_resolve: move diagnostic attribute linting to attr parsing)
 - #160504 (cleanup borrowck, improve c-variadic handling)
 - #160577 (expand: Feature gate AST-based attribute macros on expressions and statements)
 - #160587 (Add regression test for associated type outlives bound at call site)
 - #160625 (platform-support/netbsd.md: No longer mention 8.x, due to EoL.)
 - #160633 (delegation: fix determining wrong `FnKind` when delegation is inside const arg)
 - #160636 (derive(Diagnostic): link to proper docs)
 - #160644 (Clean up some manual debug impls)
 - #160649 (move naked function ui tests)
 - #160672 (Improve `MaybeLiveLocals`)
 - #160693 (Add branch config for perf. unrolling in bors)
 - #160696 (rustc_codegen_llvm: handle sm_101* features being an alias)
 - #160706 (renovate: clarify that vulnerability PRs are opened automatically)
@rust-bors
rust-bors Bot merged commit 615aa92 into rust-lang:main Aug 8, 2026
13 checks passed
@rustbot rustbot added this to the 1.99.0 milestone Aug 8, 2026
@rabindra789
rabindra789 deleted the fix/msvc-localized-linker-output branch August 8, 2026 03:12
pull Bot pushed a commit to LeeeeeeM/miri that referenced this pull request Aug 8, 2026
…uwer

Rollup of 28 pull requests

Successful merges:

 - rust-lang/rust#159784 (Hint that memchr returns an in-bounds index)
 - rust-lang/rust#160673 (Improve `canonical_param_env_cache`)
 - rust-lang/rust#150885 (Revive L4Re target)
 - rust-lang/rust#159643 (Add support for splatted function pointers)
 - rust-lang/rust#160433 (delegation: add support for wrapping of the return value with `From::from`)
 - rust-lang/rust#160530 (refactor handling of target features in Session)
 - rust-lang/rust#160606 (bootstrap: Store and use an explicit CheckKind in `check::Rustc`)
 - rust-lang/rust#160628 (fix ICE in `suggest_add_reference_to_arg` for non-callable items)
 - rust-lang/rust#160683 (Add regression test for unknown feaeture name reported with other errors)
 - rust-lang/rust#157641 (Do not promote extern statics)
 - rust-lang/rust#158904 (Fix FutureDropPoll shim for by-move async closures)
 - rust-lang/rust#159816 (added note/help about iterator invalidation when mutating a collection inside a for loop)
 - rust-lang/rust#160103 (Add regression test for GAT bound mismatched type error)
 - rust-lang/rust#160335 (dlopen offload)
 - rust-lang/rust#160445 (codegen: classify localized MSVC linker progress as linker_info)
 - rust-lang/rust#160499 (rustc_resolve: move diagnostic attribute linting to attr parsing)
 - rust-lang/rust#160504 (cleanup borrowck, improve c-variadic handling)
 - rust-lang/rust#160577 (expand: Feature gate AST-based attribute macros on expressions and statements)
 - rust-lang/rust#160587 (Add regression test for associated type outlives bound at call site)
 - rust-lang/rust#160625 (platform-support/netbsd.md: No longer mention 8.x, due to EoL.)
 - rust-lang/rust#160633 (delegation: fix determining wrong `FnKind` when delegation is inside const arg)
 - rust-lang/rust#160636 (derive(Diagnostic): link to proper docs)
 - rust-lang/rust#160644 (Clean up some manual debug impls)
 - rust-lang/rust#160649 (move naked function ui tests)
 - rust-lang/rust#160672 (Improve `MaybeLiveLocals`)
 - rust-lang/rust#160693 (Add branch config for perf. unrolling in bors)
 - rust-lang/rust#160696 (rustc_codegen_llvm: handle sm_101* features being an alias)
 - rust-lang/rust#160706 (renovate: clarify that vulnerability PRs are opened automatically)
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

A-run-make Area: port run-make Makefiles to rmake.rs S-waiting-on-bors Status: Waiting on bors to run and complete tests. Bors will change the label on completion. T-compiler Relevant to the compiler team, which will review and decide on the PR/issue.

Projects

None yet

Development

Successfully merging this pull request may close these issues.

Regression: localized MSVC linker progress messages are emitted as linker stdout warnings

6 participants