From c278628e5bcbda3aac203be84e58a5b5263b6205 Mon Sep 17 00:00:00 2001 From: "Matt Mitchell (.NET)" Date: Wed, 11 Sep 2024 12:07:08 -0700 Subject: [PATCH 1/6] Switch to new VMR control set Now that roslyn is on 9.0, we can switch to the new control set. Generally: - DotNetBuildFromSource -> DotNetBuildSourceOnly - Building a source-only build. - DotnetBuildFromSourceFlavor == Product -> DotNetBuildOrchestrator == true - Building in the VMR, could be source-only or MS's build. - ArcadeBuildFromSource -> DotNetBuildRepo == true -> Indicates an outer repo build. --- eng/Directory.Packages.props | 6 +++--- eng/Versions.props | 2 +- eng/build.ps1 | 4 ++-- eng/build.sh | 8 ++++---- eng/generate-vssdk-versions.csx | 2 +- eng/targets/DiaSymReaderNative.targets | 2 +- eng/targets/Imports.BeforeArcade.targets | 2 +- eng/targets/Imports.targets | 2 +- eng/targets/Settings.props | 8 ++++---- eng/targets/TargetFrameworks.props | 4 ++-- src/Compilers/Core/Portable/Microsoft.CodeAnalysis.csproj | 4 ++-- .../Core/Portable/Microsoft.CodeAnalysis.Features.csproj | 4 ++-- src/Interactive/csi/csi.csproj | 2 +- src/Interactive/vbi/vbi.vbproj | 2 +- .../DesktopCompilerArtifacts.targets | 8 ++++---- .../VS.Tools.Roslyn.Package.csproj | 2 +- .../DevDivVsix/CompilersPackage/CompilersPackage.targets | 2 +- src/Setup/Installer/Installer.Package.csproj | 2 +- ...osoft.CodeAnalysis.Workspaces.MSBuild.BuildHost.csproj | 2 +- .../Microsoft.CodeAnalysis.Workspaces.MSBuild.csproj | 2 +- .../Portable/Microsoft.CodeAnalysis.Workspaces.csproj | 4 ++-- .../Compiler/Core/CompilerExtensions.projitems | 2 +- 22 files changed, 38 insertions(+), 38 deletions(-) diff --git a/eng/Directory.Packages.props b/eng/Directory.Packages.props index 43df945a6417a..f8712d2e1c8b5 100644 --- a/eng/Directory.Packages.props +++ b/eng/Directory.Packages.props @@ -31,21 +31,21 @@ https://github.com/dotnet/sdk/blob/main/src/Layout/redist/minimumMSBuildVersion#L1 --> - + - + - + diff --git a/eng/Versions.props b/eng/Versions.props index 43472e1a059d4..9b0ffbf81905f 100644 --- a/eng/Versions.props +++ b/eng/Versions.props @@ -64,7 +64,7 @@ 13.0.3 6.34.0 - 9.0.0-beta.24076.5 + 9.0.0-beta.24076.5 4.61.3 6.34.0 diff --git a/eng/build.ps1 b/eng/build.ps1 index c8d54142a6e71..4e1c32662de95 100644 --- a/eng/build.ps1 +++ b/eng/build.ps1 @@ -252,8 +252,8 @@ function BuildSolution() { # Workaround for some machines in the AzDO pool not allowing long paths $ibcDir = $RepoRoot - # Set DotNetBuildFromSource to 'true' if we're simulating building for source-build. - $buildFromSource = if ($sourceBuild) { "/p:DotNetBuildFromSource=true" } else { "" } + # Set DotNetBuildSourceOnly to 'true' if we're simulating building for source-build. + $buildFromSource = if ($sourceBuild) { "/p:DotNetBuildSourceOnly=true" } else { "" } $generateDocumentationFile = if ($skipDocumentation) { "/p:GenerateDocumentationFile=false" } else { "" } $roslynUseHardLinks = if ($ci) { "/p:ROSLYNUSEHARDLINKS=true" } else { "" } diff --git a/eng/build.sh b/eng/build.sh index 5a8558e054d66..482f9c0b90839 100755 --- a/eng/build.sh +++ b/eng/build.sh @@ -169,9 +169,8 @@ while [[ $# > 0 ]]; do --warnaserror) warn_as_error=true ;; - --sourcebuild|/p:arcadebuildfromsource=true) - # Arcade specifies /p:ArcadeBuildFromSource=true instead of --sourceBuild, but that's not developer friendly so we - # have an alias. + --sourcebuild|/p:dotnetbuildsourceonly=true) + # Arcade passes /p:DotNetBuildSourceOnly=true and /p:DotNetBuildRepo=true when --sourcebuild or -sb is passed. Include this switch in our build scripts. source_build=true # RestoreUseStaticGraphEvaluation will cause prebuilts restoreUseStaticGraphEvaluation=false @@ -302,7 +301,8 @@ function BuildSolution { /p:ContinuousIntegrationBuild=$ci \ /p:TreatWarningsAsErrors=true \ /p:TestRuntimeAdditionalArguments=$test_runtime_args \ - /p:ArcadeBuildFromSource=$source_build \ + /p:DotNetBuildSourceOnly=$source_build \ + /p:DotNetBuildRepo=$source_build \ $test_runtime \ $mono_tool \ $generate_documentation_file \ diff --git a/eng/generate-vssdk-versions.csx b/eng/generate-vssdk-versions.csx index 00418d83313e0..0a751f62c31bb 100644 --- a/eng/generate-vssdk-versions.csx +++ b/eng/generate-vssdk-versions.csx @@ -73,7 +73,7 @@ foreach (var (id, version) in properties) else if (!seenMsbuild) { Console.WriteLine($$""" - + diff --git a/eng/targets/DiaSymReaderNative.targets b/eng/targets/DiaSymReaderNative.targets index 6d52450769734..11956fb0b5233 100644 --- a/eng/targets/DiaSymReaderNative.targets +++ b/eng/targets/DiaSymReaderNative.targets @@ -18,7 +18,7 @@ package can't be referenced directly but rather has to have it's assets manually copied out. This logic is responsible for doing that. --> - + PreserveNewest false diff --git a/eng/targets/Imports.BeforeArcade.targets b/eng/targets/Imports.BeforeArcade.targets index b24d5c05bc401..dae97165ac94c 100644 --- a/eng/targets/Imports.BeforeArcade.targets +++ b/eng/targets/Imports.BeforeArcade.targets @@ -14,7 +14,7 @@ - + false diff --git a/eng/targets/Imports.targets b/eng/targets/Imports.targets index ba2a9ac4f8433..c8696437ac702 100644 --- a/eng/targets/Imports.targets +++ b/eng/targets/Imports.targets @@ -150,7 +150,7 @@ - + diff --git a/eng/targets/Settings.props b/eng/targets/Settings.props index 743d89f41361d..faafdb4653aa3 100644 --- a/eng/targets/Settings.props +++ b/eng/targets/Settings.props @@ -30,7 +30,7 @@ true true true - true + true NON_EXISTENT_FILE @@ -154,7 +154,7 @@ - + @@ -169,7 +169,7 @@ - + @@ -249,7 +249,7 @@ - + DOTNET_BUILD_FROM_SOURCE;$(DefineConstants) DOTNET_BUILD_FROM_SOURCE diff --git a/eng/targets/TargetFrameworks.props b/eng/targets/TargetFrameworks.props index 8493c1046cb51..1132c2d08b57f 100644 --- a/eng/targets/TargetFrameworks.props +++ b/eng/targets/TargetFrameworks.props @@ -35,7 +35,7 @@ bootstrap toolset in other repos doing (1). Those can be using a NetPrevious runtime hence the toolset must support that. --> - + $(NetMinimum) @@ -50,7 +50,7 @@ - + $(NetCurrent) $(NetCurrent);$(NetPrevious) diff --git a/src/Compilers/Core/Portable/Microsoft.CodeAnalysis.csproj b/src/Compilers/Core/Portable/Microsoft.CodeAnalysis.csproj index 99b7f038eb898..94c47e9a01e9e 100644 --- a/src/Compilers/Core/Portable/Microsoft.CodeAnalysis.csproj +++ b/src/Compilers/Core/Portable/Microsoft.CodeAnalysis.csproj @@ -30,7 +30,7 @@ Note: PrivateAssets="ContentFiles" ensures that projects referencing Microsoft.CodeAnalysis.Common package will import everything but content files from Microsoft.CodeAnalysis.Analyzers, specifically, analyzers. --> - + @@ -40,7 +40,7 @@ - + diff --git a/src/Features/Core/Portable/Microsoft.CodeAnalysis.Features.csproj b/src/Features/Core/Portable/Microsoft.CodeAnalysis.Features.csproj index f723a4ff711f4..c3729dd724429 100644 --- a/src/Features/Core/Portable/Microsoft.CodeAnalysis.Features.csproj +++ b/src/Features/Core/Portable/Microsoft.CodeAnalysis.Features.csproj @@ -118,7 +118,7 @@ - + @@ -137,7 +137,7 @@ WARNING: All package references must have an OSS license since this assembly is shipped with dotnet-watch and dotnet-format. --> - + diff --git a/src/Interactive/csi/csi.csproj b/src/Interactive/csi/csi.csproj index 24f12e41615da..9ccdffbbfae79 100644 --- a/src/Interactive/csi/csi.csproj +++ b/src/Interactive/csi/csi.csproj @@ -6,7 +6,7 @@ Exe CSharpInteractive $(NetRoslynSourceBuild);net472 - false + false true diff --git a/src/Interactive/vbi/vbi.vbproj b/src/Interactive/vbi/vbi.vbproj index a3c0cda7f116e..2895249e32a81 100644 --- a/src/Interactive/vbi/vbi.vbproj +++ b/src/Interactive/vbi/vbi.vbproj @@ -6,7 +6,7 @@ Exe Sub Main $(NetRoslynSourceBuild);net472 - false + false false diff --git a/src/NuGet/Microsoft.Net.Compilers.Toolset/DesktopCompilerArtifacts.targets b/src/NuGet/Microsoft.Net.Compilers.Toolset/DesktopCompilerArtifacts.targets index 7008b7b87c2f6..3a2eb7c1ea3fa 100644 --- a/src/NuGet/Microsoft.Net.Compilers.Toolset/DesktopCompilerArtifacts.targets +++ b/src/NuGet/Microsoft.Net.Compilers.Toolset/DesktopCompilerArtifacts.targets @@ -24,7 +24,7 @@ VS training data to the assemblies they produce. --> - + @@ -34,9 +34,9 @@ - - - + + + diff --git a/src/NuGet/VS.Tools.Roslyn.Package/VS.Tools.Roslyn.Package.csproj b/src/NuGet/VS.Tools.Roslyn.Package/VS.Tools.Roslyn.Package.csproj index 5a7283350c3c1..01e1c7eb73eaf 100644 --- a/src/NuGet/VS.Tools.Roslyn.Package/VS.Tools.Roslyn.Package.csproj +++ b/src/NuGet/VS.Tools.Roslyn.Package/VS.Tools.Roslyn.Package.csproj @@ -51,7 +51,7 @@ AfterTargets="Build" Inputs="$(ArtifactsBinDir)csc\$(Configuration)\net472\csc.exe" Outputs="$(IntermediateOutputPath)csc.exe" - Condition="'$(DotNetBuildFromSource)' != 'true'"> + Condition="'$(DotNetBuildSourceOnly)' != 'true'"> diff --git a/src/Setup/DevDivVsix/CompilersPackage/CompilersPackage.targets b/src/Setup/DevDivVsix/CompilersPackage/CompilersPackage.targets index bec9c7c8e1d33..b398c100c0065 100644 --- a/src/Setup/DevDivVsix/CompilersPackage/CompilersPackage.targets +++ b/src/Setup/DevDivVsix/CompilersPackage/CompilersPackage.targets @@ -47,7 +47,7 @@ BeforeTargets="SwixBuild" DependsOnTargets="_SetSwrFilePath;InitializeDesktopCompilerArtifacts;_PrepareDesktopCompilerArtifactsForOptimization;ApplyOptimizations" Outputs="$(_SwrFilePath)" - Condition="'$(DotNetBuildFromSource)' != 'true'"> + Condition="'$(DotNetBuildSourceOnly)' != 'true'"> <_File Include="@(DesktopCompilerArtifact)"> diff --git a/src/Setup/Installer/Installer.Package.csproj b/src/Setup/Installer/Installer.Package.csproj index 52641789c8dee..4cd2da2a01854 100644 --- a/src/Setup/Installer/Installer.Package.csproj +++ b/src/Setup/Installer/Installer.Package.csproj @@ -24,7 +24,7 @@ DependsOnTargets="_CalculateInputsOutputs;ResolveProjectReferences" Inputs="$(MSBuildAllProjects);$(_DeploymentVsixPath)" Outputs="$(_InstallerFilePath)" - Condition="'$(DotNetBuildFromSource)' != 'true' and '$(MSBuildRuntimeType)' != 'Core'"> + Condition="'$(DotNetBuildSourceOnly)' != 'true' and '$(MSBuildRuntimeType)' != 'Core'"> <_Files Include="$(MSBuildProjectDirectory)\tools\*.*" TargetDir="tools"/> <_Files Include="$(MSBuildProjectDirectory)\scripts\*.*" TargetDir=""/> diff --git a/src/Workspaces/Core/MSBuild.BuildHost/Microsoft.CodeAnalysis.Workspaces.MSBuild.BuildHost.csproj b/src/Workspaces/Core/MSBuild.BuildHost/Microsoft.CodeAnalysis.Workspaces.MSBuild.BuildHost.csproj index c4b8b1699e9be..5f057a9af8da1 100644 --- a/src/Workspaces/Core/MSBuild.BuildHost/Microsoft.CodeAnalysis.Workspaces.MSBuild.BuildHost.csproj +++ b/src/Workspaces/Core/MSBuild.BuildHost/Microsoft.CodeAnalysis.Workspaces.MSBuild.BuildHost.csproj @@ -30,7 +30,7 @@ - + diff --git a/src/Workspaces/Core/MSBuild/Microsoft.CodeAnalysis.Workspaces.MSBuild.csproj b/src/Workspaces/Core/MSBuild/Microsoft.CodeAnalysis.Workspaces.MSBuild.csproj index 6d806fdba2eb8..ce6eb532a8a5a 100644 --- a/src/Workspaces/Core/MSBuild/Microsoft.CodeAnalysis.Workspaces.MSBuild.csproj +++ b/src/Workspaces/Core/MSBuild/Microsoft.CodeAnalysis.Workspaces.MSBuild.csproj @@ -87,7 +87,7 @@ --> - + <_NetFrameworkBuildHostProjectReference Include="..\..\..\Workspaces\Core\MSBuild.BuildHost\Microsoft.CodeAnalysis.Workspaces.MSBuild.BuildHost.csproj"> net472 BuildHost-net472 diff --git a/src/Workspaces/Core/Portable/Microsoft.CodeAnalysis.Workspaces.csproj b/src/Workspaces/Core/Portable/Microsoft.CodeAnalysis.Workspaces.csproj index 4fcbf691d4469..31f3ea1946bc8 100644 --- a/src/Workspaces/Core/Portable/Microsoft.CodeAnalysis.Workspaces.csproj +++ b/src/Workspaces/Core/Portable/Microsoft.CodeAnalysis.Workspaces.csproj @@ -23,7 +23,7 @@ - + true From 47c6bf848c06b35207c59ab50360261be2114497 Mon Sep 17 00:00:00 2001 From: "Matt Mitchell (.NET)" Date: Thu, 12 Sep 2024 14:20:12 -0700 Subject: [PATCH 5/6] Restore use static graph off when building source-only --- eng/SourceBuild.props | 1 + eng/targets/Settings.props | 1 - 2 files changed, 1 insertion(+), 1 deletion(-) diff --git a/eng/SourceBuild.props b/eng/SourceBuild.props index bdc21afbd2dc1..9004a80e28bbf 100644 --- a/eng/SourceBuild.props +++ b/eng/SourceBuild.props @@ -27,6 +27,7 @@ $(InnerBuildArgs) /p:Projects="$(InnerSourceBuildRepoRoot)Roslyn.sln" + $(InnerBuildArgs) /p:RestoreUseStaticGraphEvaluation=false diff --git a/eng/targets/Settings.props b/eng/targets/Settings.props index bdc1ec175dd5a..faafdb4653aa3 100644 --- a/eng/targets/Settings.props +++ b/eng/targets/Settings.props @@ -20,7 +20,6 @@ Microsoft\VBCSharp\LanguageServices true - false true From bc107ab5981c54dfab2e2f97590d47cba2e24d94 Mon Sep 17 00:00:00 2001 From: "Matt Mitchell (.NET)" Date: Thu, 12 Sep 2024 14:46:07 -0700 Subject: [PATCH 6/6] Tweak --- eng/build.sh | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/eng/build.sh b/eng/build.sh index cf3111b2d76a5..b2efac658cdd2 100755 --- a/eng/build.sh +++ b/eng/build.sh @@ -281,8 +281,8 @@ function BuildSolution { local source_build_args="" if [[ "$source_build" == true ]]; then - source_build_args="/p:DotNetBuildSourceOnly=$source_build \ - /p:DotNetBuildRepo=$source_build" + source_build_args="/p:DotNetBuildSourceOnly=true \ + /p:DotNetBuildRepo=true" fi # Setting /p:TreatWarningsAsErrors=true is a workaround for https://github.com/Microsoft/msbuild/issues/3062.