xamarin-macios
xamarin-macios copied to clipboard
Pre-Trimmer custom step host initial steps
Start of https://github.com/dotnet/runtime/issues/107211.
This PR adds a custom step runner that runs custom steps before the trimmer. Though much code will likely be shared between here and android custom step runners, it's planned that each runner will be fully contained in their respective repository to allow for customizations and allow each to separately transition from Cecil to System.Reflection.Metadata if desired.
The tools/PreTrimmer/PreTrimmer/CecilExtensions and tools/PreTrimmer/PreTrimmer/ILLink directories include files copied from ILLink with small modifications to the backing collections and unrelated trimmer-specific code. These files provide the same APIs that are present in the ILLink package for the custom steps.
The output of the custom step host is ILLink XML files that can be passed to the trimmer. Currently, a descriptor file is created to pass along marking and preserved type/method information to the trimmer.
PreserveBlockCodeHandler was the first step copied and modified from a MarkHandler to a regular step that can run outside of MarkStep. All other steps are included in the compilation and build without errors, but do are not tested. The sources required for these steps are also included in the PreTrim project, which required creating the PRETRIM compilation symbol and using #ifdefs in the same place as MTOUCH, MMP, and BUNDLER.
Some unit tests have been created for a basic step that marks all metadata, and some for the PreserveBlockCodeHandler. Integration with ILLink hasn't been created or tested.
This can go cleanly in main right now, but I'm not sure if it makes more sense to create a feature branch instead?
:warning: Your code has been reformatted. :warning:
If this is not desired, add the actions-disable-autoformat label, and revert the reformatting commit.
If files unrelated to your change were modified, try reverting the reformatting commit + merging with the target branch (and push those changes).
:computer: [CI Build] Windows Integration Tests passed :computer:
:white_check_mark: All Windows Integration Tests passed.
Pipeline on Agent Hash: d1f1fcba53985c186182b818d19832224fbd56c9 [PR build]
:computer: [CI Build] Tests on macOS M1 - Mac Monterey (12) passed :computer:
:white_check_mark: All tests on macOS M1 - Mac Monterey (12) passed.
Pipeline on Agent Hash: d1f1fcba53985c186182b818d19832224fbd56c9 [PR build]
:computer: [CI Build] Tests on macOS X64 - Mac Sonoma (14) passed :computer:
:white_check_mark: All tests on macOS X64 - Mac Sonoma (14) passed.
Pipeline on Agent Hash: d1f1fcba53985c186182b818d19832224fbd56c9 [PR build]
:computer: [CI Build] Tests on macOS M1 - Mac Ventura (13) passed :computer:
:white_check_mark: All tests on macOS M1 - Mac Ventura (13) passed.
Pipeline on Agent Hash: d1f1fcba53985c186182b818d19832224fbd56c9 [PR build]
:white_check_mark: API diff for current PR / commit
.NET (No breaking changes)
:white_check_mark: API diff vs stable
.NET (No breaking changes)
:information_source: Generator diff
Generator Diff: vsdrops (html) vsdrops (raw diff) gist (raw diff) - Please review changes)
Pipeline on Agent Hash: d1f1fcba53985c186182b818d19832224fbd56c9 [PR build]
:fire: [CI Build] Test results :fire:
Test results
:x: Tests failed on VSTS: test results
0 tests crashed, 1 tests failed, 100 tests passed.
Failures
:x: dotnettests tests (macOS)
- DotNet tests: Failed (Execution failed with exit code 1)
Html Report (VSDrops) Download
Successes
:white_check_mark: cecil: All 1 tests passed. Html Report (VSDrops) Download :white_check_mark: dotnettests (iOS): All 1 tests passed. Html Report (VSDrops) Download :white_check_mark: dotnettests (MacCatalyst): All 1 tests passed. Html Report (VSDrops) Download :white_check_mark: dotnettests (Multiple platforms): All 1 tests passed. Html Report (VSDrops) Download :white_check_mark: dotnettests (tvOS): All 1 tests passed. Html Report (VSDrops) Download :white_check_mark: framework: All 2 tests passed. Html Report (VSDrops) Download :white_check_mark: fsharp: All 4 tests passed. Html Report (VSDrops) Download :white_check_mark: generator: All 3 tests passed. Html Report (VSDrops) Download :white_check_mark: interdependent-binding-projects: All 4 tests passed. Html Report (VSDrops) Download :white_check_mark: introspection: All 4 tests passed. Html Report (VSDrops) Download :white_check_mark: linker: All 40 tests passed. Html Report (VSDrops) Download :white_check_mark: monotouch (iOS): All 7 tests passed. Html Report (VSDrops) Download :white_check_mark: monotouch (MacCatalyst): All 8 tests passed. Html Report (VSDrops) Download :white_check_mark: monotouch (macOS): All 9 tests passed. Html Report (VSDrops) Download :white_check_mark: monotouch (tvOS): All 7 tests passed. Html Report (VSDrops) Download :white_check_mark: msbuild: All 2 tests passed. Html Report (VSDrops) Download :white_check_mark: xcframework: All 4 tests passed. Html Report (VSDrops) Download :white_check_mark: xtro: All 1 tests passed. Html Report (VSDrops) Download
Pipeline on Agent Hash: d1f1fcba53985c186182b818d19832224fbd56c9 [PR build]
:rocket: [CI Build] Test results :rocket:
Test results
:white_check_mark: All tests passed on VSTS: test results.
:tada: All 101 tests passed :tada:
Tests counts
:white_check_mark: cecil: All 1 tests passed. Html Report (VSDrops) Download :white_check_mark: dotnettests (iOS): All 1 tests passed. Html Report (VSDrops) Download :white_check_mark: dotnettests (MacCatalyst): All 1 tests passed. Html Report (VSDrops) Download :white_check_mark: dotnettests (macOS): All 1 tests passed. [attempt 2] Html Report (VSDrops) Download :white_check_mark: dotnettests (Multiple platforms): All 1 tests passed. Html Report (VSDrops) Download :white_check_mark: dotnettests (tvOS): All 1 tests passed. Html Report (VSDrops) Download :white_check_mark: framework: All 2 tests passed. Html Report (VSDrops) Download :white_check_mark: fsharp: All 4 tests passed. Html Report (VSDrops) Download :white_check_mark: generator: All 3 tests passed. Html Report (VSDrops) Download :white_check_mark: interdependent-binding-projects: All 4 tests passed. Html Report (VSDrops) Download :white_check_mark: introspection: All 4 tests passed. Html Report (VSDrops) Download :white_check_mark: linker: All 40 tests passed. Html Report (VSDrops) Download :white_check_mark: monotouch (iOS): All 7 tests passed. Html Report (VSDrops) Download :white_check_mark: monotouch (MacCatalyst): All 8 tests passed. Html Report (VSDrops) Download :white_check_mark: monotouch (macOS): All 9 tests passed. Html Report (VSDrops) Download :white_check_mark: monotouch (tvOS): All 7 tests passed. Html Report (VSDrops) Download :white_check_mark: msbuild: All 2 tests passed. Html Report (VSDrops) Download :white_check_mark: xcframework: All 4 tests passed. Html Report (VSDrops) Download :white_check_mark: xtro: All 1 tests passed. Html Report (VSDrops) Download
Pipeline on Agent Hash: d1f1fcba53985c186182b818d19832224fbd56c9 [PR build]
Moving this back to a draft until more progress is made and requested changes are addressed
I have an alternative solution in progress here: #22392