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

Generate the sdk msi bundles inside the VMR on windows BuildPass=2 verticals #47397

Merged
Merged
Show file tree
Hide file tree
Changes from all 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
15 changes: 8 additions & 7 deletions eng/Build.props
Original file line number Diff line number Diff line change
@@ -1,12 +1,6 @@
<Project>

<!-- VMR bootstrap -->
<ItemGroup Condition="'$(InitializeVMR)' == 'true'">
<ProjectToBuild Include="$(RepoRoot)src/VirtualMonoRepo/Tasks/VirtualMonoRepo.Tasks.csproj" BuildInParallel="false" />
<ProjectToBuild Include="$(RepoRoot)src/VirtualMonoRepo/InitializeVMR.proj" BuildInParallel="false" />
</ItemGroup>

<!-- For product build, build MSBuildExtensions and VSTemplateLocator only in the second build pass on win-x64 as
<!-- For product build, build MSBuildExtensions and VSTemplateLocator in the second build pass on win-x64 as
they depend on assets from other verticals that are built in the first build pass. -->
<ItemGroup Condition="'$(DotNetBuildPass)' == '2' and
'$(OS)' == 'Windows_NT' and
Expand All @@ -15,4 +9,11 @@
<ProjectToBuild Include="$(RepoRoot)src\VSTemplateLocator\VSTemplateLocator.proj" DotNetBuildPass="2" />
</ItemGroup>

<!-- For product build, build the sdk bundle in the second build pass on windows as
it depends on assets from other verticals that are built in the first build pass. -->
<ItemGroup Condition="'$(DotNetBuildPass)' == '2' and
'$(OS)' == 'Windows_NT'">
<ProjectToBuild Include="$(RepoRoot)src\Installer\redist-installer\redist-installer.proj" DotNetBuildPass="2" />
</ItemGroup>

</Project>
16 changes: 10 additions & 6 deletions eng/Signing.props
Original file line number Diff line number Diff line change
@@ -1,8 +1,7 @@
<Project>

<PropertyGroup>
<!-- The FullNugetVersion.version file only gets produced in the initial build pass. -->
<RelativeBlobPathParent Condition="'$(DotNetBuildPass)' == '' or '$(DotNetBuildPass)' == '1'">Sdk/$([System.IO.File]::ReadAllText('$(ArtifactsTmpDir)FullNugetVersion.version').Trim())</RelativeBlobPathParent>
<RelativeBlobPathParent>Sdk/$([System.IO.File]::ReadAllText('$(ArtifactsTmpDir)FullNugetVersion.version').Trim())</RelativeBlobPathParent>
<PublishBinariesAndBadge Condition="'$(PublishBinariesAndBadge)' == ''">true</PublishBinariesAndBadge>
</PropertyGroup>

Expand Down Expand Up @@ -89,7 +88,13 @@
PublishFlatContainer="false" />
</ItemGroup>

<ItemGroup Condition="'$(DotNetBuildPass)' == '' or '$(DotNetBuildPass)' == '1'">
<!-- Only publish this file from win-x64 so that we don't end up with duplicates. -->
<ItemGroup Condition="'$(PublishBinariesAndBadge)' == 'true' and '$(OS)' == 'Windows_NT' and '$(Architecture)' == 'x64' and '$(PgoInstrument)' != 'true' and ('$(DotNetBuildPass)' == '' or '$(DotNetBuildPass)' == '1')">
<SdkArtifact Include="$(ArtifactsShippingPackagesDir)productVersion.txt" IsShipping="true" />
<SdkArtifact Include="$(ArtifactsShippingPackagesDir)sdk-productVersion.txt" IsShipping="true" />
</ItemGroup>

