Skip to content

Add workloads subset for blazor installers #55087

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

Closed
wants to merge 17 commits into from
Closed
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
1 change: 1 addition & 0 deletions Directory.Build.props
Original file line number Diff line number Diff line change
Expand Up @@ -57,6 +57,7 @@
<CoreClrProjectRoot>$([MSBuild]::NormalizeDirectory('$(MSBuildThisFileDirectory)', 'src', 'coreclr'))</CoreClrProjectRoot>
<MonoProjectRoot>$([MSBuild]::NormalizeDirectory('$(MSBuildThisFileDirectory)', 'src', 'mono'))</MonoProjectRoot>
<InstallerProjectRoot>$([MSBuild]::NormalizeDirectory('$(MSBuildThisFileDirectory)', 'src', 'installer'))</InstallerProjectRoot>
<WorkloadsProjectRoot>$([MSBuild]::NormalizeDirectory('$(MSBuildThisFileDirectory)', 'src', 'workloads'))</WorkloadsProjectRoot>
<SharedNativeRoot>$([MSBuild]::NormalizeDirectory('$(RepoRoot)', 'src', 'native'))</SharedNativeRoot>
<RepoToolsLocalDir>$([MSBuild]::NormalizeDirectory('$(MSBuildThisFileDirectory)', 'tools-local'))</RepoToolsLocalDir>
<RepoTasksDir>$([MSBuild]::NormalizeDirectory('$(MSBuildThisFileDirectory)', 'src', 'tasks'))</RepoTasksDir>
Expand Down
11 changes: 8 additions & 3 deletions eng/Subsets.props
Original file line number Diff line number Diff line change
Expand Up @@ -109,7 +109,8 @@
<SubsetName Include="Mono.Packages" Description="The projects that produce NuGet packages for the Mono runtime." />
<SubsetName Include="Mono.WasmRuntime" Description="The WebAssembly runtime." />
<SubsetName Include="Mono.MsCorDbi" Description="The implementation of ICorDebug interface." />

<SubsetName Include="Mono.Workloads" OnDemand="true" Description="Builds the installers and the insertion metadata for Blazor workloads." />

<!-- Libs -->
<SubsetName Include="Libs" Description="The libraries native part, refs and source assemblies, test infra and packages, but NOT the tests (use Libs.Tests to request those explicitly)" />
<SubsetName Include="Libs.Native" Description="The native libraries used in the shared framework." />
Expand All @@ -118,14 +119,14 @@
<SubsetName Include="Libs.PreTest" Description="Test assets which are necessary to run tests." />
<SubsetName Include="Libs.Packages" Description="The projects that produce NuGet packages from libraries." />
<SubsetName Include="Libs.Tests" OnDemand="true" Description="The test projects. Note that building this doesn't execute tests: you must also pass the '-test' argument." />

<!-- Host -->
<SubsetName Include="Host" Description="The .NET hosts, packages, hosting libraries, and tests." />
<SubsetName Include="Host.Native" Description="The .NET hosts." />
<SubsetName Include="Host.Pkg" Description="The .NET host packages." />
<SubsetName Include="Host.Tools" Description="The .NET hosting libraries." />
<SubsetName Include="Host.Tests" Description="The .NET hosting tests." />

<!-- Packs -->
<SubsetName Include="Packs" Description="Builds the shared framework packs, archives, bundles, installers, and the framework pack tests." />
<SubsetName Include="Packs.Product" Description="Builds the shared framework packs, archives, bundles, and installers." />
Expand Down Expand Up @@ -247,6 +248,10 @@
<ItemGroup Condition="$(_subset.Contains('+mono.corelib+'))">
<ProjectToBuild Include="$(MonoProjectRoot)System.Private.CoreLib\System.Private.CoreLib.csproj" Category="mono" />
</ItemGroup>

<ItemGroup Condition="$(_subset.Contains('+mono.workloads+'))">
<ProjectToBuild Include="$(WorkloadsProjectRoot)\workloads.csproj" Category="mono" />
</ItemGroup>

