Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Unset EffectiveAnalysisLevelStyle causes error in AddGlobalAnalyzerConfigForPackage target #71260

Closed
mthalman opened this issue Dec 14, 2023 · 1 comment · Fixed by #71262
Closed
Labels
Area-Analyzers untriaged Issues and PRs which have not yet been triaged by a lead

Comments

@mthalman
Copy link
Member

I'm attempting to update the VMR to use a newer build of the .NET SDK. The build is failing when it attempts to build the msbuild repo:

/vmr/.dotnet/sdk/9.0.100-alpha.1.23613.9/Sdks/Microsoft.NET.Sdk/codestyle/cs/build/Microsoft.CodeAnalysis.CSharp.CodeStyle.targets(51,16): error MSB4184: The expression "[MSBuild]::VersionGreaterThanOrEquals('', 9.0)" cannot be evaluated. Version string was not in a correct format. [/vmr/src/msbuild/artifacts/source-build/self/src/src/Framework/Microsoft.Build.Framework.csproj]

This occurs during evaluation of this condition:

<ItemGroup Condition="Exists('$(_GlobalAnalyzerConfigFile_MicrosoftCodeAnalysisCSharpCodeStyle)') and ('$(AnalysisLevelStyle)' != '$(AnalysisLevel)' or '$(AnalysisModeStyle)' != '$(AnalysisMode)' or $([MSBuild]::VersionGreaterThanOrEquals('$(EffectiveAnalysisLevelStyle)', '9.0')))">

In this scenario, the EffectiveAnalysisLevelStyle property is not set. Looking at the evaluation of this property, it seems dependent on AnalysisLevelStyle and AnalysisLevel which are also not set.

Repro Steps

  1. Clone the VMR, in main branch
  2. Apply the following changes:
 eng/Versions.props | 6 +++---
 global.json        | 2 +-
 2 files changed, 4 insertions(+), 4 deletions(-)

diff --git a/eng/Versions.props b/eng/Versions.props
index 2b7f21364c..099bb3a728 100644
--- a/eng/Versions.props
+++ b/eng/Versions.props
@@ -23,8 +23,8 @@
       of a .NET major or minor release, prebuilts may be needed. When the release is mature, prebuilts
       are not necessary, and this property is removed from the file.
     -->
-    <PrivateSourceBuiltSdkVersion>9.0.100-alpha.1.23603.1</PrivateSourceBuiltSdkVersion>
-    <PrivateSourceBuiltArtifactsVersion>9.0.100-alpha.1.23603.1</PrivateSourceBuiltArtifactsVersion>
-    <PrivateSourceBuiltPrebuiltsVersion>0.1.0-9.0.100-6</PrivateSourceBuiltPrebuiltsVersion>
+    <PrivateSourceBuiltSdkVersion>9.0.100-alpha.1.23614.1</PrivateSourceBuiltSdkVersion>
+    <PrivateSourceBuiltArtifactsVersion>9.0.100-alpha.1.23614.1</PrivateSourceBuiltArtifactsVersion>
+    <PrivateSourceBuiltPrebuiltsVersion>0.1.0-9.0.100-7</PrivateSourceBuiltPrebuiltsVersion>
   </PropertyGroup>
 </Project>
diff --git a/global.json b/global.json
index 8374e1deb2..ee45585bb1 100644
--- a/global.json
+++ b/global.json
@@ -1,6 +1,6 @@
 {
   "tools": {
-    "dotnet": "9.0.100-alpha.1.23603.1"
+    "dotnet": "9.0.100-alpha.1.23613.9"
   },
   "msbuild-sdks": {
     "Microsoft.Build.CentralPackageVersions": "2.0.1",
  1. ./prep.sh && ./build.sh --online --clean-while-building

This will cause a build failure once it reaches the build of the msbuild repo. Here's the binlog:
msbuild.zip

This appears to be related to the changes from #70794. /cc @mavasani

This needs to be fixed before 9.0 Preview 1, preferably soon so that we can uncover potential issues in other repos beyond msbuild during the build of the VMR.

@dotnet-issue-labeler dotnet-issue-labeler bot added Area-Analyzers untriaged Issues and PRs which have not yet been triaged by a lead labels Dec 14, 2023
@mavasani
Copy link
Contributor

@mthalman This seems to have regressed with https://github.com/dotnet/roslyn/pull/71173/files. I'll create a PR in a bit for the fix.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Area-Analyzers untriaged Issues and PRs which have not yet been triaged by a lead
Projects
None yet
Development

Successfully merging a pull request may close this issue.

2 participants