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

Build is broken on Apple Silicon #51447

Closed
mfilippov opened this issue Apr 17, 2021 · 9 comments
Closed

Build is broken on Apple Silicon #51447

mfilippov opened this issue Apr 17, 2021 · 9 comments

Comments

@mfilippov
Copy link
Contributor

Description

./build.sh fail with error:

  ILCompiler.ReadyToRun -> /Users/mfilippov/GitHub/runtime/artifacts/bin/ILCompiler.ReadyToRun/arm64/Debug/ILCompiler.ReadyToRun.dll
  crossgen2 -> /Users/mfilippov/GitHub/runtime/artifacts/bin/coreclr/OSX.arm64.Debug/crossgen2/crossgen2.dll
/Users/mfilippov/GitHub/runtime/.dotnet/sdk/6.0.100-preview.2.21155.3/Microsoft.Common.CurrentVersion.targets(4941,5): error MSB3030: Could not copy the file "/Users/mfilippov/GitHub/runtime/artifacts/bin/coreclr/OSX.arm64.Debug/x64/libjitinterface_x64.dylib" because it was not found. [/Users/mfilippov/GitHub/runtime/src/coreclr/tools/aot/crossgen2/crossgen2_crossarch.csproj]

Build FAILED.

/Users/mfilippov/GitHub/runtime/.dotnet/sdk/6.0.100-preview.2.21155.3/Microsoft.Common.CurrentVersion.targets(4941,5): error MSB3030: Could not copy the file "/Users/mfilippov/GitHub/runtime/artifacts/bin/coreclr/OSX.arm64.Debug/x64/libjitinterface_x64.dylib" because it was not found. [/Users/mfilippov/GitHub/runtime/src/coreclr/tools/aot/crossgen2/crossgen2_crossarch.csproj]
    0 Warning(s)
    1 Error(s)

Time Elapsed 00:03:18.49
Build failed with exit code 1. Check errors above.

Configuration

Apple Mac Mini with M1 chip. macOS 11.2.3 (20D91)

Regression?

Yes

Other information

Looks like it connected with #51349

@dotnet-issue-labeler dotnet-issue-labeler bot added area-crossgen2-coreclr untriaged New issue has not been triaged by the area owner labels Apr 17, 2021
@danmoseley
Copy link
Member

@davidwrighton @sdmaclea

@davidwrighton
Copy link
Member

@sdmaclea Can you take this? I don't have access to any Mac hardware much less any hardware with Apple Silicon. Presumably we could either disable build of the cross-arch variant of crossgen2 when building on actual arm64 apple hardware (which is what I would suggest), or ensure that the x64 native components were built as they are when we build on x64. You may also need to adjust the rules for running crossgen2 in our build so that the crossgen compiler used is the arm64 one, but that shouldn't be difficult either.

@mangod9
Copy link
Member

mangod9 commented Apr 19, 2021

this is known issue till we get the native arm64 sdk enabled for macos arm64 builds. Believe that is waiting on various runtime stability fixes.

@mangod9
Copy link
Member

mangod9 commented Apr 19, 2021

current workaround is to run without crossgen2: ./build.sh /p:UseCrossgen2=false

@mangod9 mangod9 added arch-arm64 os-mac-os-x macOS aka OSX and removed untriaged New issue has not been triaged by the area owner labels Apr 19, 2021
@mangod9 mangod9 added this to the 6.0.0 milestone Apr 19, 2021
@sdmaclea
Copy link
Contributor

This is working with macOS 11.3 which just release + updating to global json to the .NET6 preview3 sdk and building natively.

I would guess the glbal.json update is partially gated by the monthly infra breaking change cycle (which might want to be shifted for the preview release schedule).

@omajid
Copy link
Member

omajid commented Apr 22, 2021

I am also seeing this on Fedora 32, building on arm64:

  crossgen2 -> /home/tester/runtime/artifacts/bin/coreclr/Linux.arm64.Release/crossgen2/crossgen2.dll
/home/tester/runtime/.dotnet/sdk/6.0.100-preview.2.21155.3/Microsoft.Common.CurrentVersion.targets(4941,5): error MSB3030: Could not copy the file "/home/tester/runtime/artifacts/bin/coreclr/Linux.arm64.Release/x64/libjitinterface_x64.so" because it was not found. [/home/tester/runtime/src/coreclr/tools/aot/crossgen2/crossgen2_crossarch.csproj]

This is an arm64 machine, so the x64 binary, if it existed, wouldn't work.

@davidwrighton
Copy link
Member

@omajid do you have a requirement to be able to self-build on arm64 hardware, or is it a nice-to-have?

@omajid
Copy link
Member

omajid commented Apr 22, 2021

@davidwrighton We have shipped .NET Core 3.1 and .NET 5.0 as a part of Fedora on arm64. Fedora doesn't use cross-compilation. All our builds of .NET for arm64 are done on arm64. It's more of a requirement than a nice-to-have (though it isn't urgent for an in-development version of .NET).

We are also trying to get this working on RHEL, but there are other issues preventing us, like #43349. RHEL has the same policy of build-on-arm64-for-arm64 instead of cross compilation.

@davidwrighton
Copy link
Member

This looks to be fixed by #51706 . Please let us know if that isn't the case.

@ghost ghost locked as resolved and limited conversation to collaborators May 23, 2021
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Projects
None yet
Development

No branches or pull requests

6 participants