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

In VMR builds only build the target RID and don't rebuild #10017

Merged
merged 7 commits into from
Mar 6, 2024
Merged
Show file tree
Hide file tree
Changes from 6 commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
2 changes: 2 additions & 0 deletions Razor.Slim.slnf
Original file line number Diff line number Diff line change
Expand Up @@ -26,6 +26,8 @@
"src\\Razor\\src\\Microsoft.VisualStudio.LanguageServer.ContainedLanguage\\Microsoft.VisualStudio.LanguageServer.ContainedLanguage.csproj",
"src\\Razor\\src\\Microsoft.VisualStudio.LanguageServices.Razor\\Microsoft.VisualStudio.LanguageServices.Razor.csproj",
"src\\Razor\\src\\Microsoft.VisualStudio.RazorExtension\\Microsoft.VisualStudio.RazorExtension.csproj",
"src\\Razor\\src\\Microsoft.AspNetCore.Razor.LanguageServer\\Microsoft.AspNetCore.Razor.LanguageServer.csproj",
"src\\Razor\\src\\rzls\\rzls.csproj",
"src\\Razor\\test\\Microsoft.AspNetCore.Razor.Test.Common.Tooling\\Microsoft.AspNetCore.Razor.Test.Common.Tooling.csproj",
"src\\Razor\\test\\Microsoft.AspNetCore.Razor.Test.MvcShim.ClassLib\\Microsoft.AspNetCore.Razor.Test.MvcShim.ClassLib.csproj",
"src\\Razor\\test\\Microsoft.AspNetCore.Razor.Test.MvcShim.Version1_X\\Microsoft.AspNetCore.Razor.Test.MvcShim.Version1_X.csproj",
Expand Down
4 changes: 2 additions & 2 deletions eng/AfterSolutionBuild.targets
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
<Project>

<Target Name="_PublishLanguageServerRids" AfterTargets="Pack" Condition="'$(DotNetBuildFromSource)' != 'true'">
<Target Name="_PublishLanguageServerRids" AfterTargets="Pack" Condition="'$(DotNetBuildFromSourceOnly)' != 'true' and '$(ArcadeBuildFromSourceOnly)' != 'true'">
jkoritzinsky marked this conversation as resolved.
Show resolved Hide resolved
<PropertyGroup>
<BuildAnalyzersSolutionPath>$(MSBuildThisFileDirectory)..\BuildAnalyzers.sln</BuildAnalyzersSolutionPath>
<LanguageServerProject>$(MSBuildThisFileDirectory)..\src\Razor\src\rzls\rzls.csproj</LanguageServerProject>
Expand All @@ -15,7 +15,7 @@
Targets="PublishAllRids" />
</Target>

<Target Name="_PublishDevKitTelemetryRids" AfterTargets="Pack" Condition="'$(DotNetBuildFromSource)' != 'true'">
<Target Name="_PublishDevKitTelemetryRids" AfterTargets="Pack" Condition="'$(DotNetBuildFromSourceOnly)' != 'true' and '$(ArcadeBuildFromSourceOnly)' != 'true'">
<PropertyGroup>
<DevKitTelemetryProject>$(MSBuildThisFileDirectory)..\src\Razor\src\Microsoft.VisualStudio.DevKit.Razor\Microsoft.VisualStudio.DevKit.Razor.csproj</DevKitTelemetryProject>
<RazorSolutionPath>$(MSBuildThisFileDirectory)..\Razor.sln</RazorSolutionPath>
Expand Down
4 changes: 4 additions & 0 deletions eng/SourceBuild.props
Original file line number Diff line number Diff line change
Expand Up @@ -18,4 +18,8 @@
<Delete Files="$(InnerSourceBuildRepoRoot).globalconfig" />
</Target>

<PropertyGroup>
<InnerBuildArgs>$(InnerBuildArgs) /p:TargetRid=$(TargetRid)</InnerBuildArgs>
</PropertyGroup>

</Project>
Original file line number Diff line number Diff line change
Expand Up @@ -12,6 +12,22 @@
<RemoveDevicePlatformSupport>true</RemoveDevicePlatformSupport>
</PropertyGroup>

<!--
In a vertical build, we'll only publish for the RID of the vertical.
In a non-vertical build, we'll publish for all RIDs of the OS we are building on (to reduce the number of CI jobs).
-->
<PropertyGroup Condition="'$(DotNetBuild)' != 'true'">
<RuntimeIdentifiers Condition="$([MSBuild]::IsOSPlatform('Windows'))">win-x64;win-x86;win-arm64</RuntimeIdentifiers>
<RuntimeIdentifiers Condition="$([MSBuild]::IsOSPlatform('Linux'))">linux-x64;linux-musl-x64;linux-arm64;linux-musl-arm64</RuntimeIdentifiers>
<RuntimeIdentifiers Condition="$([MSBuild]::IsOSPlatform('OSX'))">osx-x64;osx-arm64</RuntimeIdentifiers>
</PropertyGroup>

<PropertyGroup Condition="'$(DotNetBuild)' == 'true'">
<RuntimeIdentifiers>$(TargetRid)</RuntimeIdentifiers>
<RuntimeIdentifier>$(TargetRid)</RuntimeIdentifier>
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Why do we need to set both RuntimeIdentifiers (plural) and RuntimeIdentifier (singular)?

Copy link
Member Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

We use RuntimeIdentifiers below to create the "publish" job (for both VMR and non-VMR builds) and the SDK uses RuntimeIdentifier to determine which RID to create the apphost for (which we need for the correct apphost architecture in the VMR build).

