Fix rebuilding mono aot cross compiler when building locally#118445
Merged
akoeplinger merged 2 commits intodotnet:mainfrom Aug 8, 2025
Merged
Fix rebuilding mono aot cross compiler when building locally#118445akoeplinger merged 2 commits intodotnet:mainfrom
akoeplinger merged 2 commits intodotnet:mainfrom
Conversation
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.
Contributor
There was a problem hiding this comment.
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
ComparableFilefor content comparison regardless of validation mode - Added conditional logic to determine when to write output files
Co-authored-by: Copilot <175728472+Copilot@users.noreply.github.com>
pavelsavara
approved these changes
Aug 6, 2025
steveisok
approved these changes
Aug 6, 2025
This was referenced Aug 6, 2025
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to subscribe to this conversation on GitHub.
Already have an account?
Sign in.
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
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.