-
Notifications
You must be signed in to change notification settings - Fork 4.9k
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
How to build a project using locally built ILCompiler? #68257
Comments
I would recommend to generate a rsp file manually and pass it directly to ilc. |
The easiest way to use the locally built compiler is do a full build including packaging, add nuget.config path that points to We have runtime/src/tests/Directory.Build.targets Lines 517 to 523 in 4881a63
My typical dev workflow is to build the regular package and point nuget.config to it, and then override |
With CoreRT, it was possible to build an app using ILCompiler that was built locally: https://github.com/dotnet/corert/blob/7f902d4d8b1c3280e60f5e06c71951a60da173fb/Documentation/how-to-build-and-run-ilcompiler-in-console-shell-prompt.md#compiling-source-to-native-code-using-the-ilcompiler-you-built
BenchmarkDotNet supported that, but I've not used it for a long time. Today I wanted to give it a try to test #68249 and I've failed.
Sample project file:
The first error I got was:
Native compilation can run on x64 and arm64 hosts only
. I was able to work around it by passing/p:IlcHostArch=x64
.The next error I got was:
The PrivateSdkAssemblies ItemGroup is required for _ComputeAssembliesToCompileToNative
.This property is computed in following way:
runtime/src/coreclr/nativeaot/BuildIntegration/Microsoft.NETCore.Native.targets
Line 110 in 784545d
runtime/src/coreclr/nativeaot/BuildIntegration/Microsoft.NETCore.Native.targets
Line 142 in 784545d
I can see that there is no "sdk" folder in
\artifacts\bin\coreclr\windows.x64.Release\
(after running.\build.cmd -c Release -subset Clr
), but there is an "aotsdk" folder. Also, the test project seems to just get the right path from MSBuild:runtime/src/tests/Directory.Build.targets
Line 521 in 784545d
I've workarounded this problem by just passing the right flag but got stuck few errors later. I gave up assuming that I am trying to open doors that somebody else have already opened.
@MichalStrehovsky @jkotas is there an easy (even hacky) way to get it working?
The text was updated successfully, but these errors were encountered: