-
Notifications
You must be signed in to change notification settings - Fork 5.3k
[release/6.0-preview7] Build VS installers for WebAssembly and Mobile workloads (#55769) #56127
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
[release/6.0-preview7] Build VS installers for WebAssembly and Mobile workloads (#55769) #56127
Conversation
In order to support generating installers, this change adds the mono.workloads subset and the associated yml.
|
Tagging subscribers to this area: @directhex Issue DetailsBackport of #55769 to release/6.0-preview7. Customer ImpactWithout this PR, customers will not be able to install mono workloads (wasm, iOS/tvOS/MacCatalyst, and Android) workloads into Visual Studio TestingWe validated the packages produced are satisfactory to be inserted into VS. RiskVery low.
|
| <MicrosoftDotNetBuildTasksInstallersPackageVersion>6.0.0-beta.21369.3</MicrosoftDotNetBuildTasksInstallersPackageVersion> | ||
| <MicrosoftDotNetBuildTasksInstallersVersion>6.0.0-beta.21364.3</MicrosoftDotNetBuildTasksInstallersVersion> |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Why does this property now exist twice once with the PackageVersion suffix (which is the pattern we don't use in this repo) and once with the Version suffix?
| @@ -0,0 +1,42 @@ | |||
| <?xml version="1.0" encoding="utf-8"?> | |||
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
You can remove this xml section as it's not needed by msbuild and we usually don't have it in our msbuild files in the repo.
| @@ -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"> | |||
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
You can also remove the ToolsVersion and the xmlns attributes.
|
|
||
| <PropertyGroup> | ||
| <ManifestTeamProject Condition="'$(ManifestTeamProject)' == ''">dotnet</ManifestTeamProject> | ||
| <ManifestRepositoryName Condition="'$(ManifestRepositoryName)' == ''">installer</ManifestRepositoryName> |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Shouldn't the name of the repo be runtime?
| <?xml version="1.0" encoding="utf-8"?> | ||
| <Project ToolsVersion="4.0" DefaultTargets="Build" xmlns="http://schemas.microsoft.com/developer/msbuild/2003"> |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Same comment here about the xml line and the attributes.
| @@ -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'"/> | |||
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Why do you need the condition? Does anyone else import this file?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Why does the targets file import the props file? Usually the project imports the props and the targets file.
| @@ -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``` | |||
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
You could also mention that alternatively you can use the Developer Command Prompt shell on Windows.
| @@ -0,0 +1,185 @@ | |||
| <Project DefaultTargets="Restore;Build"> | |||
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Restore and Build targets should never run in the same node and share their evaluation as restore impacts properties and items in the Build target's evaluation.
I don't see why this line at all is necessary, I would just remove the DefaultTargets.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
When an msbuild project doesn't compile any C# code it shouldn't be named .csproj. Instead we use the .proj suffix for such.
Also I recommend to use the Microsoft.Build.NoTargets Sdk here instead which allows to override the Build target in a less hacky way.
| <PropertyGroup> | ||
| <MicrosoftDotNetBuildTasksInstallersTaskTargetFramework Condition="'$(MSBuildRuntimeType)' == 'Core'">netcoreapp3.1</MicrosoftDotNetBuildTasksInstallersTaskTargetFramework> | ||
| <MicrosoftDotNetBuildTasksInstallersTaskTargetFramework Condition="'$(DotNetBuildFromSource)' == 'true'">net5.0</MicrosoftDotNetBuildTasksInstallersTaskTargetFramework> | ||
| <MicrosoftDotNetBuildTasksInstallersTaskTargetFramework Condition="'$(MSBuildRuntimeType)' != 'Core'">net472</MicrosoftDotNetBuildTasksInstallersTaskTargetFramework> | ||
| <MicrosoftDotNetBuildTasksInstallersTaskAssembly>$(NuGetPackageRoot)microsoft.dotnet.build.tasks.installers\$(MicrosoftDotNetBuildTasksInstallersPackageVersion)\tools\$(MicrosoftDotNetBuildTasksInstallersTaskTargetFramework)\Microsoft.DotNet.Build.Tasks.Installers.dll</MicrosoftDotNetBuildTasksInstallersTaskAssembly> | ||
| </PropertyGroup> |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Don't hardcode the path to the installers task assembly as that's subject to change, i.e. when the TargetFrameworks are changed.
Instead I would just use the MicrosoftDotNetBuildTasksInstallersTaskAssembly property which is already exposed by the package here: https://github.com/dotnet/arcade/blob/828107daa2dd84171c328b9d2b58009984ee4c39/src/Microsoft.DotNet.Build.Tasks.Installers/build/Microsoft.DotNet.Build.Tasks.Installers.props#L3-L4
| <MicrosoftDotNetBuildTasksInstallersTaskAssembly>$(NuGetPackageRoot)microsoft.dotnet.build.tasks.installers\$(MicrosoftDotNetBuildTasksInstallersPackageVersion)\tools\$(MicrosoftDotNetBuildTasksInstallersTaskTargetFramework)\Microsoft.DotNet.Build.Tasks.Installers.dll</MicrosoftDotNetBuildTasksInstallersTaskAssembly> | ||
| </PropertyGroup> | ||
|
|
||
| <UsingTask AssemblyFile="$(PkgMicrosoft_DotNet_Build_Tasks_Workloads)\tools\net472\Microsoft.DotNet.Build.Tasks.Workloads.dll" TaskName="GenerateVisualStudioWorkload" /> |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Same here. The Workloads package in Arcade should expose a property that points to its task assembly and not the consumer.
| IntermediateArtifacts/MonoRuntimePacks/Shipping/Microsoft.NETCore.App.Runtime.AOT.win-x64.Cross.android-*.nupkg | ||
| IntermediateArtifacts/MonoRuntimePacks/Shipping/Microsoft.NETCore.App.Runtime.AOT.win-x64.Cross.browser-wasm*.nupkg | ||
| IntermediateArtifacts/MonoRuntimePacks/Shipping/Microsoft.NETCore.App.Runtime.Mono.android-*.nupkg | ||
| IntermediateArtifacts/MonoRuntimePacks/Shipping/Microsoft.NETCore.App.Runtime.Mono.browser-wasm*.nupkg | ||
| IntermediateArtifacts/MonoRuntimePacks/Shipping/Microsoft.NETCore.App.Runtime.Mono.ios-*.nupkg | ||
| IntermediateArtifacts/MonoRuntimePacks/Shipping/Microsoft.NETCore.App.Runtime.Mono.iossimulator-*.nupkg | ||
| IntermediateArtifacts/MonoRuntimePacks/Shipping/Microsoft.NETCore.App.Runtime.Mono.maccatalyst-*.nupkg | ||
| IntermediateArtifacts/MonoRuntimePacks/Shipping/Microsoft.NETCore.App.Runtime.Mono.tvos-*.nupkg | ||
| IntermediateArtifacts/MonoRuntimePacks/Shipping/Microsoft.NETCore.App.Runtime.Mono.tvossimulator-*.nupkg | ||
| IntermediateArtifacts/MonoRuntimePacks/Shipping/Microsoft.NET.Workload.Mono.ToolChain.Manifest*.nupkg | ||
| IntermediateArtifacts/MonoRuntimePacks/Shipping/Microsoft.NET.Runtime.MonoTargets.Sdk*.nupkg | ||
| IntermediateArtifacts/MonoRuntimePacks/Shipping/Microsoft.NET.Runtime.MonoAOTCompiler.Task*.nupkg | ||
| IntermediateArtifacts/MonoRuntimePacks/Shipping/Microsoft.NET.Runtime.WebAssembly.Sdk*.nupkg |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Can you think of a way to avoid hardcoding all these packages? Would creating a new intermediate artifact only for the mono runtime packs make sense?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
The purpose of the hardcoded list is to speed up builds, by only downloading the required artifacts out of the build. Just grabbing the whole MonoRuntimePacks folder weighs in at around 4GiB
|
This has been approved by Steve over teams/email. |
|
@ViktorHofer Appreciate the review. Generating the vs installer files is pretty time sensitive, so I think all your items can be taken care of in a follow up. |
|
official build is running at https://dev.azure.com/dnceng/internal/_build/results?buildId=1253166&view=results |
|
The offcial build is green and follow up will be in another email as mentioned. |
Backport of #55769 to release/6.0-preview7.
Customer Impact
Without this PR, customers will not be able to install mono workloads (wasm, iOS/tvOS/MacCatalyst, and Android) workloads into Visual Studio
Testing
We validated the packages produced are satisfactory to be inserted into VS.
Risk
Very low.