<ItemGroup>
<SdkArtifact Include="$(ArtifactsShippingPackagesDir)*.zip" IsShipping="true" Condition="'$(PublishBinariesAndBadge)' == 'true'" />
<SdkArtifact Include="$(ArtifactsShippingPackagesDir)*.tar.gz" IsShipping="true" Condition="'$(PublishBinariesAndBadge)' == 'true'" />
<SdkArtifact Include="$(ArtifactsShippingPackagesDir)*.pkg" IsShipping="true" />
Expand All @@ -99,9 +104,6 @@
<SdkArtifact Include="$(ArtifactsShippingPackagesDir)*.msi" IsShipping="true" />
<SdkArtifact Include="$(ArtifactsShippingPackagesDir)*.cab" IsShipping="true" />
<SdkArtifact Include="$(ArtifactsShippingPackagesDir)*.svg" IsShipping="true" Condition="'$(PublishBinariesAndBadge)' == 'true'" />
<!-- Only publish this file from windows x64 so that we don't end up with duplicates -->
<SdkArtifact Include="$(ArtifactsShippingPackagesDir)productVersion.txt" IsShipping="true" Condition="'$(PublishBinariesAndBadge)' == 'true' and '$(OS)' == 'Windows_NT' and '$(Architecture)' == 'x64' and '$(PgoInstrument)' != 'true'" />
<SdkArtifact Include="$(ArtifactsShippingPackagesDir)sdk-productVersion.txt" IsShipping="true" Condition="'$(PublishBinariesAndBadge)' == 'true' and '$(OS)' == 'Windows_NT' and '$(Architecture)' == 'x64' and '$(PgoInstrument)' != 'true'" />
<SdkArtifact Include="$(ArtifactsShippingPackagesDir)productCommit-*.json" IsShipping="true" Condition="'$(PublishBinariesAndBadge)' == 'true'" />
<SdkArtifact Include="$(ArtifactsShippingPackagesDir)productCommit-*.txt" IsShipping="true" Condition="'$(PublishBinariesAndBadge)' == 'true'" />

Expand All @@ -110,7 +112,9 @@
<SdkArtifact Include="$(ArtifactsNonShippingPackagesDir)*.tar.gz" IsShipping="false" Condition="'$(PublishBinariesAndBadge)' == 'true'" />
<SdkArtifact Include="$(ArtifactsNonShippingPackagesDir)*.zip" IsShipping="false" Condition="'$(PublishBinariesAndBadge)' == 'true'" />
<SdkArtifact Include="$(ArtifactsNonShippingPackagesDir)*.pkg" IsShipping="false" />
</ItemGroup>

<ItemGroup>
<Artifact Include="@(SdkArtifact)"
RelativeBlobPath="$(RelativeBlobPathParent)/%(Filename)%(Extension)">
<ChecksumPath Condition="$([System.String]::Copy('%(Filename)%(Extension)').EndsWith('.wixpack.zip')) != 'true'">%(FullPath).sha512</ChecksumPath>
Expand Down
18 changes: 18 additions & 0 deletions eng/pipelines/templates/stages/vmr-build.yml
Original file line number Diff line number Diff line change
Expand Up @@ -892,12 +892,30 @@ stages:
targetArchitecture: x86
buildPass: 2
reuseBuildArtifactsFrom:
- Windows_x64
- Windows_x86
- Windows_arm64
- AzureLinux_x64_Cross_x64
- AzureLinux_x64_Cross_Alpine_x64
- AzureLinux_x64_Cross_arm64
- AzureLinux_x64_Cross_Alpine_arm64
- AzureLinux_x64_Cross_arm
- AzureLinux_x64_Cross_Alpine_arm

- template: ../jobs/vmr-build.yml
parameters:
buildName: Windows
isBuiltFromVmr: ${{ parameters.isBuiltFromVmr }}
vmrBranch: ${{ variables.VmrBranch }}
sign: ${{ variables.signEnabled }}
pool: ${{ parameters.pool_Windows }}
targetOS: windows
targetArchitecture: arm64
buildPass: 2
reuseBuildArtifactsFrom:
- Windows_x64
- Windows_x86
- Windows_arm64

### FINAL JOIN ###
- ${{ if and(parameters.isBuiltFromVmr, not(parameters.isSourceOnlyBuild), eq(variables['System.TeamProject'], 'internal'), ne(variables['Build.Reason'], 'PullRequest')) }}:
Expand Down
28 changes: 19 additions & 9 deletions src/Installer/redist-installer/Directory.Build.targets
Original file line number Diff line number Diff line change
Expand Up @@ -29,18 +29,28 @@
<ArtifactNameWithVersionCombinedHostHostFxrFrameworkSdk>dotnet-sdk$(PgoTerm)-$(Version)-$(ProductMonikerRid)</ArtifactNameWithVersionCombinedHostHostFxrFrameworkSdk>
</PropertyGroup>

