Skip to content

Conversation

@steveisok
Copy link
Member

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.

In order to support generating installers, this change adds the mono.workloads subset and the associated yml.
@ghost
Copy link

ghost commented Jul 22, 2021

Tagging subscribers to this area: @directhex
See info in area-owners.md if you want to be subscribed.

Issue Details

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.

Author: steveisok
Assignees: -
Labels:

area-Infrastructure-mono

Milestone: -

@steveisok steveisok added the Servicing-consider Issue for next servicing release review label Jul 22, 2021
@steveisok steveisok added Servicing-approved Approved for servicing release and removed Servicing-consider Issue for next servicing release review labels Jul 22, 2021
Comment on lines +63 to 64
<MicrosoftDotNetBuildTasksInstallersPackageVersion>6.0.0-beta.21369.3</MicrosoftDotNetBuildTasksInstallersPackageVersion>
<MicrosoftDotNetBuildTasksInstallersVersion>6.0.0-beta.21364.3</MicrosoftDotNetBuildTasksInstallersVersion>
Copy link
Member

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"?>
Copy link
Member

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">
Copy link
Member

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>
Copy link
Member

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?

Comment on lines +1 to +2
<?xml version="1.0" encoding="utf-8"?>
<Project ToolsVersion="4.0" DefaultTargets="Build" xmlns="http://schemas.microsoft.com/developer/msbuild/2003">
Copy link
Member

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'"/>
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 you need the condition? Does anyone else import this file?

Copy link
Member

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```
Copy link
Member

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">
Copy link
Member

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.

Copy link
Member

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.

Comment on lines +4 to +9
<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>
Copy link
Member

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" />
Copy link
Member

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.

Comment on lines +55 to +67
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
Copy link
Member

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?

Copy link
Contributor

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

@steveisok
Copy link
Member Author

This has been approved by Steve over teams/email.

@steveisok
Copy link
Member Author

@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.

@steveisok
Copy link
Member Author

@Anipik
Copy link
Contributor

Anipik commented Jul 22, 2021

The offcial build is green and follow up will be in another email as mentioned.

@Anipik Anipik merged commit d17b813 into dotnet:release/6.0-preview7 Jul 22, 2021
@ghost ghost locked as resolved and limited conversation to collaborators Aug 21, 2021
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.

Labels

Projects

None yet

Development

Successfully merging this pull request may close these issues.

4 participants