Build native aot tests: .\src\tests\build.cmd nativeaot Debug tree nativeaot
This gives errors like:
runtime/artifacts/bin/coreclr/linux.x64.Debug/build/Microsoft.NETCore.Native.Publish.targets(78,5): error : The FrameworkAssemblies ItemGroup is required for _ComputeAssembliesToCompileToNative
This happens because test build script defaults to LibrariesConfiguration=Release, while the product build step above builds Debug libraries. The workaround is easy - pass /p:LibrariesConfiguration=Debug to the test build, or build the product with -lc Release (thanks @AaronRobinsonMSFT).
Build native AOT tests following the documented workflow https://github.com/dotnet/runtime/blob/main/docs/workflow/building/coreclr/nativeaot.md:
.\build.cmd clr.aot+libs -rc Debug
.\src\tests\build.cmd nativeaot Debug tree nativeaot
This gives errors like:
This happens because test build script defaults to
LibrariesConfiguration=Release
, while the product build step above builds Debug libraries. The workaround is easy - pass/p:LibrariesConfiguration=Debug
to the test build, or build the product with-lc Release
(thanks @AaronRobinsonMSFT).This should at least give a better error to indicate what the problem is, like we do in this check: https://github.com/dotnet/runtime/blob/8886107370b1ff15662dd38f3b3a5546188842e7/eng/liveBuilds.targets#L154 The instructions should probably be updated to pass LibrariesConfiguration.