Fix composite ReadyToRun publish when RelativePath has a path component#55200
Open
jtschuster wants to merge 3 commits into
Open
Fix composite ReadyToRun publish when RelativePath has a path component#55200jtschuster wants to merge 3 commits into
jtschuster wants to merge 3 commits into
Conversation
Component assemblies of a composite R2R image are emitted flat into the composite output directory by crossgen2, so the publish copy-source must use the file name rather than OutputPath+RelativePath. RelativePath still drives the final publish destination. Fixes dotnet/runtime#79902 Co-authored-by: Copilot App <223556219+Copilot@users.noreply.github.com>
Contributor
There was a problem hiding this comment.
Pull request overview
Fixes composite ReadyToRun (crossgen2) publish failures when ResolvedFileToPublish.RelativePath contains a subdirectory, by ensuring the SDK copies composite component outputs from the flat crossgen2 output directory while still honoring RelativePath for the publish destination.
Changes:
- Update
PrepareForReadyToRunCompilationto useOutputPath + fileNameas the publish source path for composite component assemblies. - Add a regression test that rewrites published assemblies’
RelativePathto include a subdirectory and verifies publish + R2R output.
Reviewed changes
Copilot reviewed 2 out of 2 changed files in this pull request and generated 1 comment.
| File | Description |
|---|---|
| test/Microsoft.NET.Publish.Tests/GivenThatWeWantToPublishReadyToRun.cs | Adds regression coverage for composite R2R publish when RelativePath has a subdirectory component. |
| src/Tasks/Microsoft.NET.Build.Tasks/PrepareForReadyToRunCompilation.cs | Adjusts computed publish source path for composite component outputs to match crossgen2’s flat emission behavior. |
rolfbjarne
approved these changes
Jul 8, 2026
…osite-r2r-relativepath # Conflicts: # src/Tasks/Microsoft.NET.Build.Tasks/PrepareForReadyToRunCompilation.cs # test/Microsoft.NET.Publish.Tests/GivenThatWeWantToPublishReadyToRun.cs
kotlarmilos
reviewed
Jul 8, 2026
…ToRun.cs Co-authored-by: Milos Kotlar <kotlarmilos@gmail.com>
MichalStrehovsky
approved these changes
Jul 10, 2026
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 join this conversation on GitHub.
Already have an account?
Sign in to comment
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.
Component assemblies of a composite R2R image are emitted flat into the composite output directory by crossgen2, so the publish copy-source must use the file name rather than OutputPath+RelativePath. RelativePath still drives the final publish destination.
Fixes dotnet/runtime#79902