<!-- Libraries sets -->
<ItemGroup Condition="$(_subset.Contains('+libs.native+'))">
Expand Down
8 changes: 7 additions & 1 deletion eng/Versions.props
Original file line number Diff line number Diff line change
Expand Up @@ -58,8 +58,10 @@
<MicrosoftDotNetXUnitExtensionsVersion>6.0.0-beta.21330.2</MicrosoftDotNetXUnitExtensionsVersion>
<MicrosoftDotNetXUnitConsoleRunnerVersion>2.5.1-beta.21330.2</MicrosoftDotNetXUnitConsoleRunnerVersion>
<MicrosoftDotNetBuildTasksArchivesVersion>6.0.0-beta.21330.2</MicrosoftDotNetBuildTasksArchivesVersion>
<MicrosoftDotNetBuildTasksPackagingVersion>6.0.0-beta.21330.2</MicrosoftDotNetBuildTasksPackagingVersion>
<MicrosoftDotNetBuildTasksInstallersPackageVersion>6.0.0-beta.21330.2</MicrosoftDotNetBuildTasksInstallersPackageVersion>
<MicrosoftDotNetBuildTasksInstallersVersion>6.0.0-beta.21330.2</MicrosoftDotNetBuildTasksInstallersVersion>
<MicrosoftDotNetBuildTasksPackagingVersion>6.0.0-beta.21330.2</MicrosoftDotNetBuildTasksPackagingVersion>
<MicrosoftDotNetBuildTasksWorkloadsPackageVersion>6.0.0-beta.21330.2</MicrosoftDotNetBuildTasksWorkloadsPackageVersion>
<MicrosoftDotNetRemoteExecutorVersion>6.0.0-beta.21330.2</MicrosoftDotNetRemoteExecutorVersion>
<MicrosoftDotNetVersionToolsTasksVersion>6.0.0-beta.21330.2</MicrosoftDotNetVersionToolsTasksVersion>
<MicrosoftDotNetPackageTestingVersion>6.0.0-beta.21330.2</MicrosoftDotNetPackageTestingVersion>
Expand Down Expand Up @@ -180,5 +182,9 @@
<!-- emscripten / Node -->
<MicrosoftNETRuntimeEmscripten2023Nodewinx64Version>6.0.0-preview.7.21330.1</MicrosoftNETRuntimeEmscripten2023Nodewinx64Version>
<MicrosoftNETRuntimeEmscriptenVersion>$(MicrosoftNETRuntimeEmscripten2023Nodewinx64Version)</MicrosoftNETRuntimeEmscriptenVersion>
<!-- workloads -->
<SwixPackageVersion>1.1.87-gba258badda</SwixPackageVersion>
<WixPackageVersion>3.14.0-dotnet</WixPackageVersion>
<MonoWorkloadManifestVersion>6.0.0-preview.5.21275.7</MonoWorkloadManifestVersion>
</PropertyGroup>
</Project>
87 changes: 87 additions & 0 deletions eng/pipelines/mono/templates/workloads-build.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,87 @@
parameters:
archType: ''
buildConfig: ''
container: ''
dependOnEvaluatePaths: false
dependsOn: []
isOfficialBuild: false
osGroup: ''
osSubgroup: ''
platform: ''
pool: ''
runtimeVariant: ''
stagedBuild: false
testGroup: ''
timeoutInMinutes: ''
variables: {}

jobs:
- template: xplat-pipeline-job.yml
parameters:
archType: ${{ parameters.archType }}
buildConfig: ${{ parameters.buildConfig }}
container: ${{ parameters.container }}
condition: ${{ parameters.isOfficialBuild }}
helixType: 'build/product/'
osGroup: ${{ parameters.osGroup }}
osSubgroup: ${{ parameters.osSubgroup }}
pool: ${{ parameters.pool }}
runtimeVariant: ${{ parameters.runtimeVariant }}
stagedBuild: ${{ parameters.stagedBuild }}
timeoutInMinutes: ${{ parameters.timeoutInMinutes }}
dependOnEvaluatePaths: ${{ parameters.dependOnEvaluatePaths }}

