Skip to content

Conversation

@BrzVlad
Copy link
Member

@BrzVlad BrzVlad commented Jan 12, 2026

This is achieved by using already existing properties in the sdk: PublishReadyToRun and PublishReadyToRunComposite. The compositer2r toolchain adds these properties to a standard project template. In order to test with custom built runtime, the toolchain reuses the already existing customruntimepack and aotcompilerpath bdn args.

Example command used locally from microbenchmarks project:

dotnet run -c Release -f net10.0 --runtimes compositer2r10_0 --filter "System.Tests.Perf_Int32.TryFormat" --customruntimepack /home/vbrezae/runtime3/artifacts/bin/microsoft.netcore.app.runtime.linux-arm64/Release/ --aotcompilerpath /home/vbrezae/runtime3/artifacts/packages/Release/Shipping/crossgen2pack/

@BrzVlad BrzVlad force-pushed the feature-composite-r2r branch 2 times, most recently from f203c40 to 2fd5f7f Compare January 15, 2026 17:44
Copy link
Collaborator

@timcassell timcassell left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

There has been user interest in a R2R toolchain (#2514). I think it would be good to make it work for general use, not just custom runtime. Could also make "Composite" an optional setting.

This is achieved by using already existing properties in the sdk: PublishReadyToRun and PublishReadyToRunComposite. The compositer2r toolchain adds these properties to a standar project template. In order to test with custom built runtime, the toolchain reuses the already existing `customruntimepack` and `aotcompilerpath` bdn args.

Example command used locally from microbenchmarks project:

dotnet run -c Release -f net10.0 --runtimes compositer2r10_0 --filter "System.Tests.Perf_Int32.TryFormat" --customruntimepack /home/vbrezae/runtime3/artifacts/bin/microsoft.netcore.app.runtime.linux-arm64/Release/ --aotcompilerpath /home/vbrezae/runtime3/artifacts/packages/Release/Shipping/crossgen2pack/
@BrzVlad BrzVlad force-pushed the feature-composite-r2r branch from 2fd5f7f to 3f4c8e8 Compare January 16, 2026 13:05
@BrzVlad
Copy link
Member Author

BrzVlad commented Jan 16, 2026

There has been user interest in a R2R toolchain (#2514). I think it would be good to make it work for general use, not just custom runtime. Could also make "Composite" an optional setting.

@timcassell I didn't really make it clear, but it actually works already with a normal sdk. If there is no passed custom runtime pack and crossgen2 pack then the TrickRuntimePackLocation target has no effect.

On a separate note, after rebasing to latest main, I tried using the locally built bdn with a sample project. The autogenerated project failed to build with the following error:

/home/vbrezae/.dotnet/sdk/10.0.101/Sdks/Microsoft.NET.Sdk/targets/Microsoft.NET.CrossGen.targets(467,5): error : Unhandled exception. System.CommandLine.CommandLineException: Multiple input files matching same simple name /home/vbrezae/Xamarin/tests/bdn-test/bdn-proj/bin/Release/net10.0/bdn-test-CompositeR2R-1/obj/BenchmarkDotNet.Autogenerated/release_net10.0_linux-arm64/bdn-test-CompositeR2R-1.dll /home/vbrezae/Xamarin/tests/bdn-test/bdn-proj/bin/Release/net10.0/bdn-test-CompositeR2R-1/bin/Release/net10.0/linux-arm64/publish/bdn-test-CompositeR2R-1.dll [/home/vbrezae/Xamarin/tests/bdn-test/bdn-proj/bin/Release/net10.0/bdn-test-CompositeR2R-1/BenchmarkDotNet.Autogenerated.csproj::TargetFramework=net10.0]

This error is triggered by crossgen2 when it receives the same assembly twice as an input. As you can see in the error message, it receives the bdn-test-CompositeR2R-1.dll twice. One usage comes from the obj folder which is suspicious. After a bit of bisecting, turns out that this started happening after 9368a7d. Would you be able to take a look at this ?

@timcassell
Copy link
Collaborator

That sounds like the same issue as #2931 (comment). Thanks for finding the problematic commit. I'll take a look when I get some time.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants