Skip to content

[tests] Clear ResolvedCodeAnalysisRuleSet to fix CoreCompile incrementality on CI#10900

Open
jonathanpeppers wants to merge 1 commit intomainfrom
dev/peppers/fix-illink-incrementality
Open

[tests] Clear ResolvedCodeAnalysisRuleSet to fix CoreCompile incrementality on CI#10900
jonathanpeppers wants to merge 1 commit intomainfrom
dev/peppers/fix-illink-incrementality

Conversation

@jonathanpeppers
Copy link
Member

@jonathanpeppers jonathanpeppers commented Mar 6, 2026

CI Guardian SDL analysis (MergeGuardianDotnetAnalyzersRuleSets) regenerates a merged .ruleset file on every build with a new timestamp. Since it is in CoreCompile's Inputs, this causes CoreCompile to re-run even when no source files changed, cascading through ILLink -> _GenerateJavaStubs -> _Sign and breaking incrementality tests:

  • BasicApplicationRepetitiveReleaseBuild
  • CheckTimestamps
  • GenerateJavaStubsAndAssembly

…tality on CI

CI Guardian SDL analysis (MergeGuardianDotnetAnalyzersRuleSets) regenerates a
merged .ruleset file on every build with a new timestamp. Since
 is in CoreCompile's Inputs, this causes
CoreCompile to re-run even when no source files changed, cascading through
ILLink -> _GenerateJavaStubs -> _Sign and breaking incrementality tests:
- BasicApplicationRepetitiveReleaseBuild
- CheckTimestamps
- GenerateJavaStubsAndAssembly
@jonathanpeppers jonathanpeppers marked this pull request as ready for review March 6, 2026 20:50
Copilot AI review requested due to automatic review settings March 6, 2026 20:50
@jonathanpeppers
Copy link
Member Author

This might be happening on main/trusted builds only, running a build here:

Copy link
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 addresses a CI flakiness issue where the Guardian SDL analysis tool (MergeGuardianDotnetAnalyzersRuleSets) regenerates a merged .ruleset file with a new timestamp on every build. Since this file path is passed to CoreCompile via $(ResolvedCodeAnalysisRuleSet), MSBuild considers the inputs stale and re-runs CoreCompile unnecessarily, cascading through subsequent targets (ILLink, _GenerateJavaStubs, _Sign) and breaking incrementality tests.

Changes:

  • Adds an MSBuild target _ClearResolvedCodeAnalysisRuleSet to Directory.Build.targets in the test project template that clears $(ResolvedCodeAnalysisRuleSet) just before CoreCompile runs, restoring correct incremental build behavior on CI.

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.

2 participants