-
Notifications
You must be signed in to change notification settings - Fork 4k
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
Make it possible to build/run tests on linux-arm64 #74536
Conversation
b39f092
to
e861af5
Compare
@jaredpar for a second review. |
src/Tools/Source/RunTests/Options.cs
Outdated
System.Runtime.InteropServices.Architecture.Wasm => "wasm", | ||
System.Runtime.InteropServices.Architecture.X86 => "x86", | ||
System.Runtime.InteropServices.Architecture.X64 => "x64", | ||
_ => throw new NotImplementedException() |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
This rough code path being copied three times bothers me a bit. Trying to think of a way to reduce it.
This copy should be able to reference the one in ILAsmUtilities.cs
. Or at least we should be able to put it in one location in that project and reference it here.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Yeah, it bothered me as well. My only thought had been putting it in a separate file and source-including it in each place, and I wasn't sure that was actually better.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I think we could simplify this whole method to RuntimeInformation.ProcessArchitecture.ToString().ToLowerInvariant()
.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Done.
src/Tools/Source/RunTests/Options.cs
Outdated
System.Runtime.InteropServices.Architecture.Ppc64le => "ppc64le", | ||
System.Runtime.InteropServices.Architecture.S390x => "s390x", | ||
System.Runtime.InteropServices.Architecture.Wasm => "wasm", | ||
System.Runtime.InteropServices.Architecture.X86 => "x86", |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I was thinking about this a bit: do we want to handle x86
at all? IIRC there have been some problems in the past where this forced x86 in VisualStudio, even on x64 machines.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I would keep it there for completeness but this is only called on Linux paths and I don't think we really test x86 linux to my knowldege.
e861af5
to
b3c9c79
Compare
I wanted to run the roslyn test suite on Linux on arm64. Building everything worked, but running tests would fail with errors like: Errors Microsoft.CodeAnalysis.CSharp.Emit.UnitTests_1 Could not find 'dotnet' host for the 'X64' architecture. You can resolve the problem by installing the 'X64' .NET. With the changes in this commit, I can build and run all tests using: $ ./eng/build.sh --restore --build --pack $ ./eng/build.sh --test I would, eventually, like to be able to run the tests on other platforms, including s390x and ppc64le. Hopefully that might help identify/fix issues like dotnet#74392 earlier. One thing I am not too happy about in this change is how many places need an explicit addition of "linux-arm64". That won't scale as we want to add more architectures.
b3c9c79
to
e9e733a
Compare
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
@omajid, in the future please avoid force-pushing to PRs that are in-review. It prevents using a simple diff between the previously-reviewed commit and the current code.
I wanted to run the roslyn test suite on Linux on arm64. Building everything worked, but running tests would fail with errors like:
With the changes in this commit, I can build and run all tests using:
I would, eventually, like to be able to run the tests on other platforms, including s390x and ppc64le. Hopefully that might help identify/fix issues like #74392 earlier.
One thing I am not too happy about in this change is how many places need an explicit addition of "linux-arm64". That won't scale as we want to add more architectures.