dependsOn: ${{ parameters.dependsOn }}

name: workloadsbuild
displayName: Build Workloads

variables:
- name: officialBuildIdArg
value: ''
- ${{ if and(eq(variables['System.TeamProject'], 'internal'), ne(variables['Build.Reason'], 'PullRequest')) }}:
- name: officialBuildIdArg
value: '/p:OfficialBuildId=$(Build.BuildNumber)'
- name: SignType
value: $[ coalesce(variables.OfficialSignType, 'real') ]
- ${{ parameters.variables }}

steps:
- task: DownloadPipelineArtifact@2
inputs:
artifact: 'IntermediateArtifacts'
path: $(workloadPackagesPath)
patterns: 'IntermediateArtifacts/*/Shipping/*.nupkg'

- task: CopyFiles@2
displayName: Flatten packages
inputs:
sourceFolder: $(workloadPackagesPath)
contents: '*/Shipping/*.nupkg'
cleanTargetFolder: false
targetFolder: $(workloadPackagesPath)
flattenFolders: true

- script: $(Build.SourcesDirectory)$(dir)build$(scriptExt) -subset mono.workloads -arch $(archType) -c $(buildConfig) $(officialBuildIdArg) -ci
displayName: Build workload artifacts

# Upload packages wrapping msis
- template: /eng/pipelines/common/upload-intermediate-artifacts-step.yml
parameters:
name: workloads

# Delete wixpdb files before they are uploaded to artifacts
- task: DeleteFiles@1
displayName: Delete wixpdb's
inputs:
SourceFolder: $(workloadArtifactsPath)
Contents: '*.wixpdb'

# Upload artifacts to be used for generating VS components
- task: PublishPipelineArtifact@1
displayName: Publish workload artifacts
inputs:
targetPath: $(workloadArtifactsPath)
artifactName: 'Workloads'
continueOnError: true
condition: always()
6 changes: 6 additions & 0 deletions eng/pipelines/mono/templates/xplat-pipeline-job.yml
Original file line number Diff line number Diff line change
Expand Up @@ -90,6 +90,12 @@ jobs:
- name: nativeTestArtifactRootFolderPath
value: '$(binTestsPath)/obj/$(osGroup).$(archType).$(buildConfigUpper)'

- name: workloadPackagesPath
value: $(Build.SourcesDirectory)/artifacts/workloadPackages

- name: workloadArtifactsPath
value: $(Build.SourcesDirectory)/artifacts/workloads

- name: liveRuntimeBuildConfigUpper
${{ if eq(parameters.liveRuntimeBuildConfig, 'release') }}:
value: 'Release'
Expand Down
36 changes: 36 additions & 0 deletions eng/pipelines/runtime-official.yml
Original file line number Diff line number Diff line change
Expand Up @@ -371,6 +371,42 @@ stages:
- windows_x86
- Linux_x64

#
# Build Blazor Workload
#
- template: /eng/pipelines/common/platform-matrix.yml
parameters:
jobTemplate: /eng/pipelines/mono/templates/workloads-build.yml
buildConfig: release
platforms:
- windows_x64
jobParameters:
isOfficialBuild: ${{ variables.isOfficialBuild }}
dependsOn:
- Build_Android_x64_release_AllSubsets_Mono
- Build_Android_x86_release_AllSubsets_Mono
- Build_Android_arm_release_AllSubsets_Mono
- Build_Android_arm64_release_AllSubsets_Mono
- Build_MacCatalyst_x64_release_AllSubsets_Mono
- Build_MacCatalyst_arm64_release_AllSubsets_Mono
- Build_tvOSSimulator_x64_release_AllSubsets_Mono
- Build_tvOSSimulator_arm64_release_AllSubsets_Mono
- Build_tvOS_arm64_release_AllSubsets_Mono
- Build_iOSSimulator_x64_release_AllSubsets_Mono
- Build_iOSSimulator_x86_release_AllSubsets_Mono
- Build_iOSSimulator_arm64_release_AllSubsets_Mono
- Build_iOS_arm_release_AllSubsets_Mono
- Build_iOS_arm64_release_AllSubsets_Mono
- Build_OSX_x64_release_AllSubsets_Mono
- Build_OSX_arm64_release_AllSubsets_Mono
- Build_Linux_x64_release_AllSubsets_Mono
- Build_Linux_arm_release_AllSubsets_Mono
- Build_Linux_arm64_release_AllSubsets_Mono
- Build_Linux_musl_x64_release_AllSubsets_Mono
- Build_Browser_wasm_release_AllSubsets_Mono
- Build_windows_x64_release_AllSubsets_Mono
- Build_windows_x86_release_AllSubsets_Mono

