dotnet / runtime

.NET is a cross-platform runtime for cloud, mobile, desktop, and IoT apps.
https://docs.microsoft.com/dotnet/core/
MIT License
15.48k stars 4.76k forks source link

dotnet test does not support arm64 for platform and does not pass args to the build of other projects #78325

Closed hakenmt closed 2 years ago

hakenmt commented 2 years ago

Description

I'm running the following command on my test project.

dotnet test --runtime linux-arm64 -p:Platform=arm64 -p:PlatformTarget=arm64 -p:ProcessorArchitecture=arm64

This results in an error. Invalid platform type:arm64. Valid platform types are x86, x64 and Arm.

When arm is specified for PlatformTarget, the command works, but the platform and processor parameters are not passed to the build of the main project. In the project, I'm using conditions for the TargetFramework like this:

<PropertyGroup>
  <TargetFramework Condition="'$(PlatformTarget)' == 'arm64'">netcoreapp3.1</TargetFramework>
  <TargetFramework Condition="'$(PlatformTarget)' != 'arm64'">net6.0</TargetFramework?
  <Platforms>ARM64;x64</Platforms>
</PropertyGroup>

I can tell the parameters aren't being passed because the build tries to target net6.0 when it should be targeting netcoreapp3.1. I would expect the build of both projects to use the provided parameters.

Configuration

This is being run in an AWS CodeBuild environment on an Amazon Linux 2 ARM64 container.

Regression?

Not sure if this problem exists elsewhere.

Other information

ghost commented 2 years ago

Tagging subscribers to this area: @dotnet/area-infrastructure-libraries See info in area-owners.md if you want to be subscribed.

Issue Details
### Description I'm running the following command on my test project. ``` dotnet test --runtime linux-arm64 -p:Platform=arm64 -p:PlatformTarget=arm64 -p:ProcessorArchitecture=arm64 ``` This results in an error. `Invalid platform type:arm64. Valid platform types are x86, x64 and Arm.` When `arm` is specified for `PlatformTarget`, the command works, but the platform and processor parameters are not passed to the build of the main project. In the project, I'm using conditions for the TargetFramework like this: ``` netcoreapp3.1 net6.0ARM64;x64 ``` I can tell the parameters aren't being passed because the build tries to target `net6.0` when it should be targeting `netcoreapp3.1`. I would expect the build of both projects to use the provided parameters. ### Configuration This is being run in an AWS CodeBuild environment on an Amazon Linux 2 ARM64 container. ### Regression? Not sure if this problem exists elsewhere. ### Other information
Author: hakenmt
Assignees: -
Labels: `area-Infrastructure-libraries`
Milestone: -
ViktorHofer commented 2 years ago

Likely the same as https://github.com/microsoft/vstest/pull/1927. Sounds like VSTest doesn't support arm64 today?

ViktorHofer commented 2 years ago

cc @nohwnd @MarcoRossignoli

MarcoRossignoli commented 2 years ago

Test platform today supports ARM64.

ARM64 was been added here https://github.com/microsoft/vstest/pull/3003/files#diff-7ab61afc88751e74038b5ef7068376b71882aad25297172096230dc63f3131e0 on 5 August 2021.

My suspect is that you're running tests with the netcoreapp3.1 SDK that's too old.

Can you run dotnet --info?

hakenmt commented 2 years ago

Yes, this build is using netcoreapp3.1. But EOS for that isn't until December. Shouldn't it have parity for this?

MarcoRossignoli commented 2 years ago

Back porting to old version wasn't planned and we didn't have request for that since now for what I know. We can move this issue to the vstest repo and wait to see if there're others request for that.

ViktorHofer commented 2 years ago

Yes, I think this issue should be moved into the vstest repository as it isn't actionable on our side.

MarcoRossignoli commented 2 years ago

@ViktorHofer you can close this one thanks

ViktorHofer commented 2 years ago

@MarcoRossignoli can you please link to the new one opened?

MarcoRossignoli commented 2 years ago

Moved to https://github.com/microsoft/vstest/issues/4123