Skip to content

Conversation

@rolfbjarne
Copy link
Member

@rolfbjarne rolfbjarne commented Mar 13, 2025

[assembly-preparer] Create a new tool to eventually replace custom linker steps.

🚧 Very early draft, no reviewing necessary 🚧

Create an 'assembly-preparer' tool which will do what the existing custom linker
steps will do, and add all the scaffolding around it:

  • Add a new _PrepareAssembly target and a PrepareAssemblies task that calls the
    new tool.
  • Add a unit test project, which is able to run tests directly using the new tool
    (and not necessarily through the new MSBuild target/task, to speed up execution
    and make debugging much easier).
  • Add the new unit test project to xharness [PENDING].
  • Make the new tool do one thing the custom linker steps currently do: preserve
    block code handlers. Add corresponding tests as well.
  • Add an opt-in .NET unit test to check the speed of using (and not using) our
    new assembly preparing logic. Currently the monotouch-test project is slightly
    faster (which doesn't make much sense, but 🤷), and the MySimpleApp is ever so
    slightly slower.

@github-actions
Copy link
Contributor

⚠️ Your code has been reformatted. ⚠️

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).

@vs-mobiletools-engineering-service2

This comment has been minimized.

@vs-mobiletools-engineering-service2

This comment has been minimized.

@vs-mobiletools-engineering-service2

This comment has been minimized.

@vs-mobiletools-engineering-service2

This comment has been minimized.

@vs-mobiletools-engineering-service2

This comment has been minimized.

@vs-mobiletools-engineering-service2

This comment has been minimized.

@vs-mobiletools-engineering-service2

This comment has been minimized.

@vs-mobiletools-engineering-service2

This comment has been minimized.

@vs-mobiletools-engineering-service2

This comment has been minimized.

@vs-mobiletools-engineering-service2

This comment has been minimized.

@vs-mobiletools-engineering-service2

This comment has been minimized.

@vs-mobiletools-engineering-service2

This comment has been minimized.

@github-actions
Copy link
Contributor

⚠️ Your code has been reformatted. ⚠️

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).

@vs-mobiletools-engineering-service2

This comment has been minimized.

@vs-mobiletools-engineering-service2

This comment has been minimized.

@vs-mobiletools-engineering-service2

This comment has been minimized.

@vs-mobiletools-engineering-service2

This comment has been minimized.

@vs-mobiletools-engineering-service2

This comment has been minimized.

@vs-mobiletools-engineering-service2

This comment has been minimized.

@vs-mobiletools-engineering-service2

This comment has been minimized.

@vs-mobiletools-engineering-service2

This comment has been minimized.

@vs-mobiletools-engineering-service2

This comment has been minimized.

@vs-mobiletools-engineering-service2

This comment has been minimized.

@vs-mobiletools-engineering-service2

This comment has been minimized.

@vs-mobiletools-engineering-service2

This comment has been minimized.

@vs-mobiletools-engineering-service2

This comment has been minimized.

@vs-mobiletools-engineering-service2

This comment has been minimized.

@vs-mobiletools-engineering-service2

This comment has been minimized.

@vs-mobiletools-engineering-service2

This comment has been minimized.

@rolfbjarne rolfbjarne force-pushed the dev/rolf/assembly-preparer branch from d857ef1 to 71e3557 Compare January 21, 2026 11:18
@vs-mobiletools-engineering-service2

This comment has been minimized.

@vs-mobiletools-engineering-service2

This comment has been minimized.

@vs-mobiletools-engineering-service2

This comment has been minimized.

@vs-mobiletools-engineering-service2

This comment has been minimized.

@vs-mobiletools-engineering-service2

This comment has been minimized.

@vs-mobiletools-engineering-service2

This comment has been minimized.

* Enable nullability.
* Remove legacy Xamarin code.
* Misc improvements / simplifications.
* Enable nullability.
* Remove dead code.
* Enable nullability.
* Remove dead code.
* We only support 64-bit architectures now.
* We don't have any code paths conditions on IntPtr.Size, so the size benefits
  for the optimizations are slim to non-existent (it's used in a few
  mathematical expressions, pointer arithmetic, etc., nothing that affects
  final app size if IntPtr.Size gets inlinsed).
