Repository navigation
[release/6.0] Tools: Target .NET 6 to improve compatibility with osx-arm64 - #27807
Conversation
| <RootNamespace>Microsoft.EntityFrameworkCore.Tools</RootNamespace> | ||
| <CheckEolTargetFramework>False</CheckEolTargetFramework> | ||
| <CodeAnalysisRuleSet>$(MSBuildThisFileDirectory)..\..\rulesets\EFCore.noxmldocs.ruleset</CodeAnalysisRuleSet> | ||
| <RollForward>Major</RollForward> |
There was a problem hiding this comment.
This change isn't really related to the M1 issues. It's a cherry-pick from main of PR #27671.
It helps in a few corner cases where dotnet-ef can't determine a project's target framework. On other platforms, the workaround is to install an older version of the runtime. But on osx-arm64, there is no workaround since that older version isn't available.
We've had a fair amount of users hit this on other platforms, and I suspect that once we unblock osx-arm64 we'll see a few more reports from those users who won't be able to work around it. It seems prudent to me to eagerly fix this now as part of this change rather than making users wait a few more months for another patch.
| <OutputType>Exe</OutputType> | ||
| <PackAsTool>true</PackAsTool> | ||
| <PackAsToolShimRuntimeIdentifiers>win-x64;win-x86</PackAsToolShimRuntimeIdentifiers> | ||
| <PackAsToolShimRuntimeIdentifiers>win-x64;win-x86;win-arm64</PackAsToolShimRuntimeIdentifiers> |
There was a problem hiding this comment.
Also not related to osx-arm64, but allows us to codesign a win-arm64 shim.
Also adds a shim we can sign for win-arm64 and rolls ef.dll forward across major runtime versions. Fixes dotnet#27787, fixes dotnet#27827
|
So this pr was a cherry pick from main entirely? |
For tools targeting versions below 6.0, the
dotnet tool installcommand creates an x64 shim. When users try to rundotnet ef, it errors with The required library libhostfxr.dylib could not be found.For tools targeting 6.0 or higher, it will generate an arm64 shim. This enables the tool to work as expected.
Fixes #27787, fixes #27827
Customer impact
Without this, users are required to specify
-a arm64when installing the tool on osx-arm64 before it will work.Regression?
Sort of. The
dotnet tool installbehavior changed in 6.0.1 causing our tool to stop working.Risk
Low. EF Core 6.0 already requires .NET 6.0, so users already have it installed, and because we specify RollForward= Major, it's already being used to run dotnet-ef.