Skip to content

Remove redundant AsyncTask logging from LinkNativeRuntime - #12238

Merged
jonathanpeppers merged 2 commits into
mainfrom
copilot/fix-finder-replace-obsolete-log-error
Jul 27, 2026
Merged

Remove redundant AsyncTask logging from LinkNativeRuntime#12238
jonathanpeppers merged 2 commits into
mainfrom
copilot/fix-finder-replace-obsolete-log-error

Conversation

Copilot AI commented Jul 26, 2026

Copy link
Copy Markdown
Contributor

LinkNativeRuntime was logging a second failure message via the obsolete AsyncTask.Log property after native linking failed. NativeLinker already reports those failures through localized coded errors (XA3007/XA3008), so the extra log path was both unsafe and redundant.

  • LinkNativeRuntime cleanup

    • Remove the direct Log.LogError (...) call from LinkRuntime.
    • Drop the now-unused success local and invoke NativeLinker.Link (...) directly.
  • Error reporting behavior

    • Keep link failure diagnostics flowing through the existing NativeLinker error paths.
    • Preserve the existing localized/coded errors instead of emitting a raw inline message from a background-thread task.
  • Resulting code shape

    List<ITaskItem> items = OrganizeCommandLineItemsCLR (abi);
    linker.Link (
    	outputRuntime,
    	items,
    	GetAbiItems (NativeLinkStartFiles, "_NativeLinkStartFiles", abi),
    	GetAbiItems (NativeLinkEndFiles, "_NativeLinkEndFiles", abi),
    	GetAbiItems (NativeSymbolsToExport, "_NativeSymbolsToExport", abi)
    );

Co-authored-by: jonathanpeppers <840039+jonathanpeppers@users.noreply.github.com>
Copilot AI changed the title [WIP] Fix obsolete Log.LogError with thread-safe logging in LinkNativeRuntime task Remove redundant AsyncTask logging from LinkNativeRuntime Jul 26, 2026
Copilot AI requested a review from jonathanpeppers July 26, 2026 02:36
@jonathanpeppers
jonathanpeppers marked this pull request as ready for review July 27, 2026 13:40
Copilot AI review requested due to automatic review settings July 27, 2026 13:40
@jonathanpeppers
jonathanpeppers enabled auto-merge (squash) July 27, 2026 13:40
@jonathanpeppers jonathanpeppers added the ready-to-review This PR is ready to review/merge, I think any CI failures are just flaky (ignorable). label Jul 27, 2026

Copilot AI left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

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

Pull request overview

Removes redundant and unsafe error logging from the LinkNativeRuntime MSBuild task by relying on NativeLinker’s existing coded/localized error reporting for native link failures.

Changes:

  • Drop the bool success local and invoke NativeLinker.Link(...) directly.
  • Remove the extra Log.LogError(...) path that emitted a non-localized message from an AsyncTask background thread.
  • Preserve existing XA3007/XA3008 failure diagnostics emitted by NativeLinker.

@jonathanpeppers
jonathanpeppers disabled auto-merge July 27, 2026 19:45
@jonathanpeppers
jonathanpeppers merged commit ec0d213 into main Jul 27, 2026
43 of 45 checks passed
@jonathanpeppers
jonathanpeppers deleted the copilot/fix-finder-replace-obsolete-log-error branch July 27, 2026 19:45
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

ready-to-review This PR is ready to review/merge, I think any CI failures are just flaky (ignorable).

Projects

None yet

Development

Successfully merging this pull request may close these issues.

[fix-finder] Replace obsolete Log.LogError with thread-safe logging in LinkNativeRuntime task

4 participants