From 7c79ce28bc5f42214c49e2ebbf3d7768ca927fa2 Mon Sep 17 00:00:00 2001 From: Jacques Eloff Date: Mon, 24 May 2021 14:05:11 -0700 Subject: [PATCH] Create WASM installers for optional workloads (#10685) Co-authored-by: Rainer Sigwald --- .gitignore | 3 + .vsts-ci.yml | 26 ++- README.md | 2 + eng/SymbolPublishingExclusionsFile.txt | 1 + eng/Version.Details.xml | 8 +- eng/Versions.props | 6 +- eng/configure-toolset.ps1 | 6 + eng/version.csproj | 4 +- global.json | 10 +- src/workloads/OptionalWorkloads.vsmanproj | 68 ++++++++ src/workloads/VSSetup.props | 42 +++++ src/workloads/VSSetup.targets | 49 ++++++ src/workloads/readme.md | 2 + src/workloads/workloads.csproj | 192 ++++++++++++++++++++++ 14 files changed, 403 insertions(+), 16 deletions(-) create mode 100644 eng/SymbolPublishingExclusionsFile.txt create mode 100644 src/workloads/OptionalWorkloads.vsmanproj create mode 100644 src/workloads/VSSetup.props create mode 100644 src/workloads/VSSetup.targets create mode 100644 src/workloads/readme.md create mode 100644 src/workloads/workloads.csproj diff --git a/.gitignore b/.gitignore index 2ce687bb1..e3e8f1d20 100644 --- a/.gitignore +++ b/.gitignore @@ -15,6 +15,9 @@ Library/ # local nuget cache .nuget/ +# local tools +.tools/ + # NuGet v3 restore drops these even though we don't use MSBuild :( *.nuget.targets *.nuget.props diff --git a/.vsts-ci.yml b/.vsts-ci.yml index db8b04ad3..69a774fc2 100644 --- a/.vsts-ci.yml +++ b/.vsts-ci.yml @@ -59,13 +59,13 @@ stages: _BuildConfig: Debug _BuildArchitecture: x86 _DOTNET_CLI_UI_LANGUAGE: '' - _AdditionalBuildParameters: '' + _AdditionalBuildParameters: '-msbuildEngine dotnet' _TestArg: $(_WindowsTestArg) Build_ES_Debug_x64: _BuildConfig: Debug _BuildArchitecture: x64 _DOTNET_CLI_UI_LANGUAGE: es - _AdditionalBuildParameters: '' + _AdditionalBuildParameters: '-msbuildEngine dotnet' _TestArg: $(_WindowsTestArg) # Internal-only builds ${{ if and(ne(variables['System.TeamProject'], 'public'), notin(variables['Build.Reason'], 'PullRequest')) }}: @@ -73,29 +73,39 @@ stages: _BuildConfig: Release _BuildArchitecture: x86 _DOTNET_CLI_UI_LANGUAGE: '' - _AdditionalBuildParameters: '' + _AdditionalBuildParameters: '-msbuildEngine dotnet' _TestArg: $(_WindowsTestArg) # Always run builds Build_Release_x64: _BuildConfig: Release _BuildArchitecture: x64 _DOTNET_CLI_UI_LANGUAGE: '' - _AdditionalBuildParameters: '/p:PublishInternalAsset=true' + _AdditionalBuildParameters: '-msbuildEngine dotnet /p:PublishInternalAsset=true' _TestArg: $(_WindowsTestArg) Build_Release_arm: _BuildConfig: Release _BuildArchitecture: arm _DOTNET_CLI_UI_LANGUAGE: '' - _AdditionalBuildParameters: '' + _AdditionalBuildParameters: '-msbuildEngine dotnet' # Never run tests on arm64 _TestArg: '' Build_Release_arm64: _BuildConfig: Release _BuildArchitecture: arm64 _DOTNET_CLI_UI_LANGUAGE: '' - _AdditionalBuildParameters: '' + _AdditionalBuildParameters: '-msbuildEngine dotnet' # Never run tests on arm64 _TestArg: '' + Build_Release_workloads: + _BuildConfig: Release + # Architecture doesn't matter as for workloads we generate multiple installer sets + _BuildArchitecture: x64 + _DOTNET_CLI_UI_LANGUAGE: '' + # This is a very specific build process and MUST be built using .NET Framework MSBuild + # because of build task dependencies for Visual Studio. + _AdditionalBuildParameters: '-project src\workloads\workloads.csproj -msbuildEngine vs' + # Never run tests for workloads + _TestArg: '' - template: /eng/build.yml parameters: @@ -115,14 +125,14 @@ stages: _BuildConfig: Release _BuildArchitecture: x64 _DOTNET_CLI_UI_LANGUAGE: '' - _AdditionalBuildParameters: '/p:PublishInternalAsset=true' + _AdditionalBuildParameters: '-msbuildEngine dotnet /p:PublishInternalAsset=true' # Never run tests on PGO bits _TestArg: '' Build_Release_x86: _BuildConfig: Release _BuildArchitecture: x86 _DOTNET_CLI_UI_LANGUAGE: '' - _AdditionalBuildParameters: '' + _AdditionalBuildParameters: '-msbuildEngine dotnet' _TestArg: '' pgoInstrument: true diff --git a/README.md b/README.md index ed4dec72c..e68e0f481 100644 --- a/README.md +++ b/README.md @@ -31,6 +31,8 @@ The repository contains native code project required for the Windows installer. - Install CMAKE 3.2.0.1 or later - Install MSVC Build tools for x86/x64/arm64, v14.28-16.9 +Optional workloads depend on .NET Framework MSBuild due to external task dependencies that do not support .NET Core. This means that Arcade defaults to using ```vs``` as the build engine. When building non-workload related projects from the CLI on Windows, you will need to explicitly set the ```msbuildEngine``` parameter to ```dotnet```. For example, to build the default installers in Windows, run ```build -msbuildEngine dotnet``` instead of just ```build```. + # Build status |All legs| diff --git a/eng/SymbolPublishingExclusionsFile.txt b/eng/SymbolPublishingExclusionsFile.txt new file mode 100644 index 000000000..67f0e5b4d --- /dev/null +++ b/eng/SymbolPublishingExclusionsFile.txt @@ -0,0 +1 @@ +vsman/OptionalWorkloads.vsman diff --git a/eng/Version.Details.xml b/eng/Version.Details.xml index 22b4f92ce..92386cc61 100644 --- a/eng/Version.Details.xml +++ b/eng/Version.Details.xml @@ -136,14 +136,14 @@ - + https://github.com/dotnet/arcade - e8d0df4f35cfa23174fe7204ef958cf5d1b8e797 + 0b0d5b90b5aba80c66a9e7a210e0af8093dc4f57 - + https://github.com/dotnet/arcade - e8d0df4f35cfa23174fe7204ef958cf5d1b8e797 + 0b0d5b90b5aba80c66a9e7a210e0af8093dc4f57 https://github.com/dotnet/source-build-reference-packages diff --git a/eng/Versions.props b/eng/Versions.props index e65305785..f0f4cde74 100644 --- a/eng/Versions.props +++ b/eng/Versions.props @@ -20,7 +20,8 @@ - 6.0.0-beta.21263.5 + 6.0.0-beta.21269.3 + 6.0.0-beta.21269.3 @@ -164,5 +165,8 @@ 2.0.1-servicing-26011-01 + + 1.1.37 + diff --git a/eng/configure-toolset.ps1 b/eng/configure-toolset.ps1 index c6cc32f0c..13f193e91 100644 --- a/eng/configure-toolset.ps1 +++ b/eng/configure-toolset.ps1 @@ -4,3 +4,9 @@ $script:useInstalledDotNetCli = $false # Add CMake to the path. $env:PATH = "$PSScriptRoot\..\.tools\bin;$env:PATH" + +if ($msbuildEngine -eq 'vs') +{ + $globalJson = Get-Content -Raw global.json | ConvertFrom-Json + $env:MSBuildSdksPath = [IO.Path]::Combine($RepoRoot, ".dotnet\sdk", $globalJson.tools.dotnet, "sdks") +} diff --git a/eng/version.csproj b/eng/version.csproj index c745a3474..5394f0bff 100644 --- a/eng/version.csproj +++ b/eng/version.csproj @@ -1,6 +1,6 @@ - + - $(CoreSdkTargetFramework) + $(CoreSDKTargetFramework) $(ArtifactsObjDir)sdk_version.h diff --git a/global.json b/global.json index 2b5079f50..266f1a76b 100644 --- a/global.json +++ b/global.json @@ -1,17 +1,25 @@ { + "sdk": { + "version": "6.0.0-preview.5.21228.9", + "allowPrerelease": "true", + "rollForward": "major" + }, "tools": { "dotnet": "6.0.100-preview.5.21228.9", "runtimes": { "dotnet": [ "$(VSRedistCommonNetCoreSharedFrameworkx6460PackageVersion)" ] + }, + "vs": { + "version": "16.9" } }, "native-tools": { "cmake": "3.16.4" }, "msbuild-sdks": { - "Microsoft.DotNet.Arcade.Sdk": "6.0.0-beta.21263.5", + "Microsoft.DotNet.Arcade.Sdk": "6.0.0-beta.21269.3", "Microsoft.DotNet.CMake.Sdk": "6.0.0-beta.21253.2" } } diff --git a/src/workloads/OptionalWorkloads.vsmanproj b/src/workloads/OptionalWorkloads.vsmanproj new file mode 100644 index 000000000..95f1f2400 --- /dev/null +++ b/src/workloads/OptionalWorkloads.vsmanproj @@ -0,0 +1,68 @@ + + + + + + false + false + false + build-manifest + true + false + DotNetOptionalWorkloads + vs + 42.42.42 + true + $(ManifestOutputPath) + + + + + / + + + /CHS/ + + + /CHT/ + + + /CSY/ + + + /DEU/ + + + /ENU/ + + + /ESN/ + + + /FRA/ + + + /ITA/ + + + /JPN/ + + + /KOR/ + + + /PLK/ + + + /PTB/ + + + /RUS/ + + + /TRK/ + + + + + diff --git a/src/workloads/VSSetup.props b/src/workloads/VSSetup.props new file mode 100644 index 000000000..6cfb80b39 --- /dev/null +++ b/src/workloads/VSSetup.props @@ -0,0 +1,42 @@ + + + + 1 + + + + https://vsdrop.corp.microsoft.com/file/v1/ + https://devdiv.artifacts.visualstudio.com/ + $(MSBuildThisDirectory)Tools\Drop.App\lib\net45\Drop.exe + + 10 + $([System.DateTime]::Now.AddYears($(DropExpiration)).ToString("M/d/yyyy h:m:s tt")) + + 10 + + verbose + + + -s "$(DropServiceUri)" + --timeout "$(DropTimeout)" + --tracelevel "$(DropTraceLevel)" + -x "$(DropExpirationDate)" + + -a + + + + dotnet + installer + local_build + $([System.DateTime]::Now.ToString("yyMMdd")).1 + + + + https://vsdrop.corp.microsoft.com/file/v1/Products/$(ManifestTeamProject)/$(ManifestRepositoryName)/$(ManifestBuildBranch)/$(ManifestBuildNumber); + + + + $(OutputPath)\obj\$(MSBuildProject) + + diff --git a/src/workloads/VSSetup.targets b/src/workloads/VSSetup.targets new file mode 100644 index 000000000..3aa470934 --- /dev/null +++ b/src/workloads/VSSetup.targets @@ -0,0 +1,49 @@ + + + + + + + + + + + + + + + + + + + + + + + + Products/$(ManifestTeamProject)/$(ManifestRepositoryName)/$(ManifestBuildBranch)/$(ManifestBuildNumber) + + -n "$(DropName)" + -d "$(VSDropSource)" + + $(DropExe) Upgrade $(DropParamService) $(DropParamAuth) $(DropParamTimeout) $(DropParamTraceLevel) + $(DropExe) Create $(DropParamService) $(DropParamAuth) $(DropParamTimeout) $(DropParamTraceLevel) $(DropParamExpirationDate) $(DropParamName) + $(DropExe) Publish $(DropParamService) $(DropParamAuth) $(DropParamTimeout) $(DropParamTraceLevel) $(DropParamName) $(DropParamSource) + $(DropExe) Finalize $(DropParamService) $(DropParamAuth) $(DropParamTimeout) $(DropParamTraceLevel) $(DropParamName) + $(DropExe) Update $(DropParamService) $(DropParamAuth) $(DropParamTimeout) $(DropParamTraceLevel) $(DropParamName) --neverExpire + + + + + + + + + + + + + + + + diff --git a/src/workloads/readme.md b/src/workloads/readme.md new file mode 100644 index 000000000..6ef568558 --- /dev/null +++ b/src/workloads/readme.md @@ -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``` diff --git a/src/workloads/workloads.csproj b/src/workloads/workloads.csproj new file mode 100644 index 000000000..b74190a8c --- /dev/null +++ b/src/workloads/workloads.csproj @@ -0,0 +1,192 @@ + + + + + netcoreapp3.1 + net5.0 + net472 + $(NuGetPackageRoot)microsoft.dotnet.build.tasks.installers\$(MicrosoftDotNetBuildTasksInstallersPackageVersion)\tools\$(MicrosoftDotNetBuildTasksInstallersTaskTargetFramework)\Microsoft.DotNet.Build.Tasks.Installers.dll + + + + + + + + + $(CoreSdkTargetFramework) + false + false + + $(ArtifactsObjDir)workloads\ + $(ArtifactsBinDir)workloads\ + $(ArtifactsDir)VSSetup\$(Configuration)\Insertion\ + + $(WorkloadIntermediateOutputPath)packages\ + + + $(WorkloadIntermediateOutputPath)src\gather\GatherPacks.csproj + + + + + + $(ArtifactsObjDir)/LightCommandPackages + + $(ArtifactsNonShippingPackagesDir) + + + + $(PkgWix)\tools + $(PkgMicroBuild_Plugins_SwixBuild) + $(SwixPluginPath)\build\MicroBuild.Plugins.SwixBuild.targets + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + Microsoft + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + <_WixObj Include="$(_WixObjDir)\**\*.wixobj" /> + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + $(GitCommitCount.PadLeft(6,'0')) + + + $(_PatchNumber) + + $(GitCommitCount) + + + $(FileVersion) + + $(VersionPrefix).$(CombinedBuildNumberAndRevision) + + +