dotnet / runtime

.NET is a cross-platform runtime for cloud, mobile, desktop, and IoT apps.
https://docs.microsoft.com/dotnet/core/
MIT License
14.55k stars 4.54k forks source link

[mono][aot] Write a tool to collect mono-aot-cross inputs and rsp files from an msbuild binlog #103136

Open lambdageek opened 4 weeks ago

lambdageek commented 4 weeks ago

It would be nice if mono-aot-cross had a companion tool like complog that could collect all AOT compiler invocations from a particular build and zip them up for easy issue repros.

Use case:


Complications:

  1. mono-aot-cross needs not only assemblies that are direct inputs but also the contents of all directories specified in a MONO_PATH environment variable
  2. Mono AOT compiler has arguments for specifying toolchains, binaries for assemblers/native linkers/etc. We might need to capture those too, to get a fully reproducible build environment.
lambdageek commented 4 weeks ago

another idea is that instead of having a separate tool that parses the command line arguments and decides what to capture, we could actually have a flag/environment variable that tells mono-aot-cross to write its own inputs/dependencies/flags to a file. Perhaps even in the compile_commands.json format format - then the binlog parsing tool can find those compile command fragments and stitch them together and pick up the input files / tools / etc