Skip to content

Cache Embedded Resources during compilation task#10928

Merged
JaynieBai merged 12 commits intodotnet:mainfrom
JaynieBai:dev/jenny/issue10644
Jan 22, 2025
Merged

Cache Embedded Resources during compilation task#10928
JaynieBai merged 12 commits intodotnet:mainfrom
JaynieBai:dev/jenny/issue10644

Conversation

@JaynieBai
Copy link
Copy Markdown
Member

Fixes #10644 and #5334

Context

Fast up-to-date check with SDK project doesn't see new embedded resources!

Changes Made

Add @(_CoreCompileResourceInputs) to CoreCompileCache item, to include them in the cache file which gets
included in the CoreCompile target.

Testing

EmbeddedResourcesFileCompileCache()

Notes

See dotnet/project-system#5794 for more details.

@YuliiaKovalova
Copy link
Copy Markdown
Member

@JanKrivanek please help with this test failure

@JaynieBai
Copy link
Copy Markdown
Member Author

/azp run

@azure-pipelines
Copy link
Copy Markdown

Azure Pipelines successfully started running 1 pipeline(s).

@JaynieBai JaynieBai marked this pull request as ready for review January 6, 2025 09:17
@JaynieBai JaynieBai requested a review from Copilot January 7, 2025 03:57
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.

Copilot reviewed 1 out of 2 changed files in this pull request and generated no comments.

Files not reviewed (1)
  • src/Tasks/Microsoft.Common.CurrentVersion.targets: Language not supported
Comments suppressed due to low confidence (1)

src/Build.UnitTests/ProjectCache/ProjectCacheTests.cs:1664

  • The comment should start with a capital letter: 'The netfx bootstrap layout created with 'dotnet build' is incomplete'.
/// <summary>

@JaynieBai JaynieBai requested a review from SimaTian January 7, 2025 03:59
@JaynieBai JaynieBai merged commit 8a98ded into dotnet:main Jan 22, 2025
Copilot AI added a commit that referenced this pull request Dec 19, 2025
Removed CallTarget approach which was based on incorrect understanding of MSBuild. _GenerateCompileInputs is already a dependency via DependsOnTargets, and MSBuild will ensure it runs before _GenerateCompileDependencyCache within the same invocation.

The real fix is just adding PrepareResources to dependencies to ensure resource metadata (OutputResource) is set before _GenerateCompileInputs runs. This is the minimal change needed to fix the NoBuild issue while preserving PR #10928's caching benefit.

Co-authored-by: JanProvaznik <25267098+JanProvaznik@users.noreply.github.com>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

[Bug]: Deleted embedded resources dont cause rebuild

5 participants