- ${{ if eq(variables.isOfficialBuild, true) }}:
- template: /eng/pipelines/official/stages/publish.yml
parameters:
Expand Down
7 changes: 7 additions & 0 deletions src/workloads/NuGet.config
Original file line number Diff line number Diff line change
@@ -0,0 +1,7 @@
<?xml version="1.0" encoding="utf-8"?>
<configuration>
<packageSources>
<add key="local-packages" value="resources" />
</packageSources>
<disabledPackageSources />
</configuration>
68 changes: 68 additions & 0 deletions src/workloads/OptionalWorkloads.vsmanproj
Original file line number Diff line number Diff line change
@@ -0,0 +1,68 @@
<?xml version="1.0" encoding="utf-8"?>
<Project xmlns="http://schemas.microsoft.com/developer/msbuild/2003">
<Import Project="VSSetup.targets" />

<PropertyGroup>
<DebugSymbols>false</DebugSymbols>
<IsShippingAssembly>false</IsShippingAssembly>
<PublishWindowsPdb>false</PublishWindowsPdb>
<TargetType>build-manifest</TargetType>
<FinalizeManifest>true</FinalizeManifest>
<FinalizeSkipLayout>false</FinalizeSkipLayout>
<ProductName>DotNetOptionalWorkloads</ProductName>
<ProductFamily>vs</ProductFamily>
<ProductFamilyVersion Condition="$(ProductFamilyVersion) == ''">42.42.42</ProductFamilyVersion>
<ComputeRelativeUrls>true</ComputeRelativeUrls>
<OutputPath>$(ManifestOutputPath)</OutputPath>
</PropertyGroup>

<ItemGroup>
<MergeManifest Include="$(ManifestOutputPath)\*.json">
<RelativeUrl>/</RelativeUrl>
</MergeManifest>
<MergeManifest Include="$(ManifestOutputPath)\CHS\*.json">
<RelativeUrl>/CHS/</RelativeUrl>
</MergeManifest>
<MergeManifest Include="$(ManifestOutputPath)\CHT\*.json">
<RelativeUrl>/CHT/</RelativeUrl>
</MergeManifest>
<MergeManifest Include="$(ManifestOutputPath)\CSY\*.json">
<RelativeUrl>/CSY/</RelativeUrl>
</MergeManifest>
<MergeManifest Include="$(ManifestOutputPath)\DEU\*.json">
<RelativeUrl>/DEU/</RelativeUrl>
</MergeManifest>
<MergeManifest Include="$(ManifestOutputPath)\ENU\*.json">
<RelativeUrl>/ENU/</RelativeUrl>
</MergeManifest>
<MergeManifest Include="$(ManifestOutputPath)\ESN\*.json">
<RelativeUrl>/ESN/</RelativeUrl>
</MergeManifest>
<MergeManifest Include="$(ManifestOutputPath)\FRA\*.json">
<RelativeUrl>/FRA/</RelativeUrl>
</MergeManifest>
<MergeManifest Include="$(ManifestOutputPath)\ITA\*.json">
<RelativeUrl>/ITA/</RelativeUrl>
</MergeManifest>
<MergeManifest Include="$(ManifestOutputPath)\JPN\*.json">
<RelativeUrl>/JPN/</RelativeUrl>
</MergeManifest>
<MergeManifest Include="$(ManifestOutputPath)\KOR\*.json">
<RelativeUrl>/KOR/</RelativeUrl>
</MergeManifest>
<MergeManifest Include="$(ManifestOutputPath)\PLK\*.json">
<RelativeUrl>/PLK/</RelativeUrl>
</MergeManifest>
<MergeManifest Include="$(ManifestOutputPath)\PTB\*.json">
<RelativeUrl>/PTB/</RelativeUrl>
</MergeManifest>
<MergeManifest Include="$(ManifestOutputPath)\RUS\*.json">
<RelativeUrl>/RUS/</RelativeUrl>
</MergeManifest>
<MergeManifest Include="$(ManifestOutputPath)\TRK\*.json">
<RelativeUrl>/TRK/</RelativeUrl>
</MergeManifest>
</ItemGroup>

