Skip to content

Fix composite ReadyToRun publish when RelativePath has a path component#55200

Open
jtschuster wants to merge 3 commits into
dotnet:mainfrom
jtschuster:jtschuster-fix-composite-r2r-relativepath
Open

Fix composite ReadyToRun publish when RelativePath has a path component#55200
jtschuster wants to merge 3 commits into
dotnet:mainfrom
jtschuster:jtschuster-fix-composite-r2r-relativepath

Conversation

@jtschuster

Copy link
Copy Markdown
Member

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

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>

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

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 PrepareForReadyToRunCompilation to use OutputPath + fileName as the publish source path for composite component assemblies.
  • Add a regression test that rewrites published assemblies’ RelativePath to 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.

…osite-r2r-relativepath

# Conflicts:
#	src/Tasks/Microsoft.NET.Build.Tasks/PrepareForReadyToRunCompilation.cs
#	test/Microsoft.NET.Publish.Tests/GivenThatWeWantToPublishReadyToRun.cs
Comment thread test/Microsoft.NET.Publish.Tests/GivenThatWeWantToPublishReadyToRun.cs Outdated
…ToRun.cs

Co-authored-by: Milos Kotlar <kotlarmilos@gmail.com>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Projects

None yet

Development

Successfully merging this pull request may close these issues.

Composite ReadyToRun fails when RelativePath has a path component

5 participants