Open tipa opened 4 years ago
I have this same issue with Nightingale. @tipa have you found any workarounds? Also, is your build failing on a CI pipeline or are you building locally on your machine? https://github.com/jenius-apps/nightingale-rest-api-client/issues/99
No I haven't found any workarounds, I gave up trying and don't build ARM64 variants for my apps any more.
@tipa I did some investigations and it looks like the issue is related to low memory. See this comment https://github.com/jenius-apps/nightingale-rest-api-client/issues/99#issuecomment-720960221
I've been having the same issue with my app, and I recently upgraded to 6.2.11
to see if that helps with this problem. Unfortunately, the build process still fails on ARM64:
3>C:\Users\mfeingol\.nuget\packages\microsoft.net.native.compiler\2.2.9-rel-29512-01\tools\Microsoft.NetNative.targets(805,5): error : /c/Users/mfeingol/.nuget/packages/runtime.win10-arm64.microsoft.net.native.compiler/2.2.9-rel-29512-01/tools/ARM64/ilc/tools/link/link: missing operand after '��/'
3>C:\Users\mfeingol\.nuget\packages\microsoft.net.native.compiler\2.2.9-rel-29512-01\tools\Microsoft.NetNative.targets(805,5): error : Try '/c/Users/mfeingol/.nuget/packages/runtime.win10-arm64.microsoft.net.native.compiler/2.2.9-rel-29512-01/tools/ARM64/ilc/tools/link/link --help' for more information.
3>C:\Users\mfeingol\.nuget\packages\microsoft.net.native.compiler\2.2.9-rel-29512-01\tools\Microsoft.NetNative.targets(805,5): error : ILT0005: 'C:\Users\mfeingol\.nuget\packages\runtime.win10-arm64.microsoft.net.native.compiler\2.2.9-rel-29512-01\tools\ARM64\ilc\tools\link\link.exe @"C:\Operations\Build\Home\Sideroads\Source\Sideroads.Windows\obj\ARM64\Release\ilc\intermediate\linkargs.Sideroads.rsp"' returned exit code 1
Please let me know what sort of diagnostics might help.
Please share a structured msbuild log to dotnetnative@microsoft.com:
Thanks for following up, @tommcdon. Here's a log:
The file seems small, so I'm not sure it has the granularity you need. Let me know if I need to re-run with increased verbosity.
I ran into the exact same problem. Let me know if more logs could help, or if there is any workaround to try.
The error message in the msbuild log is:
LINK : the 32-bit linker (C:\Users\mfeingol\.nuget\packages\runtime.win10-arm64.microsoft.net.native.compiler\2.2.9-rel-29512-01\tools\ARM64\ilc\tools\link\link.exe) ran out of heap space and is going to restart linking with a 64-bit linker
In the 6.2.11 release, we added a compilation flag to disable symbols on ARM64. This saves memory and as a side-effect may unblock the build. To try it out, add <NoLinkerSymbols>true</NoLinkerSymbols>
to the to the relevant ARM64 property groups in your csproj files.
It may also be possible to resolve the issue by reducing the input into the compiler. I’m not sure if we have shared these workarounds in the past, but these have historically been useful in helping to reduce the memory footprint to the compiler, which will also increase compilation speed:
Compiler flags
There are a wide range of flags available but here’s a couple that may help out:
<ShortcutGenericAnalysis>true</ShortcutGenericAnalysis>
- Can help stop runaway analysis of generic types and reduce overall generation requirements.
<UseDotNetNativeSharedAssemblyFrameworkPackage>false</UseDotNetNativeSharedAssemblyFrameworkPackage>
- Eliminates one of the linking boundaries the compiler has to fight with. I actually suspect turning this off will make things worse not better but whole program optimizers are hard to reason about but rebuilds are cheap enough to try.
Runtime Directives
There is a default.rd.xml
file that provides "Runtime Directives" to the .NET Native compiler. The overall syntax of the file is also included in the reading above. The default config is the following, which may be leading to including "too much" metadata and code into the .NET native compiler engine:
<Assembly Name="*Application*" Dynamic="Required All" />
Removing the directive but still have a working application may take some time iterating through a series of directives to try. There’s two approaches that have tradeoffs, so I’ll describe both and let you decide if either methodology suits you. Roughly here’s what the two workflows look like:
Start from nothing.
*Application*
directiveStart from everything
*Application*
directiveDynamic
directive. They’ll look like: <Assembly Name="ASSEMBLYNAMEWITHOUTEXTENTION" Dynamic="Required All"/>
These articles provide some useful background info:
I get error code 1105. What does this mean?
I always get this when the source is on a network share, if the source is on local drive compiling works fine.
Building ARM64 packages works for most of my UWP apps, but one of them (the largest project) fails with this error: