-
Notifications
You must be signed in to change notification settings - Fork 4.8k
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
[NativeAOT] cross-compiling to osx-arm64 from osx-x64 does not work #82542
Comments
@filipnavara Do you happen to know what the problem is? |
Tagging subscribers to this area: @agocke, @MichalStrehovsky, @jkotas Issue DetailsReported by @lemonmojo in #73678 (comment): I'm also running into the same error using .NET 8 Preview 1. While cross-compiling to x64 from an M1 machine works fine for me, I can't get the reverse (cross-compiling to ARM64 from an Intel machine) to work. I'm not using any packages in this project. In fact, the issue is very easy to reproduce:
Publishing using
So here's what works and what doesn't work in my testing:
|
FWIW, the CI is cross-compiling for arm64 on osx-x64 machine. |
It used to work, and this error is new to me. I'll try to reproduce it on my machine, but just in case that doesn't work, it would be useful to get a MSBuild binlog. It can be produced with a |
I do have binlog from @lemonmojo and we troubleshoot that issue in #coreclr channel on dotnet evolution. |
If you do not use explicit The explicit |
It reproduces. The |
I ask OP manually add this to download package in the cache. I think after this package in the Nuget cache issue will disappear. |
It obviosly still a bug, but I do not troubleshoot that far and I do not have Mac |
The problem happens on this line: runtime/src/coreclr/nativeaot/BuildIntegration/Microsoft.DotNet.ILCompiler.SingleEntry.targets Line 51 in f295ea1
It matches However, there's no osx-arm64 binlog (fail): |
It happens because RuntimeIlcPackageName package not in the cache. Without that GetPackageDirectory cannot find path to package(it does not exists locally) |
Yep, I agree with the assessment. It doesn't restore the NuGet of the target runtime package. If it already exists though then the error doesn't happen. Here's a proof:
|
This code should be responsible for downloading both x64 and arm64 packages for cross-compilation: |
The output of the task has only the host targeting pack in the The branch that should do this actually doesn't have the code to add to the downloads. |
I suppose the fix would be placing this somewhere around here:
|
I tested the fix with local build and it works, so I opened a PR. |
This specific cross-compilation scenario is fixed by #82558. (If there are other cross-compilation scenarios to improve, we should open specific issues for them.) |
Thx @jkotas and @filipnavara! I'll test again when the next preview lands. Cheers |
Reported by @lemonmojo in #73678 (comment):
I'm also running into the same error using .NET 8 Preview 1.
While cross-compiling to x64 from an M1 machine works fine for me, I can't get the reverse (cross-compiling to ARM64 from an Intel machine) to work.
I'm not using any packages in this project. In fact, the issue is very easy to reproduce:
Publishing using
dotnet publish -r osx-x64
anddotnet publish -r osx-arm64
works fine from an M1 machine.While on an Intel machine only the x64 build works and the ARM64 one fails with the error message:
So here's what works and what doesn't work in my testing:
ARM64 -> x64: OK
ARM64 -> ARM64: OK
x64 -> x64: OK
x64 -> ARM64: Error
The text was updated successfully, but these errors were encountered: