-
Notifications
You must be signed in to change notification settings - Fork 4.9k
Conversation
I dont have access to VS to verify this change :( |
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.
What about running VS on an x86 system?
@ViktorHofer Ah, good point. It would get forced to Then again, it seems to me the current code (without my changes) forces it to x64 too:
Do you know if building/testing with VS currently works on x86 systems out of the box? |
No, see the comment here: https://github.com/dotnet/corefx/blob/master/Directory.Build.props#L57-L63. We set that property based on the configuration string that is supplied by VS. |
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.
Can you please explain what is blocking the build on a hosted arm64 machine today? Why can't you just call ./build.sh -arch arm64
or whatever arch you want? Building inside a hosted environment is not a common case, so I would try not to optimize for those as long as we have a way of building by passing in an extra arg.
I wrote about this in #40427, copying it here:
@wfurt agreed:
|
I see. Why does this not work today though? if you are in linux-arm64 then HostOS should be Arm64 so should archgroup automatically default to arm64 as well? |
Out of the box,
it turns out the
It's incorrectly using the ilasm binary for x64 instead of the binary on arm64. A hardcoded fix for that is: - <ToolRuntimeRID>$(_runtimeOS)-x64</ToolRuntimeRID>
+ <ToolRuntimeRID>$(_runtimeOS)-arm64</ToolRuntimeRID> But that will only work on arm64. If I generalize this to: - <ToolRuntimeRID>$(_runtimeOS)-x64</ToolRuntimeRID>
+ <ToolRuntimeRID>$(_runtimeOS)-$(ArchGroup)</ToolRuntimeRID> Then that (AFAIK) breaks cross compilation - because we want to use x64 tools when building arm64 on x64. So we need to use architecture of the platform that is running the build - My fix then goes (maybe too far?) and sets ArchGroup (which can take values of @tmds suggested offline that maybe we could only set |
I am also interested in fixing up how we use the host architecture within our build scripts to handle potential new architectures in the future without further changes. |
I see, if all that needs in order to unblock your scenario is to change ToolRuntimeRID, then can't we just scope the change to that property? As in, can't we just have something like: <ToolRuntimeRID>$(_runtimeOS)-$(HostArch.ToString.ToLowerInvariant())</ToolRuntimeRID> |
Yeah, that seems like a good idea. Do you know how that would affect VS on x86/x64? |
daa3e99
to
91941bc
Compare
Oh you are right that would probably make VS build not work for that case. Perhaps we could keep the default to x64 and add a condition to set it to the above if BuildingInsideVisualStudio is not set, so basically similar to your current approach except that we would be narrowing down the impact by setting ToolRuntimeRID instead of ArchGroup. |
91941bc
to
d36274c
Compare
I have verified that the my latest changes build on arm64 as well as x86_64. Any thoughts on it? |
Anyone have any thoughts on this? |
I think I'm fine with the change as it is. We might still be missing a special case where this would break (for example cross builds or similar) but I believe that if we do find such a case we can fix it easily. @ericstj @ViktorHofer @safern any additional thoughts? or is this good to go? |
I'm ok with the change as well. Thanks for boxing this through. |
Re-running the CI according to our merge policies. |
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.
Looks good to me.
Thanks |
Thanks for the review and merging this, folks! Please do comment here (or in another issue and cc me) if this causes any other issues. |
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.
crossgen2 (and by extension, runtime) fails to build on an arm64 box. This is the error I see on Fedora 32 aarch64: ./build.sh ... crossgen2 -> artifacts/bin/coreclr/Linux.arm64.Debug/crossgen2/crossgen2.dll src/coreclr/src/tools/aot/crossgen2/crossgen2.csproj(87,5): error MSB3030: Could not copy the file "artifacts/bin/coreclr/Linux.arm64.Debug//x64/libjitinterface.so" because it was not found. The file is there, just not under the `x64` directory: $ find -iname libjitinterface.so ./artifacts/bin/coreclr/Linux.arm64.Debug/libjitinterface.so ./artifacts/bin/coreclr/Linux.arm64.Debug/crossgen2/libjitinterface.so ./artifacts/obj/coreclr/Linux.arm64.Debug/src/tools/aot/jitinterface/libjitinterface.so The actual bug is that crossgen2 seems to assume that if the build is for an `arm64` RID, it's a cross-build, not a hosted build. Fix that by explicitly checking `BuildArchitecture` as well. Please see dotnet/corefx#40453 and dotnet/core-setup#8468 for related fixes enabling building for arm64 on an arm64 machine. I have *not* verified this change in Visual Studio.
* 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.
This is attempt #2.
Initialize HostArch to the arch-style used in RIDs directly. Unless running in Visual Studio, when it should be forced to x64.
Initialize ArchGroup to HostArch unless overridden.
Use the HostArch for the tool runtime instead of assuming x64.