<RidSpecificPublishNoBuildProperty>NoBuild=true;AppendRuntimeIdentifierToOutputPath=false</RidSpecificPublishNoBuildProperty>
</PropertyGroup>

<ItemGroup>
<Compile Include="..\Microsoft.VisualStudio.Editor.Razor\Telemetry\TelemetryReporter.cs" Link="Telemetry\TelemetryReporter.cs" />
</ItemGroup>
Expand Down Expand Up @@ -52,11 +68,11 @@

<!-- Transform RuntimeIdentifierForPublish items to project items to pass to MSBuild task -->
<ProjectToPublish Include="@(RuntimeIdentifierForPublish->'$(MSBuildProjectFullPath)')">
<AdditionalProperties>RuntimeIdentifier=%(RuntimeIdentifierForPublish.Identity);PublishDir=$(RidsPublishDir)%(RuntimeIdentifierForPublish.Identity)\;TargetFramework=$(PublishTargetFramework);SelfContained=false</AdditionalProperties>
<AdditionalProperties>_IsPublishing=true;$(RidSpecificPublishNoBuildProperty);RuntimeIdentifier=%(RuntimeIdentifierForPublish.Identity);PublishDir=$(RidsPublishDir)%(RuntimeIdentifierForPublish.Identity)\;TargetFramework=$(PublishTargetFramework);SelfContained=false</AdditionalProperties>
</ProjectToPublish>

<ProjectToPublish_PlatformAgnostic Include="$(MSBuildProjectFullPath)">
<AdditionalProperties>PublishDir=$(RidsPublishDir)\PlatformAgnostic\;UseAppHost=false;TargetFramework=$(PublishTargetFramework);SelfContained=false</AdditionalProperties>
<AdditionalProperties>_IsPublishing=true;NoBuild=true;PublishDir=$(RidsPublishDir)\PlatformAgnostic\;UseAppHost=false;TargetFramework=$(PublishTargetFramework);SelfContained=false</AdditionalProperties>
</ProjectToPublish_PlatformAgnostic>
</ItemGroup>

Expand Down
19 changes: 15 additions & 4 deletions src/Razor/src/rzls/rzls.csproj
Original file line number Diff line number Diff line change
Expand Up @@ -6,11 +6,22 @@
<OutputType>Exe</OutputType>
<Description>Razor is a markup syntax for adding server-side logic to web pages. This package contains a Razor language server.</Description>
<EnableApiCheck>false</EnableApiCheck>
</PropertyGroup>

<!--
In a vertical build, we'll only publish for the RID of the vertical.
In a non-vertical build, we'll publish for all RIDs of the OS we are building on (to reduce the number of CI jobs).
-->
<PropertyGroup Condition="'$(DotNetBuild)' != 'true'">
<RuntimeIdentifiers Condition="$([MSBuild]::IsOSPlatform('Windows'))">win-x64;win-x86;win-arm64</RuntimeIdentifiers>
<RuntimeIdentifiers Condition="$([MSBuild]::IsOSPlatform('Linux'))">linux-x64;linux-musl-x64;linux-arm64;linux-musl-arm64</RuntimeIdentifiers>
<RuntimeIdentifiers Condition="$([MSBuild]::IsOSPlatform('OSX'))">osx-x64;osx-arm64</RuntimeIdentifiers>
<IsShippingPackage>false</IsShippingPackage>
<RemoveDevicePlatformSupport>true</RemoveDevicePlatformSupport>
</PropertyGroup>

<PropertyGroup Condition="'$(DotNetBuild)' == 'true'">
<RuntimeIdentifiers>$(TargetRid)</RuntimeIdentifiers>
<RuntimeIdentifier>$(TargetRid)</RuntimeIdentifier>
<RidSpecificPublishNoBuildProperty>NoBuild=true;AppendRuntimeIdentifierToOutputPath=false</RidSpecificPublishNoBuildProperty>
</PropertyGroup>

<ItemGroup>
Expand Down Expand Up @@ -50,11 +61,11 @@

<!-- Transform RuntimeIdentifierForPublish items to project items to pass to MSBuild task -->
<ProjectToPublish Include="@(RuntimeIdentifierForPublish->'$(MSBuildProjectFullPath)')">
<AdditionalProperties>RuntimeIdentifier=%(RuntimeIdentifierForPublish.Identity);PublishDir=$(RidsPublishDir)%(RuntimeIdentifierForPublish.Identity)\;TargetFramework=$(PublishTargetFramework);SelfContained=false</AdditionalProperties>
<AdditionalProperties>_IsPublishing=true;$(RidSpecificPublishNoBuildProperty);RuntimeIdentifier=%(RuntimeIdentifierForPublish.Identity);PublishDir=$(RidsPublishDir)%(RuntimeIdentifierForPublish.Identity)\;TargetFramework=$(PublishTargetFramework);SelfContained=false</AdditionalProperties>
</ProjectToPublish>

<ProjectToPublish_PlatformAgnostic Include="$(MSBuildProjectFullPath)">
<AdditionalProperties>PublishDir=$(RidsPublishDir)\PlatformAgnostic\;UseAppHost=false;TargetFramework=$(PublishTargetFramework);SelfContained=false</AdditionalProperties>
<AdditionalProperties>_IsPublishing=true;NoBuild=true;PublishDir=$(RidsPublishDir)\PlatformAgnostic\;UseAppHost=false;TargetFramework=$(PublishTargetFramework);SelfContained=false</AdditionalProperties>
</ProjectToPublish_PlatformAgnostic>
</ItemGroup>

Expand Down
Loading