Skip to content

Fix rebuilding mono aot cross compiler when building locally#118445

Merged
akoeplinger merged 2 commits intodotnet:mainfrom
akoeplinger:fix-aot-rebuild
Aug 8, 2025
Merged

Fix rebuilding mono aot cross compiler when building locally#118445
akoeplinger merged 2 commits intodotnet:mainfrom
akoeplinger:fix-aot-rebuild

Conversation

@akoeplinger
Copy link
Copy Markdown
Member

This is a side-effect of the changes made in #109612. When we do rerun the offsets generation script locally it causes the file to be touched even if it's identical, which in turn causes the whole aot cross compiler binary to be rebuilt.

To fix this only write to the output offsets file when it actually changed.

This is a side-effect of the changes made in dotnet#109612.
When we do rerun the offsets generation script locally it causes the file to be touched even if it's identical, which in turn causes the whole aot cross compiler binary to be rebuilt.

To fix this only write to the output offsets file when it actually changed.
Copilot AI review requested due to automatic review settings August 6, 2025 13:29
@github-actions github-actions Bot added the needs-area-label An area label is needed to ensure this gets routed to the appropriate area owners label Aug 6, 2025
Copy link
Copy Markdown
Contributor

Copilot AI left a comment

Choose a reason for hiding this comment

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

Pull Request Overview

This PR fixes a build issue where the mono AOT cross compiler was unnecessarily rebuilding when running locally. The problem occurred because the offsets generation script would always touch the output file even when its contents were identical, triggering a rebuild of the cross compiler binary.

Key changes:

  • Modified the output file writing logic to only update the file when contents actually change
  • Always use ComparableFile for content comparison regardless of validation mode
  • Added conditional logic to determine when to write output files

Comment thread src/mono/mono/offsets/offsets-tool.py Outdated
Co-authored-by: Copilot <175728472+Copilot@users.noreply.github.com>
@akoeplinger akoeplinger merged commit f23d779 into dotnet:main Aug 8, 2025
62 of 65 checks passed
@akoeplinger akoeplinger deleted the fix-aot-rebuild branch August 8, 2025 07:31
@github-actions github-actions Bot locked and limited conversation to collaborators Sep 7, 2025
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.

Labels

needs-area-label An area label is needed to ensure this gets routed to the appropriate area owners

Projects

None yet

Development

Successfully merging this pull request may close these issues.

4 participants