Make the analyzer probe actually run under Roslyn 4.8 - #46
Merged
Merged
Conversation
The probe claimed to protect the analyzer's Roslyn 4.8 floor, but its consumers were built with whatever SDK the working directory resolved: the repository's SDK 10. Rebuilding the analyzer against Microsoft.CodeAnalysis 5.0 still passed the probe. Consumers now carry a global.json pinning the newest installed 8.0 SDK, build from their own directory with the shared compiler off, and the probe fails if no 8.0 SDK exists. With the analyzer built against Roslyn 5.0 it now fails with CS9057. Co-Authored-By: Claude Opus 5 <noreply@anthropic.com>
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.
Found while investigating item 6 (analyzer scope).
Defect.
tools/analyzer-probe/check.shsays its net8.0 consumer protects the analyzer's Roslyn 4.8 floor (ADR 0011). It never ran Roslyn 4.8. The consumers had noglobal.json, anddotnet build <path>resolves the SDK from the working directory, which was the repository root on SDK 10. I checked: withMicrosoft.CodeAnalysis.CSharpraised to 5.0.0, the probe still reported ok.Fix.
global.jsonpinning the newest installed 8.0 SDK, which CI already installs.UseSharedCompilation=false.Verified. With the analyzer built against Roslyn 5.0, the probe now fails with
CS9057 ... references version '5.0.0.0' of the compiler, which is newer than the currently running version '4.8.0.0'. On the real 4.8 pin, it passes.This is the failure #42 (Dependabot's 4.8 → 5.9 bump) would have shipped into the gate.
🤖 Generated with Claude Code