-
Notifications
You must be signed in to change notification settings - Fork 1.1k
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
Add support for ARM32 & ARM64 as AvailablePlatforms #16802
Conversation
I couldn't figure out the best area label to add to this PR. If you have write-permissions please help me learn by adding exactly one area label. |
I'd suggest using the built-in
|
I double checked that the leading |
@dsplaisted Is there a better location to place these checks? |
This looks like a fine place to put this. But I think we probably don't want to have the |
@dsplaisted After just talking about this in standup: We don't really have a way to check what OS is being targeted. Because of that I'm not sure how we can limit which OS we can provide the arm64 build option vs the arm32 build option. (/cc: @tommcdon) Looks like the best we can do is: NetCoreApp2.1: allow arm32 Sounds to me like we should add conditional warnings/errors for combinations of platform/currentOS that aren't supported. |
One small tweak to the table - we support arm64 winforms and WPF in .NET 6, and we are in the process of adding macOS apple silicon. Another note is that the "console app" limitation includes support for kestrel (.net core 3.1+). I'm not sure if it changes the constraints or design, just calling out that we have more supported arm64 platforms/project types. cc @richlander |
The project-type & platform limitations are a bit confusing. We want to allow ARM64 on net5.0, but only for console apps on windows and everything else in linux. But we can't tell what OS we're targeting. How would we accomplish this? Should the project-type limitation exist regardless of the platform? ie. "Console only" extends to both windows and linux. @dsplaisted would appreciate your take on this. |
I think you have to be liberal. If there isn't a target OS, then you have to allow ARM64 if there is any OS where the project could run as ARM64. There are some cases where you know the target OS. The TargetPlatformIdentifier might be Windows (there isn't a TargetPlatformIdentifier for Linux). Also if a RuntimeIdentifier is specified it probably tells you which OS is being targeted. If you want to try to cover those cases I think you'd want to get a PM to define the scenarios and what we want to do for them. |
I don't understand the console-specific check for Windows Arm64. ASP.NET Core works on Windows Arm64. I'd like to see a list of projects configurations that should fail this test and those that should pass. I'm having trouble reverse engineering this from the issue. Can you provide that? |
@richlander @tommcdon Ben has changed it to allow arm32 for anything 2.1 and up and arm64 for anything 3.1 and up. This could allow customers to select it in a configuration it would fail but trying to block only the cases that will fail will potentially be complex and error-prone. Is this more liberal approach reasonable to you? |
That sounds good, at least as a starting point where we can collect more feedback. FYI: We dropped support for Windows Arm32 with .NET 5. |
@richlander @marcpopMSFT thanks for confirming. Opening this as ready for review then. |
@tommcdon This went into main and so will be available in dev17. Should we consider this for 5.0.3xx as well so it will be in 16.10+? |
@marcpopMSFT I agree we should consider this for 5.0.3xx. |
@benvillalobos mind creating a 5.0.3xx version of this change? |
@marcpopMSFT Created here: #17253 |
Fixes dotnet/msbuild#5951
Context
.NET 5 is adding support for Windows ARM64. Visual Studio .NET Core projects should allow you target ARM64 in addition to x86/x64/arm32.
This is planned to be based off of the
AvailablePlatforms
property.Changes Made
In Microsoft.NET.Sdk.targets, added conditional propertygroups based on
TargetFrameworkIdentifier
andTargetFrameworkVersion
to add ARM32/64 as a platform.Testing
Needs dotnet/project-system#7081 to account for
AvailablePlatforms
so we can see it in the Platform Target dropdown under project properties.Notes
What we're trying to apply ARM to:
Todo