<!-- This is a hack to make the full nuget version available during the publishing step -->
<Target Name="GenerateFullNugetVersionFile"
BeforeTargets="Build">
<WriteLinesToFile File="$(ArtifactsTmpDir)FullNugetVersion.version"
Lines="$(FullNugetVersion)"
Overwrite="true" />
</Target>

<Import Project="$(RepoRoot)src\Tasks\sdk-tasks\sdk-tasks.InTree.targets" />

<!-- Layout -->
<Import Project="targets\BundledTemplates.targets" />
<Import Project="targets\RestoreLayout.targets" />
<Import Project="targets\BundledManifests.targets" />
<Import Project="targets\BundledDotnetTools.targets" />
<Import Project="targets\GenerateBundledVersions.targets" />
<Import Project="targets\Crossgen.targets" />
<Import Project="targets\GenerateLayout.targets" />
<Import Project="targets\GenerateRuntimeAnalyzers.targets" />
<Import Project="targets\Badge.targets" Condition="'$(PgoInstrument)' != 'true'" />
<Import Project="targets\GenerateArchives.targets" />

<ImportGroup Condition="'$(GenerateSdkBundleOnly)' != 'true'">
<Import Project="targets\BundledTemplates.targets" />
<Import Project="targets\BundledDotnetTools.targets" />
<Import Project="targets\GenerateBundledVersions.targets" />
<Import Project="targets\Crossgen.targets" />
<Import Project="targets\GenerateLayout.targets" />
<Import Project="targets\Badge.targets" Condition="'$(PgoInstrument)' != 'true'" />
<Import Project="targets\GenerateArchives.targets" />
</ImportGroup>

<!-- Installers -->
<Import Project="targets\GenerateMSIs.targets" Condition="'$(OS)' == 'Windows_NT' and '$(SkipBuildingInstallers)' != 'true'" />
Expand Down
9 changes: 7 additions & 2 deletions src/Installer/redist-installer/redist-installer.proj
Original file line number Diff line number Diff line change
Expand Up @@ -4,13 +4,18 @@
<TargetFramework>$(SdkTargetFramework)</TargetFramework>
<AppendTargetFrameworkToOutputPath>false</AppendTargetFrameworkToOutputPath>
<IsShippingPackage>true</IsShippingPackage>
<GenerateSdkBundleOnly Condition="'$(DotNetBuildPass)' == '2' and '$(OS)' == 'Windows_NT'">true</GenerateSdkBundleOnly>
</PropertyGroup>

<ItemGroup>
<ProjectReference Include="..\..\Layout\redist\redist.csproj" />
<ItemGroup Condition="'$(GenerateSdkBundleOnly)' != 'true'">
<ProjectReference Include="$(RepoRoot)src\Layout\redist\redist.csproj" />
<ProjectReference Include="$(RepoRoot)template_feed\*\*.csproj" />
</ItemGroup>

<ItemGroup Condition="'$(OS)' == 'Windows_NT'">
<ProjectReference Include="$(RepoRoot)src\Installer\finalizer\finalizer-build.csproj" />
</ItemGroup>

<ItemGroup>
<PackageReference Include="Microsoft.DotNet.Build.Tasks.Installers" />
</ItemGroup>
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -52,7 +52,8 @@
</ItemGroup>

<Target Name="ValidateBundledManifestSigning"
Condition=" '$(OS)' == 'Windows_NT' and '$(Architecture)' != 'arm' ">
Condition="'$(OS)' == 'Windows_NT' and '$(Architecture)' != 'arm'"
BeforeTargets="GenerateWorkloadManifestsWxs">
<PropertyGroup>
<SignCheckExe>$(PkgMicrosoft_DotNet_SignCheck)\tools\Microsoft.DotNet.SignCheck.exe</SignCheckExe>
<SignCheckLog Condition="'$(SignCheckLog)' == ''">$(ArtifactsLogDir)\workloadmanifestsigncheck.log</SignCheckLog>
Expand Down
Loading
Loading