-
Notifications
You must be signed in to change notification settings - Fork 560
[ci] Move .NET preview installation to xaprepare #5191
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
Conversation
9b75680
to
8717b68
Compare
a8d1f08
to
f6dc8fb
Compare
Full run for commit f6dc8fb: https://dev.azure.com/devdiv/DevDiv/_build/results?buildId=4128812&view=results |
cb2e582
to
ee085ca
Compare
ee085ca
to
3aa4c9e
Compare
Shouldn't we be moving towards a future where |
@jpobst The goal of these changes is to provide a non-system based installation of the .NET SDK that we can use for One .NET work, and modify freely (without requiring admin) for local dev and local + CI test needs without worrying about breaking system installations. It also allows us to consolidate our .NET SDK version dependency information into a single location. Building xamarin-android still requires a system installation of .NET even with these changes (unless you update your $PATH to prefer this installation). In the future if we do move |
src/Xamarin.Android.Build.Tasks/Tests/Xamarin.ProjectTools/Android/AndroidSdkResolver.cs
Outdated
Show resolved
Hide resolved
It feels like we should keep the .NET Core 3.1 install the way it is today, and then install any additional needed .NETs with the new stuff. I think there's no reason we couldn't be running |
build-tools/xaprepare/xaprepare/ConfigAndData/Configurables.MacOS.cs
Outdated
Show resolved
Hide resolved
build-tools/xaprepare/xaprepare/Steps/Step_InstallDotNetSDKs.cs
Outdated
Show resolved
Hide resolved
build-tools/xaprepare/xaprepare/Steps/Step_InstallDotNetSDKs.cs
Outdated
Show resolved
Hide resolved
I see some downside with this approach. We'd be increasing the number of places where we are tracking .NET SDK dependency information, and we'd have to keep the 3.1 version in sync across multiple YAML files (including monodroid which is already out of sync, but we don't do a great job of syncing there in general). I'd also prefer to keep the .NET SDK versions we depend on for CI/testing in the same installation directory for my own sanity. Maybe there are benefits that outweigh these costs that I am overlooking? I know @grendello was opposed to making this a .NET Core app when this was being written, I assume some of that reasoning still stands today? This tool seems like one of the lower priority things we'd want/need to upgrade to .NET Core when it comes to our build system, |
I think there are some benefits:
|
One big disadvantage of this is that we would require both Mono and DotNet to be installed on the system with no, currently, clear advantage to using dotnet. |
Indeed. I'd much prefer to convert |
There will never be a "big bang" change where we convert 100% to dotnet in a single commit. The only way to do it is slowly when the opportunities arise. Putting it off is simply fighting against the inevitable future. |
We do require both Mono and DotNet to be installed on the system. This is simply about which is used to bootstrap setting them up. |
I just don't see any compelling advantage from this change with regards to |
The '-- RunSettings' test option is not available in 3.1
Context: https://github.com/dotnet/designs/blob/main/accepted/2020/workloads/workloads.md
For .NET 6, our .NET 6 installer payload content will be distributed
through a new "Optional Workload" concept.
Early support for workloads has now landed in VS and the .NET SDK,
and we'd like to begin to convert our monolithic MSBuild SDK NuGet into
various workload packs. In an effort to support dev and test efforts
to this end, it will be helpful to introduce a non-system installation
of .NET that we can modify freely without admin access or fear of
leaving machines in a broken state.
Update the `xaprepare -s:Standard` scenario to install multiple
`dotnet` versinos into `$(DotNetPreviewPath)`, which defaults to
`$(AndroidToolchainDirectory)\dotnet`.
The currently installed `dotnet` versions are:
* 3.1.3: Stable version, for some tests.
* 5.0.100-rc.2.20480.7: Preview .NET 5 RC which contains support
for the Optional Workload concept. |
Context: dotnet#5293 PR dotnet#5293 introduced an incompatibility with xabuild, and it appears to be causing issues with other stable builds. The [UseDotNet][1] task has a caching feature to improve "installation" times for certain versions, however this can cause issues for our non-hosted build machines. We should continue to use the custom `use-dot-net` task that Jonathan Peppers added for us during earlier .NET 5 preview work. This template was removed in PR dotnet#5191 but in hindsight it should not have been. [1]: https://docs.microsoft.com/en-us/azure/devops/pipelines/tasks/tool/dotnet-core-tool-installer?view=azure-devops
Context: dotnet#5293 PR dotnet#5293 introduced an incompatibility with xabuild, and it appears to be causing issues with other stable builds. The [UseDotNet][1] task has a caching feature to improve "installation" times for certain versions, however this can cause issues for our non-hosted build machines. We should continue to use the custom `use-dot-net` task that Jonathan Peppers added for us during earlier .NET 5 preview work. This template was removed in PR dotnet#5191 but in hindsight it should not have been. [1]: https://docs.microsoft.com/en-us/azure/devops/pipelines/tasks/tool/dotnet-core-tool-installer?view=azure-devops
Context: dotnet#5293 PR dotnet#5293 introduced an incompatibility with xabuild, and it appears to be causing issues with other stable builds. The [UseDotNet][1] task has a caching feature to improve "installation" times for certain versions, however this can cause issues for our non-hosted build machines. /Users/builder/azdo/_work/_tool/dotnet/sdk/5.0.100/Sdks/Microsoft.NET.Sdk/targets/Microsoft.NET.TargetFrameworkInference.targets(54,5): error MSB4186: Invalid static method invocation syntax: "[MSBuild]::GetTargetFrameworkIdentifier('$(TargetFramework)')". Method '[MSBuild]::GetTargetFrameworkIdentifier' not found. Static method invocation should be of the form: $([FullTypeName]::Method()), e.g. $([System.IO.Path]::Combine(`a`, `b`)). Check that all parameters are defined, are of the correct type, and are specified in the right order. [/Users/builder/azdo/_work/1/s/xamarin-android/external/Java.Interop/src/Java.Interop.GenericMarshaler/Java.Interop.GenericMarshaler.csproj] We should continue to use the custom `use-dot-net` task that Jonathan Peppers added for us during earlier .NET 5 preview work. This template was removed in PR dotnet#5191 but in hindsight it should not have been. [1]: https://docs.microsoft.com/en-us/azure/devops/pipelines/tasks/tool/dotnet-core-tool-installer?view=azure-devops
Context: #5293 PR #5293 introduced an incompatibility with `xabuild`, and it appears to be causing issues with other stable builds. The [UseDotNet][1] task has a caching feature to improve "installation" times for certain versions, however this can cause issues for our non-hosted build machines. /Users/builder/azdo/_work/_tool/dotnet/sdk/5.0.100/Sdks/Microsoft.NET.Sdk/targets/Microsoft.NET.TargetFrameworkInference.targets(54,5): error MSB4186: Invalid static method invocation syntax: "[MSBuild]::GetTargetFrameworkIdentifier('$(TargetFramework)')". Method '[MSBuild]::GetTargetFrameworkIdentifier' not found. Static method invocation should be of the form: $([FullTypeName]::Method()), e.g. $([System.IO.Path]::Combine(`a`, `b`)). Check that all parameters are defined, are of the correct type, and are specified in the right order. We should continue to use the custom `use-dot-net` task that @jonathanpeppers added for us during earlier .NET 5 preview work. This template was removed in PR #5191 but in hindsight it should not have been. [1]: https://docs.microsoft.com/azure/devops/pipelines/tasks/tool/dotnet-core-tool-installer
Context: https://github.com/dotnet/designs/blob/main/accepted/2020/workloads/workloads.md
In One .NET, our legacy installer payload content will be distributed
through a new "Optional Workload" concept. Early support for workloads
has now landed in VS and the .NET SDK, and we'd like to begin to convert
our monolithic MSBuild SDK NuGet into various workload packs. In an
effort to support dev and test efforts to this end, it will be helpful
to introduce a non-system installation of .NET that we can modify freely
without admin access or fear of leaving machines in a broken state.