<Import Project="$(SwixBuildTargets)"/>
</Project>
42 changes: 42 additions & 0 deletions src/workloads/VSSetup.props
Original file line number Diff line number Diff line change
@@ -0,0 +1,42 @@
<?xml version="1.0" encoding="utf-8"?>
<Project ToolsVersion="4.0" DefaultTargets="Build" xmlns="http://schemas.microsoft.com/developer/msbuild/2003">
<PropertyGroup>
<VSSetupProps>1</VSSetupProps>
</PropertyGroup>

<PropertyGroup>
<VSDropServiceUri>https://vsdrop.corp.microsoft.com/file/v1/</VSDropServiceUri>
<DropServiceUri>https://devdiv.artifacts.visualstudio.com/</DropServiceUri>
<DropExe>$(MSBuildThisDirectory)Tools\Drop.App\lib\net45\Drop.exe</DropExe>
<!-- Default drop expiration date is 10 years from now -->
<DropExpiration Condition="'$(DropExpiration)' == ''">10</DropExpiration>
<DropExpirationDate>$([System.DateTime]::Now.AddYears($(DropExpiration)).ToString("M/d/yyyy h:m:s tt"))</DropExpirationDate>
<!-- Timeout in minutes -->
<DropTimeout>10</DropTimeout>
<!-- Can be set to 'info', 'warn', 'error', 'verbose' -->
<DropTraceLevel>verbose</DropTraceLevel>

<!-- Commandline parameters for drop.exe -->
<DropParamService>-s &quot;$(DropServiceUri)&quot;</DropParamService>
<DropParamTimeout>--timeout &quot;$(DropTimeout)&quot;</DropParamTimeout>
<DropParamTraceLevel>--tracelevel &quot;$(DropTraceLevel)&quot;</DropParamTraceLevel>
<DropParamExpirationDate>-x &quot;$(DropExpirationDate)&quot;</DropParamExpirationDate>
<!-- Use AAD for authentication -->
<DropParamAuth>-a</DropParamAuth>
</PropertyGroup>

<PropertyGroup>
<ManifestTeamProject Condition="'$(ManifestTeamProject)' == ''">dotnet</ManifestTeamProject>
<ManifestRepositoryName Condition="'$(ManifestRepositoryName)' == ''">installer</ManifestRepositoryName>
<ManifestBuildBranch Condition="'$(ManifestBuildBranch)' == ''">local_build</ManifestBuildBranch>
<ManifestBuildNumber Condition="'$(ManifestBuildNumber)' == ''">$([System.DateTime]::Now.ToString("yyMMdd")).1</ManifestBuildNumber>
</PropertyGroup>

<PropertyGroup>
<ManifestPublishUrl>https://vsdrop.corp.microsoft.com/file/v1/Products/$(ManifestTeamProject)/$(ManifestRepositoryName)/$(ManifestBuildBranch)/$(ManifestBuildNumber);</ManifestPublishUrl>
</PropertyGroup>

<PropertyGroup>
<ManifestIntermediateOutputPath>$(OutputPath)\obj\$(MSBuildProject)</ManifestIntermediateOutputPath>
</PropertyGroup>
</Project>
49 changes: 49 additions & 0 deletions src/workloads/VSSetup.targets
Original file line number Diff line number Diff line change
@@ -0,0 +1,49 @@
<?xml version="1.0" encoding="utf-8"?>
<Project ToolsVersion="4.0" DefaultTargets="Build" xmlns="http://schemas.microsoft.com/developer/msbuild/2003">
<Import Project="VSSetup.props" Condition="'$(VSSetupProps)' != '1'"/>

