Skip to content
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

dotnet test --arch X64 doesn't fail on Mac arm64 #21980

Open
MarcoRossignoli opened this issue Oct 12, 2021 · 5 comments
Open

dotnet test --arch X64 doesn't fail on Mac arm64 #21980

MarcoRossignoli opened this issue Oct 12, 2021 · 5 comments

Comments

@MarcoRossignoli
Copy link
Member

MarcoRossignoli commented Oct 12, 2021

Describe the bug

When I run dotnet test --arch X64 on Mac M1 it should fail like for other verbs with NETSDK1083: The specified RuntimeIdentifier 'osx-X64' is not recognized.
On my test it compiles to a valid RID and create a folder like osx-X64

To Reproduce

TestProjectNetcore.zip

Download above project and run

dotnet test --arch X64

Further technical details

.NET SDK (reflecting any global.json):
Version: 6.0.100-rc.2.21505.57
Commit: ab39070116

Runtime Environment:
OS Name: Mac OS X
OS Version: 11.4
OS Platform: Darwin
RID: osx.11.0-arm64
Base Path: /usr/local/share/dotnet/sdk/6.0.100-rc.2.21505.57/

Host (useful for support):
Version: 6.0.0-rc.2.21480.5
Commit: 6b11d64e7e

.NET SDKs installed:
6.0.100-rc.2.21505.57 [/usr/local/share/dotnet/sdk]

.NET runtimes installed:
Microsoft.AspNetCore.App 6.0.0-rc.2.21480.10 [/usr/local/share/dotnet/shared/Microsoft.AspNetCore.App]
Microsoft.NETCore.App 6.0.0-rc.2.21480.5 [/usr/local/share/dotnet/shared/Microsoft.NETCore.App]

@dotnet-issue-labeler dotnet-issue-labeler bot added Area-DotNet Test untriaged Request triage from a team member labels Oct 12, 2021
@MarcoRossignoli MarcoRossignoli changed the title dotnet test --arch X64 doesn't fail on Mac arm64 dotnet test --arch X64 doesn't fail on Mac arm64 Oct 12, 2021
@MarcoRossignoli
Copy link
Member Author

MarcoRossignoli commented Oct 25, 2021

Hi @sfoslund I see that this PR added --arch command line #18889

We're aligning dotnet test and looks like there's not validation of generated RID, is it on purpose?

return $"{os}-{arch}";

In sample above if we try with dotnet test --arch X64 the generated RID will be "-property:RuntimeIdentifier=win-ARM64"

The consequence is that platform doesn't flow to our task because it's not recognized and looks like it fallback to AnyCPU, I found this message for _CheckForInvalidConfigurationAndPlatform

The BaseOutputPath/OutputPath property is not set for project 'TestProjectNetcore.csproj'.  Please check to make sure that you have specified a valid combination of Configuration and Platform for this project.  Configuration='Debug'  Platform='AnyCPU'.  You may be seeing this message because you are trying to build a project without a solution file, and have specified a non-default Configuration or Platform that doesn't exist for this project.

cc: @vitek-karas

@sfoslund
Copy link
Member

We depend on msbuild to determine if the RID is valid and error if not, since we don't want to duplicate that logic. We get the following error for invalid RIDs right now:

error NETSDK1083: The specified RuntimeIdentifier 'win-foo' is not recognized.

This error comes from the ResolveAppHost task.

@MarcoRossignoli MarcoRossignoli removed the untriaged Request triage from a team member label Feb 1, 2022
@MarcoRossignoli
Copy link
Member Author

MarcoRossignoli commented Feb 1, 2022

@rainersigwald can you help or explain if it's expected?
We're flowing property:RuntimeIdentifier to msbuild.

@rainersigwald
Copy link
Member

Sorry, I don't think I understand what you're asking about.

It looks like the SDK doesn't validate RID unless it's using an apphost or a couple of other conditions, from the snippet sfoslund linked:

<PropertyGroup Condition="'$(AppHostRuntimeIdentifier)' == '' And
('$(UseAppHost)' == 'true' Or '$(EnableComHosting)' == 'true' Or '$(UseIJWHost)' == 'true')">
<AppHostRuntimeIdentifier>$(RuntimeIdentifier)</AppHostRuntimeIdentifier>
<AppHostRuntimeIdentifier Condition="'$(AppHostRuntimeIdentifier)' == ''">$(DefaultAppHostRuntimeIdentifier)</AppHostRuntimeIdentifier>
</PropertyGroup>

Are you asking the SDK to do more validation?

@MarcoRossignoli
Copy link
Member Author

MarcoRossignoli commented Feb 1, 2022

Yep I was wondering if it's possible extend validation in case of "non hosts" for the test sdk.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

No branches or pull requests

3 participants