…nker steps.

🚧 Very early draft, no reviewing necessary 🚧

Create an 'assembly-preparer' tool which will do what the existing custom linker
steps will do, and add all the scaffolding around it:

* Add a new _PrepareAssembly target and a PrepareAssemblies task that calls the
  new tool.
* Add a unit test project, which is able to run tests directly using the new tool
  (and not necessarily through the new MSBuild target/task, to speed up execution
  and make debugging *much* easier).
* Add the new unit test project to xharness [PENDING].
* Make the new tool do one thing the custom linker steps currently do: preserve
  block code handlers. Add corresponding tests as well.
* Add an opt-in .NET unit test to check the speed of using (and not using) our
  new assembly preparing logic. Currently the monotouch-test project is slightly
  faster (which doesn't make much sense, but 🤷), and the MySimpleApp is ever so
  slightly slower.
This reverts commit 33a2def.

needs CoreTypeMap step first.
@rolfbjarne rolfbjarne force-pushed the dev/rolf/assembly-preparer branch from 5455fca to 6d60ecc Compare January 23, 2026 16:07
@vs-mobiletools-engineering-service2
Copy link
Collaborator

✅ [CI Build #6d60ecc] Build passed (Build packages) ✅

Pipeline on Agent
Hash: 6d60ecc404cec560902e5838421a2822ee5e97d7 [PR build]

@vs-mobiletools-engineering-service2
Copy link
Collaborator

✅ [PR Build #6d60ecc] Build passed (Detect API changes) ✅

Pipeline on Agent
Hash: 6d60ecc404cec560902e5838421a2822ee5e97d7 [PR build]

@vs-mobiletools-engineering-service2
Copy link
Collaborator

✅ API diff for current PR / commit

NET (empty diffs)

✅ API diff vs stable

NET (empty diffs)

ℹ️ Generator diff

Generator Diff: vsdrops (html) vsdrops (raw diff) gist (raw diff) - Please review changes)

Pipeline on Agent
Hash: 6d60ecc404cec560902e5838421a2822ee5e97d7 [PR build]

@vs-mobiletools-engineering-service2
Copy link
Collaborator

🔥 [CI Build #6d60ecc] Build failed (Build macOS tests) 🔥

Build failed for the job 'Build macOS tests' (with job status 'Failed')

Pipeline on Agent
Hash: 6d60ecc404cec560902e5838421a2822ee5e97d7 [PR build]

@vs-mobiletools-engineering-service2
Copy link
Collaborator

🔥 [CI Build #6d60ecc] Test results 🔥

Test results

❌ Tests failed on VSTS: test results

0 tests crashed, 85 tests failed, 61 tests passed.

Failures

❌ dotnettests tests (iOS)

1 tests failed, 0 tests passed.

Failed tests

  • DotNet tests: Failed (Execution failed with exit code 1)
    • Xamarin.Tests.AppIconTest.AlternateAppIcon(iOS,"ios-arm64"): 'dotnet build' failed with exit code 1
      Full command: /Users/builder/azdo/_work/1/s/macios/builds/downloads/dotnet-sdk-10.0.103-s...
    • Xamarin.Tests.AppIconTest.AlternateAppIcons(iOS,"ios-arm64"): 'dotnet build' failed with exit code 1
      Full command: /Users/builder/azdo/_work/1/s/macios/builds/downloads/dotnet-sdk-10.0.103-s...
    • Xamarin.Tests.AppIconTest.AppIcon_1(iOS,"ios-arm64"): 'dotnet build' failed with exit code 1
      Full command: /Users/builder/azdo/_work/1/s/macios/builds/downloads/dotnet-sdk-10.0.103-s...
    • ... and 58 more

Html Report (VSDrops) Download

❌ dotnettests tests (MacCatalyst)

1 tests failed, 0 tests passed.

Failed tests

  • DotNet tests: Failed (Execution failed with exit code 1)
    • Xamarin.Tests.AppIconTest.AlternateAppIcon(MacCatalyst,"maccatal...: 'dotnet build' failed with exit code 1
      Full command: /Users/builder/azdo/_work/1/s/macios/builds/downloads/dotnet-sdk-10.0.103-s...
    • Xamarin.Tests.AppIconTest.AlternateAppIcons(MacCatalyst,"maccata...: 'dotnet build' failed with exit code 1
      Full command: /Users/builder/azdo/_work/1/s/macios/builds/downloads/dotnet-sdk-10.0.103-s...
    • Xamarin.Tests.AppIconTest.AppIcon_1(MacCatalyst,"maccatalyst-arm...: 'dotnet build' failed with exit code 1
      Full command: /Users/builder/azdo/_work/1/s/macios/builds/downloads/dotnet-sdk-10.0.103-s...
    • ... and 47 more

Html Report (VSDrops) Download

❌ dotnettests tests (macOS)

1 tests failed, 0 tests passed.

Failed tests

  • DotNet tests: Failed (Execution failed with exit code 1)
    • Xamarin.Tests.DotNetProjectTest.BuildAndExecuteAppWithNativeDyna...: 'dotnet build' failed with exit code 1
      Full command: /Users/builder/azdo/_work/1/s/macios/builds/downloads/dotnet-sdk-10.0.103-s...
    • Xamarin.Tests.DotNetProjectTest.BuildProjectsWithExtensions(MacO...: 'dotnet build' failed with exit code 1
      Full command: /Users/builder/azdo/_work/1/s/macios/builds/downloads/dotnet-sdk-10.0.103-s...
    • Xamarin.Tests.DotNetProjectTest.BuildProjectsWithExtensions(MacO...: 'dotnet build' failed with exit code 1
      Full command: /Users/builder/azdo/_work/1/s/macios/builds/downloads/dotnet-sdk-10.0.103-s...
    • ... and 15 more

Html Report (VSDrops) Download

❌ dotnettests tests (Multiple platforms)

1 tests failed, 0 tests passed.

Failed tests

  • DotNet tests: Failed (Execution failed with exit code 1)
    • Xamarin.Tests.DotNetProjectTest.AppWithGenericLibraryReference(i...: 'dotnet build' failed with exit code 1
      Full command: /Users/builder/azdo/_work/2/s/macios/builds/downloads/dotnet-sdk-10.0.103-s...

Html Report (VSDrops) Download

❌ dotnettests tests (tvOS)

1 tests failed, 0 tests passed.

Failed tests

  • DotNet tests: Failed (Execution failed with exit code 1)
    • Xamarin.Tests.AppIconTest.AlternateAppIcon(TVOS,"tvos-arm64"): 'dotnet build' failed with exit code 1
      Full command: /Users/builder/azdo/_work/1/s/macios/builds/downloads/dotnet-sdk-10.0.103-s...
    • Xamarin.Tests.AppIconTest.AlternateAppIcons(TVOS,"tvos-arm64"): 'dotnet build' failed with exit code 1
      Full command: /Users/builder/azdo/_work/1/s/macios/builds/downloads/dotnet-sdk-10.0.103-s...
    • Xamarin.Tests.AppIconTest.AppIcon_1(TVOS,"tvos-arm64"): 'dotnet build' failed with exit code 1
      Full command: /Users/builder/azdo/_work/1/s/macios/builds/downloads/dotnet-sdk-10.0.103-s...
    • ... and 34 more

Html Report (VSDrops) Download

❌ fsharp tests

1 tests failed, 3 tests passed.

Failed tests

  • fsharp/tvOS - simulator/Debug: Crashed

Html Report (VSDrops) Download

❌ interdependent-binding-projects tests

1 tests failed, 3 tests passed.

Failed tests

  • interdependent-binding-projects/tvOS - simulator/Debug: Crashed

Html Report (VSDrops) Download

❌ linker tests

52 tests failed, 16 tests passed.

Failed tests

  • dont link/macOS/Debug (PrepareAssemblies): BuildFailure
  • dont link/macOS/Release (PrepareAssemblies): BuildFailure
  • dont link/Mac Catalyst/Debug (PrepareAssemblies): BuildFailure
  • dont link/Mac Catalyst/Release (PrepareAssemblies): BuildFailure
  • dont link/iOS - simulator/Debug (PrepareAssemblies): BuildFailure
  • dont link/iOS - simulator/Release (PrepareAssemblies): BuildFailure
  • dont link/tvOS - simulator/Debug (PrepareAssemblies): BuildFailure
  • dont link/tvOS - simulator/Release (PrepareAssemblies): BuildFailure
  • link sdk/macOS/Debug: BuildFailure
  • link sdk/macOS/Debug (PrepareAssemblies): BuildFailure
  • link sdk/macOS/Release: BuildFailure
  • link sdk/macOS/Release (PrepareAssemblies): BuildFailure
  • link sdk/Mac Catalyst/Debug: BuildFailure
  • link sdk/Mac Catalyst/Debug (PrepareAssemblies): BuildFailure
  • link sdk/Mac Catalyst/Release: BuildFailure
  • link sdk/Mac Catalyst/Release (PrepareAssemblies): BuildFailure
  • link sdk/iOS - simulator/Debug: BuildFailure
  • link sdk/iOS - simulator/Release: BuildFailure
  • link sdk/iOS - simulator/Debug (PrepareAssemblies): BuildFailure
  • link sdk/iOS - simulator/Release (PrepareAssemblies): BuildFailure
  • link sdk/tvOS - simulator/Debug: BuildFailure
  • link sdk/tvOS - simulator/Release: BuildFailure
  • link sdk/tvOS - simulator/Debug (PrepareAssemblies): BuildFailure
  • link sdk/tvOS - simulator/Release (PrepareAssemblies): BuildFailure
  • link all/macOS/Debug: BuildFailure
  • link all/macOS/Debug (don't bundle original resources): BuildFailure
  • link all/macOS/Debug (PrepareAssemblies): BuildFailure
  • link all/macOS/Release: BuildFailure ( (failed to parse the logs: The Writer is closed or in error state.))
  • link all/macOS/Release (PrepareAssemblies): BuildFailure
  • link all/Mac Catalyst/Debug: BuildFailure ( (failed to parse the logs: The Writer is closed or in error state.))
  • link all/Mac Catalyst/Debug (don't bundle original resources): BuildFailure
  • link all/Mac Catalyst/Debug (PrepareAssemblies): BuildFailure
  • link all/Mac Catalyst/Release: BuildFailure
  • link all/Mac Catalyst/Release (PrepareAssemblies): BuildFailure
  • link all/iOS - simulator/Debug: BuildFailure
  • link all/iOS - simulator/Release: BuildFailure
  • link all/iOS - simulator/Debug (don't bundle original resources): BuildFailure
  • link all/iOS - simulator/Debug (PrepareAssemblies): BuildFailure
  • link all/iOS - simulator/Release (PrepareAssemblies): BuildFailure
  • link all/tvOS - simulator/Debug: BuildFailure
  • link all/tvOS - simulator/Release: BuildFailure
  • link all/tvOS - simulator/Debug (don't bundle original resources): BuildFailure
  • link all/tvOS - simulator/Debug (PrepareAssemblies): BuildFailure
  • link all/tvOS - simulator/Release (PrepareAssemblies): BuildFailure
  • trimmode link/macOS/Debug: BuildFailure
  • trimmode link/macOS/Release: BuildFailure
  • trimmode link/Mac Catalyst/Debug: BuildFailure
  • trimmode link/Mac Catalyst/Release: BuildFailure
  • trimmode link/iOS - simulator/Debug: BuildFailure
  • trimmode link/iOS - simulator/Release: BuildFailure
  • trimmode link/tvOS - simulator/Debug: BuildFailure
  • trimmode link/tvOS - simulator/Release: BuildFailure

Html Report (VSDrops) Download

❌ monotouch tests (iOS)

5 tests failed, 5 tests passed.

Failed tests

  • monotouch-test/iOS - simulator/Debug (PrepareAssemblies): BuildFailure
  • monotouch-test/iOS - simulator/Debug (LinkSdk): BuildFailure
  • monotouch-test/iOS - simulator/Release (all optimizations): BuildFailure
  • monotouch-test/iOS - simulator/Release (managed static registrar, all optimizations): BuildFailure
  • monotouch-test/iOS - simulator/Release (NativeAOT, x64): BuildFailure

Html Report (VSDrops) Download

❌ monotouch tests (MacCatalyst)

8 tests failed, 4 tests passed.

Failed tests

  • monotouch-test/Mac Catalyst/Debug (PrepareAssemblies): BuildFailure
  • monotouch-test/Mac Catalyst/Release (managed static registrar): BuildFailure
  • monotouch-test/Mac Catalyst/Release (managed static registrar, all optimizations): BuildFailure ( (failed to parse the logs: The Writer is closed or in error state.))
  • monotouch-test/Mac Catalyst/Release (NativeAOT): BuildFailure
  • monotouch-test/Mac Catalyst/Release (NativeAOT, x64): BuildFailure
  • monotouch-test/Mac Catalyst/Release (static registrar): BuildFailure
  • monotouch-test/Mac Catalyst/Release (static registrar, all optimizations): BuildFailure
  • monotouch-test/Mac Catalyst/Release (interpreter): BuildFailure

Html Report (VSDrops) Download

❌ monotouch tests (macOS)

4 tests failed, 9 tests passed.

Failed tests

  • monotouch-test/macOS/Debug (PrepareAssemblies): BuildFailure
  • monotouch-test/macOS/Release (NativeAOT): BuildFailure
  • monotouch-test/macOS/Release (NativeAOT, ARM64): BuildFailure ( (failed to parse the logs: The Writer is closed or in error state.))
  • monotouch-test/macOS/Release (NativeAOT, x64): BuildFailure

Html Report (VSDrops) Download

❌ monotouch tests (tvOS)

5 tests failed, 5 tests passed.

Failed tests

  • monotouch-test/tvOS - simulator/Debug (PrepareAssemblies): BuildFailure
  • monotouch-test/tvOS - simulator/Debug (LinkSdk): BuildFailure
  • monotouch-test/tvOS - simulator/Release (all optimizations): BuildFailure
  • monotouch-test/tvOS - simulator/Release (managed static registrar, all optimizations): BuildFailure
  • monotouch-test/tvOS - simulator/Release (NativeAOT, x64): BuildFailure

Html Report (VSDrops) Download

❌ windows tests

1 tests failed, 0 tests passed.
Details # 🎉 All 3 tests passed 🎉

Html Report (VSDrops) Download

❌ xcframework tests

3 tests failed, 1 tests passed.

Failed tests

  • xcframework-test/Mac Catalyst/Debug: BuildFailure
  • xcframework-test/iOS - simulator/Debug: BuildFailure
  • xcframework-test/tvOS - simulator/Debug: BuildFailure ( (failed to parse the logs: The Writer is closed or in error state.))

Html Report (VSDrops) Download

Successes

✅ cecil: All 1 tests passed. Html Report (VSDrops) Download
✅ framework: All 2 tests passed. Html Report (VSDrops) Download
✅ generator: All 5 tests passed. Html Report (VSDrops) Download
✅ introspection: All 4 tests passed. Html Report (VSDrops) Download
✅ msbuild: All 2 tests passed. Html Report (VSDrops) Download
✅ xtro: All 1 tests passed. Html Report (VSDrops) Download

Pipeline on Agent
Hash: 6d60ecc404cec560902e5838421a2822ee5e97d7 [PR build]

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.

3 participants