<Target Name="PublishToVSDrop" DependsOnTargets="GetDropCmdLine">
<Exec Command="$(DropUpgradeCmd)" />
<Exec Command="$(DropCreateCmd)" />
<Exec Command="$(DropPublishCmd)" />
<Exec Command="$(DropFinalizeCmd)" />
<Exec Command="$(DropUpdateCmd)" />

<ItemGroup>
<DropManifests Include="$(VSDropSource)\*.vsman" />
</ItemGroup>

<WriteLinesToFile File="$(VSDropTxt)" Overwrite="true" Lines="@(DropManifests->'$(ManifestPublishUrl)%(Filename)%(Extension)')" />
</Target>

<Target Name="GetDropCmdLine">
<!-- Properties that will depend on each build configuration. We can only build the commandlines onces these are defined -->
<Error Text="VSDropSource property undefined" Condition="'$(VSDropSource)' == ''" />

<PropertyGroup>
<DropName>Products/$(ManifestTeamProject)/$(ManifestRepositoryName)/$(ManifestBuildBranch)/$(ManifestBuildNumber)</DropName>

<DropParamName>-n &quot;$(DropName)&quot;</DropParamName>
<DropParamSource>-d &quot;$(VSDropSource)&quot;</DropParamSource>

<DropUpgradeCmd>$(DropExe) Upgrade $(DropParamService) $(DropParamAuth) $(DropParamTimeout) $(DropParamTraceLevel)</DropUpgradeCmd>
<DropCreateCmd>$(DropExe) Create $(DropParamService) $(DropParamAuth) $(DropParamTimeout) $(DropParamTraceLevel) $(DropParamExpirationDate) $(DropParamName)</DropCreateCmd>
<DropPublishCmd>$(DropExe) Publish $(DropParamService) $(DropParamAuth) $(DropParamTimeout) $(DropParamTraceLevel) $(DropParamName) $(DropParamSource)</DropPublishCmd>
<DropFinalizeCmd>$(DropExe) Finalize $(DropParamService) $(DropParamAuth) $(DropParamTimeout) $(DropParamTraceLevel) $(DropParamName)</DropFinalizeCmd>
<DropUpdateCmd>$(DropExe) Update $(DropParamService) $(DropParamAuth) $(DropParamTimeout) $(DropParamTraceLevel) $(DropParamName) --neverExpire</DropUpdateCmd>
</PropertyGroup>
</Target>

<Target Name="VSSetupDiagnostic" DependsOnTargets="GetDropCmdLine">
<ItemGroup>
<VSSetupProperties Include="Drop cmd: $(DropUpgradeCmd)" />
<VSSetupProperties Include="Drop cmd: $(DropCreateCmd)" />
<VSSetupProperties Include="Drop cmd: $(DropPublishCmd)" />
<VSSetupProperties Include="Drop cmd: $(DropFinalizeCmd)" />
<VSSetupProperties Include="Drop cmd: $(DropUpdateCmd)" />
<VSSetupProperties Include="DropName: $(DropName)" />
</ItemGroup>

<Message Text="%(VSSetupProperties.Identity)" />
</Target>
</Project>
2 changes: 2 additions & 0 deletions src/workloads/readme.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,2 @@
# Building
The workloads project can only be built using .NET Framework msbuild. To build locally, run ```build -project src\workloads\workloads.csproj -msbuildEngine vs```
Copy link
Member

Choose a reason for hiding this comment

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

Did you copy this from my dotnet/installer PR? That was true before we rebuilt SWIX to support dotnet build and not depend on msbuild.

We should remove this readme

1 change: 1 addition & 0 deletions src/workloads/resources/.gitignore
Original file line number Diff line number Diff line change
@@ -0,0 +1 @@
!*.nupkg
Binary file not shown.
Loading