-
Notifications
You must be signed in to change notification settings - Fork 10k
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
WIP: Support global.json on arm64 as well #14790
Conversation
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.
Thanks @omajid
Just curious: What is your requirement to build on ARM64?
This is part of the larger work that we are doing on source-build to enable arm64 (and arm32, thought that's not my current goal) builds: dotnet/source-build#750. The goal is that Linux distributions like Fedora should be able to build and run all of .NET Core on arm64 (not cross-compiled). |
@livarcocc and @dagood who owns the It seems like some runtimes (arm64 and x86) are not available for Linux and the scripts skip them. However an arm64 SDK is available, just not one containing the runtime we need. |
dotnet-install.sh is part of cli: https://github.com/dotnet/cli/blob/master/scripts/obtain/dotnet-install.sh |
This is defined by dotnet/designs#50, but doesn't seem relevant here as the Packs are only involved in SDK build and publish scenarios. The Runtime and SDK layouts are over at https://github.com/dotnet/designs/blob/master/accepted/install-locations.md.
I don't have any underlying understanding of what Arcade or the dotnet install script are doing with the global.json, but it seems likely that the lower-versioned one is the one that the |
@livarcocc @dagood @dougbu Any thoughts on what the next steps need to be? I am happy to do the legwork. |
My guess would be that Arcade and/or the dotnet-install script needs a new feature to help with this situation, or something's broken. The next thing I'd try to do is isolate what is being installed and why, (why does it install |
Here's what I see on my end (linux, arm64): x86 is not supported, because it's Linux. So it's completely skipped.Arcade prints:
I am not sure how x86 and x64 combo works on Windows.
|
On Windows, the x64 SDK gets placed in I suspect we have logic in various places to set environment variables and so on related to the dotnet install locations that understands "native goes in My additional guess is that So, @markwilkie is it possible to update that logic to instead place the matching runtime in
instead of the current
|
From what I can tell, arcade simply calls
Would it make sense to install the current architecture (whatever that is, arm64 in my case) to Edit: fix confusion caused by multiple files with the name |
@omajid does this PR - dotnet/arcade#4132 - supersede this change? |
Not really; we will need that fix and then something like what @dougbu suggested above to be able to start a build on arm64 at all. |
arcade uses the runtime section of global.json to decide which architecture + runtime combination needs to be installed. With dotnet/arcade#4132 arcade can install foreign SDKs in separate locations correctly. This change, suggested by @dougbu, makes arcade always install the runtime for the local architecture (which means it should work on arm64 and x64) as well as the x86 architecture (skipped on Linux). This gets us a working SDK/Runtime combo on arm64.
a3571c3
to
84d274a
Compare
@dougbu Does this change look okay to you? |
This comment was made automatically. If there is a problem contact aspnetcore-build@microsoft.com. I've triaged the above build. I've created/commented on the following issue(s) |
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 this looks good. Much appreciated!
I'll merge once the required builds pass.
This commit allows ASP.NET Core to be built on arm64 machines directly, without relying on cross-compilation. There's a few changes in here: 1. Ask msbuild to look into the BuildArchitecture By default, our build systems assums the machine is x64. This modifies the build configuration to check the architecture of the currently running build machine, and set BuildArchitecture to that. 2. Fix crossgen in Microsoft.AspNetCore.App.Runtime We run crossgen for supported architectures (including x64 and arm64). For that, we need a jit that we can point crossgen to. Generally, we can rely on the build scripts to find the right `libclrjit.so`. However, arm64 has multiple `libclirjit.so`, for different use-cases. There's one for arm64 (for running on arm64) and there's another one for cross-compiling for arm64 on x64. We need to figure out and use the right one explicitly rather than assuming the right one gets picked up. See dotnet/core-setup#8468 for similar changes made in core-setup. This also needs dotnet#14790 to fully work on arm64.
This commit allows ASP.NET Core to be built on arm64 machines directly, without relying on cross-compilation. There's a few changes in here: 1. Ask msbuild to look into the BuildArchitecture By default, our build systems assums the machine is x64. This modifies the build configuration to check the architecture of the currently running build machine, and set BuildArchitecture to that. 2. Fix crossgen in Microsoft.AspNetCore.App.Runtime We run crossgen for supported architectures (including x64 and arm64). For that, we need a jit that we can point crossgen to. Generally, we can rely on the build scripts to find the right `libclrjit.so`. However, arm64 has multiple `libclirjit.so`, for different use-cases. There's one for arm64 (for running on arm64) and there's another one for cross-compiling for arm64 on x64. We need to figure out and use the right one explicitly rather than assuming the right one gets picked up. See dotnet/core-setup#8468 for similar changes made in core-setup. This also needs #14790 to fully work on arm64.
This chnage allows source-build to be cloned and built on arm64 machines. I have tested this on RHEL 8 aarch64. This change includes backports of the following pull-requests which have been merged into their respective master branches: - dotnet/aspnetcore#14790 - dotnet/aspnetcore#15354 - dotnet/installer#4102 - dotnet/core-setup#8468 - dotnet/corefx#40453
This chnage allows source-build to be cloned and built on arm64 machines. I have tested this on RHEL 8 aarch64. This change includes backports of the following pull-requests which have been merged into their respective master branches: - dotnet/aspnetcore#14790 - dotnet/aspnetcore#15354 - dotnet/installer#4102 - dotnet/core-setup#8468 - dotnet/corefx#40453
This chnage allows source-build to be cloned and built on arm64 machines. I have tested this on RHEL 8 aarch64. This change includes backports of the following pull-requests which have been merged into their respective master branches: - dotnet/aspnetcore#14790 - dotnet/aspnetcore#15354 - dotnet/installer#4102 - dotnet/core-setup#8468 - dotnet/corefx#40453
This chnage allows source-build to be cloned and built on arm64 machines. I have tested this on RHEL 8 aarch64. This change includes backports of the following pull-requests which have been merged into their respective master branches: - dotnet/aspnetcore#14790 - dotnet/aspnetcore#15354 - dotnet/installer#4102 - dotnet/core-setup#8468 - dotnet/corefx#40453
This chnage allows source-build to be cloned and built on arm64 machines. I have tested this on RHEL 8 aarch64. This change includes backports of the following pull-requests which have been merged into their respective master branches: - dotnet/aspnetcore#14790 - dotnet/aspnetcore#15354 - dotnet/installer#4102 - dotnet/core-setup#8468 - dotnet/corefx#40453
This chnage allows source-build to be cloned and built on arm64 machines. I have tested this on RHEL 8 aarch64. This change includes backports of the following pull-requests which have been merged into their respective master branches: - dotnet/aspnetcore#14790 - dotnet/aspnetcore#15354 - dotnet/installer#4102 - dotnet/core-setup#8468 - dotnet/corefx#40453
This chnage allows source-build to be cloned and built on arm64 machines. I have tested this on RHEL 8 aarch64. This change includes backports of the following pull-requests which have been merged into their respective master branches: - dotnet/aspnetcore#14790 - dotnet/aspnetcore#15354 - dotnet/installer#4102 - dotnet/core-setup#8468 - dotnet/corefx#40453
This chnage allows source-build to be cloned and built on arm64 machines. I have tested this on RHEL 8 aarch64. This change includes backports of the following pull-requests which have been merged into their respective master branches: - dotnet/aspnetcore#14790 - dotnet/aspnetcore#15354 - dotnet/installer#4102 - dotnet/core-setup#8468 - dotnet/corefx#40453
This chnage allows source-build to be cloned and built on arm64 machines. I have tested this on RHEL 8 aarch64. This change includes backports of the following pull-requests which have been merged into their respective master branches: - dotnet/aspnetcore#14790 - dotnet/aspnetcore#15354 - dotnet/installer#4102 - dotnet/core-setup#8468 - dotnet/corefx#40453
This chnage allows source-build to be cloned and built on arm64 machines. It shouldn't affect cross compilation at all, however. I have tested this on RHEL 8 aarch64. This change includes backports of the following pull-requests which have been merged into their respective master branches: - dotnet/aspnetcore#14790 - dotnet/aspnetcore#15354 - dotnet/installer#4102 - dotnet/core-setup#8468 - dotnet/corefx#40453 To support using darc on arm64, this commit removes the customizations of LD_LIBRARY_PATH and instead forces darc to run again a .NET Core 3.0 runtime. This in-turn makes darc pick up the right libgit2sharp automatically for the right set of platforms and architectures. There's a number of existing build configuration that are conditionalized on arm64, such as setting up a root file system. Those they are actually only meant to be invoked when cross-compiling for arm64 (on x86_64). This commit modifies those conditions to not apply when building on an arm64 machine.
This change allows source-build to be cloned and built on arm64 machines. It shouldn't affect cross compilation at all, however. I have tested this on RHEL 8 aarch64. This change includes backports of the following pull-requests which have been merged into their respective master branches: - dotnet/aspnetcore#14790 - dotnet/aspnetcore#15354 - dotnet/installer#4102 - dotnet/core-setup#8468 - dotnet/corefx#40453 There's a number of existing build configuration that are conditionalized on arm64, such as setting up a root file system. Those they are actually only meant to be invoked when cross-compiling for arm64 (on x86_64). This commit modifies those conditions to not apply when building on an arm64 machine.
This change allows source-build to be cloned and built on arm64 machines. It shouldn't affect cross compilation at all, however. I have tested this on RHEL 8 aarch64. This change includes backports of the following pull-requests which have been merged into their respective master branches: - dotnet/aspnetcore#14790 - dotnet/aspnetcore#15354 - dotnet/installer#4102 - dotnet/core-setup#8468 - dotnet/corefx#40453 There's a number of existing build configuration that are conditionalized on arm64, such as setting up a root file system. Those they are actually only meant to be invoked when cross-compiling for arm64 (on x86_64). This commit modifies those conditions to not apply when building on an arm64 machine.
This change allows source-build to be cloned and built on arm64 machines. It shouldn't affect cross compilation at all, however. I have tested this on RHEL 8 aarch64. This change includes backports of the following pull-requests which have been merged into their respective master branches: - dotnet/aspnetcore#14790 - dotnet/aspnetcore#15354 - dotnet/installer#4102 - dotnet/core-setup#8468 - dotnet/corefx#40453 There's a number of existing build configuration that are conditionalized on arm64, such as setting up a root file system. Those they are actually only meant to be invoked when cross-compiling for arm64 (on x86_64). This commit modifies those conditions to not apply when building on an arm64 machine.
* Enable building on arm64 This change allows source-build to be cloned and built on arm64 machines. It shouldn't affect cross compilation at all, however. I have tested this on RHEL 8 aarch64. This change includes backports of the following pull-requests which have been merged into their respective master branches: - dotnet/aspnetcore#14790 - dotnet/aspnetcore#15354 - dotnet/installer#4102 - dotnet/core-setup#8468 - dotnet/corefx#40453 There's a number of existing build configuration that are conditionalized on arm64, such as setting up a root file system. Those they are actually only meant to be invoked when cross-compiling for arm64 (on x86_64). This commit modifies those conditions to not apply when building on an arm64 machine. * Patch fixup.
* Enable building on arm64 This change allows source-build to be cloned and built on arm64 machines. It shouldn't affect cross compilation at all, however. I have tested this on RHEL 8 aarch64. This change includes backports of the following pull-requests which have been merged into their respective master branches: - dotnet/aspnetcore#14790 - dotnet/aspnetcore#15354 - dotnet/installer#4102 - dotnet/core-setup#8468 - dotnet/corefx#40453 There's a number of existing build configuration that are conditionalized on arm64, such as setting up a root file system. Those they are actually only meant to be invoked when cross-compiling for arm64 (on x86_64). This commit modifies those conditions to not apply when building on an arm64 machine. * Patch fixup.
I am trying to get ASP.NET Core to build on linux/arm64 machines (not cross compiled on x86_64).
On such machines, global.json makes arcade download the arm64 SDK, then the x64 and/or x86 runtimes. Now there are two copies of hostfxr in the local SDK:
One is an x64 binary, the other is the arm64 binary:
Unfortunately, the higher version is the x64 binary. That can't be loaded or used on arm64. The ASP.NET Core build quickly runs into an error:
This change removes architecture-specific download versions from global.json. This lets arcade download the arch-appropriate version of .NET Core which then lets the build continue past this error.