Skip to content

[bgen] Route output through IToolLog - #26615

Open
rolfbjarne wants to merge 4 commits into
dev/rolf/remove-bgen-compilationfrom
dev/rolf/route-bgen-through-itoollog-v2
Open

rolfbjarne wants to merge 4 commits into
dev/rolf/remove-bgen-compilationfrom
dev/rolf/route-bgen-through-itoollog-v2

Conversation

@rolfbjarne

@rolfbjarne rolfbjarne commented Sep 15, 2026

Copy link
Copy Markdown
Member

Refactor bgen diagnostics and normal output to use an injected IToolLog while preserving standalone command-line behavior through ConsoleLog.

This adds BindingTouch.Run (string [] args, IToolLog log) for in-process callers. It is preparatory work for adding bgen as an in-process MSBuild task.

Supersedes #26612.

🤖 Pull request created by Copilot

rolfbjarne and others added 2 commits September 15, 2026 19:59
Add an injectable bgen entry point while preserving standalone console behavior, diagnostic formatting, cancellation, and verbosity handling.

Co-authored-by: Copilot App <223556219+Copilot@users.noreply.github.com>
Use the compiled API definition option required after the source compilation removal.

Co-authored-by: Copilot App <223556219+Copilot@users.noreply.github.com>
Copilot AI lite review requested due to automatic review settings September 15, 2026 18:03
Comment thread src/bgen/AttributeManager.cs Outdated
Comment thread tools/common/IToolLog.cs Outdated
Comment thread src/bgen/BindingTouch.cs Outdated
Use a global bundler namespace import, route console errors to stderr, and remove unused cancellation support.

Co-authored-by: Copilot App <223556219+Copilot@users.noreply.github.com>

Copilot AI left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

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

Copilot encountered an error and was unable to review this pull request. You can try again by re-requesting a review.

Note

This error may be related to your runner configuration. You can now configure runners for Copilot code review separately from Copilot cloud agent by creating a copilot-code-review.yml file with your setup steps. Read the docs for details.

Preserve generation-only output validation while routing its diagnostics through IToolLog.

Co-authored-by: Copilot App <223556219+Copilot@users.noreply.github.com>
@vs-mobiletools-engineering-service2

Copy link
Copy Markdown
Collaborator

🔥 [PR Build #429cd74] Build failed (Build macOS tests) 🔥

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

Pipeline on Agent
Hash: 429cd745c281dc79d2175ebac247e4b4d0895d09 [PR build]

@vs-mobiletools-engineering-service2

This comment has been minimized.

@vs-mobiletools-engineering-service2

Copy link
Copy Markdown
Collaborator

🔥 [PR Build #429cd74] Build failed (Detect API changes) 🔥

Build failed for the job 'Detect API changes' (with job status 'Failed')

Pipeline on Agent
Hash: 429cd745c281dc79d2175ebac247e4b4d0895d09 [PR build]

@vs-mobiletools-engineering-service2

This comment has been minimized.

@vs-mobiletools-engineering-service2

This comment has been minimized.

@vs-mobiletools-engineering-service2

Copy link
Copy Markdown
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: 3018821e969365be6efc8ded04e966e04807e167 [PR build]

@vs-mobiletools-engineering-service2

Copy link
Copy Markdown
Collaborator

🔥 [PR Build #429cd74] Build failed (Build packages) 🔥

Build failed for the job 'Build packages' (with job status 'Failed')

Pipeline on Agent
Hash: 429cd745c281dc79d2175ebac247e4b4d0895d09 [PR build]

@vs-mobiletools-engineering-service2

Copy link
Copy Markdown
Collaborator

🔥 [CI Build #429cd74] Test results 🔥

Test results

❌ Tests failed on VSTS: test results

3 tests crashed, 5 tests failed, 244 tests passed.

Failures

❌ generator tests

2 tests failed, 3 tests passed.

Failed tests

  • BGen tests: Failed (Execution failed with exit code 1)
    • GeneratorTests.BGen.ResponseFile(iOS): BGen failed with exit code 1: response file
      System.IO.FileNotFoundException: Could not find file '/Users/cloudtest/vss/_work/1/s...
    • GeneratorTests.BGenTests.PrecompiledApiAssemblyWithoutSources: BGen failed with exit code 1: build
      Microsoft (R) Visual C# Compiler version 5.12.0-1.26461.115 (fb92951eceabe91c5015b35e49acdbc...
    • GeneratorTests.BGenTests.XmlDocs(iOS): Xml docs: If this is expected, set the WRITE_KNOWN_FAILURES=1 environment variable, run the test again, and commit the changes...
    • ... and 23 more
  • Roslyn Transformer tests: BuildFailure

Html Report (VSDrops) Download

❌ monotouch tests (MacCatalyst)

1 tests failed, 24 tests passed.

Failed tests

  • monotouch-test/Mac Catalyst/Debug (CoreCLR): Failed (Test run failed.
    Tests run: 3795 Passed: 3631 Inconclusive: 19 Failed: 1 Ignored: 163)

Html Report (VSDrops) Download

❌ windows tests

1 tests failed, 2 tests passed.

Failed tests

  • BGen tests/GeneratorTests.NomenclatorTests.GetDelegateApiNameMissingAttr: Failed: SetUp : System.ArgumentException : Can not instantiate proxy of class: AttributeManager.

  • BGen tests/GeneratorTests.BGenTests.NativeEnum(iOS): Failed: System.AggregateException : One or more errors occurred. (An error occurred trying to start process 'C:/AzDO/_work/7/s/macios/tests/dotnet/Windows/bin/dotnet/dotnet.exe' with working directory 'C:\AzDO_work\7\s\macios\tests\bgen\bin\Debug\net11.0\tmp-test-dir\Xamarin.Tests.BGenTool.EnsureTempDir121'. The filename or extension is too long.)

  • BGen tests/GeneratorTests.NomenclatorTests.GetGeneratedTypeNameGenericType: Failed: SetUp : System.ArgumentException : Can not instantiate proxy of class: AttributeManager.

  • BGen tests/GeneratorTests.NomenclatorTests.GetTrampolineNameGeneric: Failed: SetUp : System.ArgumentException : Can not instantiate proxy of class: AttributeManager.

  • BGen tests/GeneratorTests.BGenTests.XmlDocs(tvOS): Failed: System.AggregateException : One or more errors occurred. (An error occurred trying to start process 'C:/AzDO/_work/7/s/macios/tests/dotnet/Windows/bin/dotnet/dotnet.exe' with working directory 'C:\AzDO_work\7\s\macios\tests\bgen\bin\Debug\net11.0\tmp-test-dir\Xamarin.Tests.BGenTool.EnsureTempDir180'. The filename or extension is too long.)

  • BGen tests/GeneratorTests.BGenTests.SimulatorAvailabilityAttributes_NotEmittedForMacPlatforms(MacCatalyst): Failed: System.AggregateException : One or more errors occurred. (An error occurred trying to start process 'C:/AzDO/_work/7/s/macios/tests/dotnet/Windows/bin/dotnet/dotnet.exe' with working directory 'C:\AzDO_work\7\s\macios\tests\bgen\bin\Debug\net11.0\tmp-test-dir\Xamarin.Tests.BGenTool.EnsureTempDir163'. The filename or extension is too long.)

  • BGen tests/GeneratorTests.NomenclatorTests.GetDelegateApiName: Failed: SetUp : System.ArgumentException : Can not instantiate proxy of class: AttributeManager.

  • BGen tests/GeneratorTests.NomenclatorTests.GetDelegateNameEventArgsTest("AnimationDidReachProgressMark"): Failed: SetUp : System.ArgumentException : Can not instantiate proxy of class: AttributeManager.

  • BGen tests/GeneratorTests.BGenTests.BackingFieldType(MacCatalyst): Failed: System.AggregateException : One or more errors occurred. (An error occurred trying to start process 'C:/AzDO/_work/7/s/macios/tests/dotnet/Windows/bin/dotnet/dotnet.exe' with working directory 'C:\AzDO_work\7\s\macios\tests\bgen\bin\Debug\net11.0\tmp-test-dir\Xamarin.Tests.BGenTool.EnsureTempDir11'. The filename or extension is too long.)

  • BGen tests/GeneratorTests.BGenTests.PreviewAPIs(iOS): Failed: System.AggregateException : One or more errors occurred. (An error occurred trying to start process 'C:/AzDO/_work/7/s/macios/tests/dotnet/Windows/bin/dotnet/dotnet.exe' with working directory 'C:\AzDO_work\7\s\macios\tests\bgen\bin\Debug\net11.0\tmp-test-dir\Xamarin.Tests.BGenTool.EnsureTempDir142'. The filename or extension is too long.)

  • BGen tests/GeneratorTests.BGenTests.PreviewAPIs(macOSMobile): Failed: System.AggregateException : One or more errors occurred. (An error occurred trying to start process 'C:/AzDO/_work/7/s/macios/tests/dotnet/Windows/bin/dotnet/dotnet.exe' with working directory 'C:\AzDO_work\7\s\macios\tests\bgen\bin\Debug\net11.0\tmp-test-dir\Xamarin.Tests.BGenTool.EnsureTempDir141'. The filename or extension is too long.)

  • BGen tests/GeneratorTests.BGenTests.BackingFieldType(iOS): Failed: System.AggregateException : One or more errors occurred. (An error occurred trying to start process 'C:/AzDO/_work/7/s/macios/tests/dotnet/Windows/bin/dotnet/dotnet.exe' with working directory 'C:\AzDO_work\7\s\macios\tests\bgen\bin\Debug\net11.0\tmp-test-dir\Xamarin.Tests.BGenTool.EnsureTempDir12'. The filename or extension is too long.)

  • BGen tests/GeneratorTests.BGenTests.PreviewAPIs(tvOS): Failed: System.AggregateException : One or more errors occurred. (An error occurred trying to start process 'C:/AzDO/_work/7/s/macios/tests/dotnet/Windows/bin/dotnet/dotnet.exe' with working directory 'C:\AzDO_work\7\s\macios\tests\bgen\bin\Debug\net11.0\tmp-test-dir\Xamarin.Tests.BGenTool.EnsureTempDir143'. The filename or extension is too long.)

  • BGen tests/GeneratorTests.NomenclatorTests.GetEventArgsFullName: Failed: SetUp : System.ArgumentException : Can not instantiate proxy of class: AttributeManager.

  • BGen tests/GeneratorTests.BGenTests.SimulatorAvailabilityAttributes(tvOS): Failed: System.AggregateException : One or more errors occurred. (An error occurred trying to start process 'C:/AzDO/_work/7/s/macios/tests/dotnet/Windows/bin/dotnet/dotnet.exe' with working directory 'C:\AzDO_work\7\s\macios\tests\bgen\bin\Debug\net11.0\tmp-test-dir\Xamarin.Tests.BGenTool.EnsureTempDir161'. The filename or extension is too long.)

  • BGen tests/GeneratorTests.ProtocolTests.Members(MacCatalyst): Failed: System.AggregateException : One or more errors occurred. (An error occurred trying to start process 'C:/AzDO/_work/7/s/macios/tests/dotnet/Windows/bin/dotnet/dotnet.exe' with working directory 'C:\AzDO_work\7\s\macios\tests\bgen\bin\Debug\net11.0\tmp-test-dir\Xamarin.Tests.BGenTool.EnsureTempDir13'. The filename or extension is too long.)

  • BGen tests/GeneratorTests.BGen.ResponseFile(iOS): Failed: BGen failed with exit code 1: response file

  • BGen tests/GeneratorTests.NomenclatorTests.GetEventArgsSkipGeneration: Failed: SetUp : System.ArgumentException : Can not instantiate proxy of class: AttributeManager.

  • BGen tests/GeneratorTests.ProtocolTests.Members(iOS): Failed: System.AggregateException : One or more errors occurred. (An error occurred trying to start process 'C:/AzDO/_work/7/s/macios/tests/dotnet/Windows/bin/dotnet/dotnet.exe' with working directory 'C:\AzDO_work\7\s\macios\tests\bgen\bin\Debug\net11.0\tmp-test-dir\Xamarin.Tests.BGenTool.EnsureTempDir14'. The filename or extension is too long.)

  • BGen tests/GeneratorTests.BGenTests.Bug29493: Failed: System.AggregateException : One or more errors occurred. (An error occurred trying to start process 'C:/AzDO/_work/7/s/macios/tests/dotnet/Windows/bin/dotnet/dotnet.exe' with working directory 'C:\AzDO_work\7\s\macios\tests\bgen\bin\Debug\net11.0\tmp-test-dir\Xamarin.Tests.BGenTool.EnsureTempDir31'. The filename or extension is too long.)

  • BGen tests/GeneratorTests.NomenclatorTests.GetDelegateNameNoEventArgsTest("ComputeAnimationCurve"): Failed: SetUp : System.ArgumentException : Can not instantiate proxy of class: AttributeManager.

  • BGen tests/GeneratorTests.BGenTests.SimulatorAvailabilityAttributes_NotEmittedForMacPlatforms(macOSMobile): Failed: System.AggregateException : One or more errors occurred. (An error occurred trying to start process 'C:/AzDO/_work/7/s/macios/tests/dotnet/Windows/bin/dotnet/dotnet.exe' with working directory 'C:\AzDO_work\7\s\macios\tests\bgen\bin\Debug\net11.0\tmp-test-dir\Xamarin.Tests.BGenTool.EnsureTempDir162'. The filename or extension is too long.)

  • BGen tests/GeneratorTests.BGenTests.XmlDocs(iOS): Failed: System.AggregateException : One or more errors occurred. (An error occurred trying to start process 'C:/AzDO/_work/7/s/macios/tests/dotnet/Windows/bin/dotnet/dotnet.exe' with working directory 'C:\AzDO_work\7\s\macios\tests\bgen\bin\Debug\net11.0\tmp-test-dir\Xamarin.Tests.BGenTool.EnsureTempDir177'. The filename or extension is too long.)

  • BGen tests/GeneratorTests.BGenTests.SimulatorAvailabilityAttributes(iOS): Failed: System.AggregateException : One or more errors occurred. (An error occurred trying to start process 'C:/AzDO/_work/7/s/macios/tests/dotnet/Windows/bin/dotnet/dotnet.exe' with working directory 'C:\AzDO_work\7\s\macios\tests\bgen\bin\Debug\net11.0\tmp-test-dir\Xamarin.Tests.BGenTool.EnsureTempDir160'. The filename or extension is too long.)

  • BGen tests/GeneratorTests.NomenclatorTests.GetDelegateApiNameDuplicate: Failed: SetUp : System.ArgumentException : Can not instantiate proxy of class: AttributeManager.

  • BGen tests/GeneratorTests.NomenclatorTests.GetDelegateNameEventThrows: Failed: SetUp : System.ArgumentException : Can not instantiate proxy of class: AttributeManager.

  • BGen tests/GeneratorTests.NomenclatorTests.GetGeneratedTypeNameType: Failed: SetUp : System.ArgumentException : Can not instantiate proxy of class: AttributeManager.

  • BGen tests/GeneratorTests.NomenclatorTests.GetEventArgsSkipGenerationEndWithEventArgs: Failed: SetUp : System.ArgumentException : Can not instantiate proxy of class: AttributeManager.

  • BGen tests/GeneratorTests.BGenTests.StackOverflow20696157: Failed: System.AggregateException : One or more errors occurred. (An error occurred trying to start process 'C:/AzDO/_work/7/s/macios/tests/dotnet/Windows/bin/dotnet/dotnet.exe' with working directory 'C:\AzDO_work\7\s\macios\tests\bgen\bin\Debug\net11.0\tmp-test-dir\Xamarin.Tests.BGenTool.EnsureTempDir168'. The filename or extension is too long.)

  • BGen tests/GeneratorTests.NomenclatorTests.GetEventNameNoAttribute: Failed: SetUp : System.ArgumentException : Can not instantiate proxy of class: AttributeManager.

  • BGen tests/GeneratorTests.BGenTests.PreviewAPIs(MacCatalyst): Failed: System.AggregateException : One or more errors occurred. (An error occurred trying to start process 'C:/AzDO/_work/7/s/macios/tests/dotnet/Windows/bin/dotnet/dotnet.exe' with working directory 'C:\AzDO_work\7\s\macios\tests\bgen\bin\Debug\net11.0\tmp-test-dir\Xamarin.Tests.BGenTool.EnsureTempDir140'. The filename or extension is too long.)

  • BGen tests/GeneratorTests.NomenclatorTests.GetEnventNameAttribute: Failed: SetUp : System.ArgumentException : Can not instantiate proxy of class: AttributeManager.

  • BGen tests/GeneratorTests.BGenTests.XmlDocs(MacCatalyst): Failed: System.AggregateException : One or more errors occurred. (An error occurred trying to start process 'C:/AzDO/_work/7/s/macios/tests/dotnet/Windows/bin/dotnet/dotnet.exe' with working directory 'C:\AzDO_work\7\s\macios\tests\bgen\bin\Debug\net11.0\tmp-test-dir\Xamarin.Tests.BGenTool.EnsureTempDir178'. The filename or extension is too long.)

  • BGen tests/GeneratorTests.BGenTests.PrecompiledApiAssemblyWithoutSources: Failed: BGen failed with exit code 1: build

  • BGen tests/GeneratorTests.BGenTests.FieldEnumTests(iOS): Failed: System.AggregateException : One or more errors occurred. (An error occurred trying to start process 'C:/AzDO/_work/7/s/macios/tests/dotnet/Windows/bin/dotnet/dotnet.exe' with working directory 'C:\AzDO_work\7\s\macios\tests\bgen\bin\Debug\net11.0\tmp-test-dir\Xamarin.Tests.BGenTool.EnsureTempDir81'. The filename or extension is too long.)

  • BGen tests/GeneratorTests.NomenclatorTests.GetEventArgsNameSeveralParamsNoAttr: Failed: SetUp : System.ArgumentException : Can not instantiate proxy of class: AttributeManager.

  • BGen tests/GeneratorTests.BGenTests.XmlDocs(macOSMobile): Failed: System.AggregateException : One or more errors occurred. (An error occurred trying to start process 'C:/AzDO/_work/7/s/macios/tests/dotnet/Windows/bin/dotnet/dotnet.exe' with working directory 'C:\AzDO_work\7\s\macios\tests\bgen\bin\Debug\net11.0\tmp-test-dir\Xamarin.Tests.BGenTool.EnsureTempDir179'. The filename or extension is too long.)

  • BGen tests/GeneratorTests.NomenclatorTests.GetGeneratedTypeNameBindAttribute: Failed: SetUp : System.ArgumentException : Can not instantiate proxy of class: AttributeManager.

  • BGen tests/GeneratorTests.NomenclatorTests.GetEventArgNameSingleParamTest: Failed: SetUp : System.ArgumentException : Can not instantiate proxy of class: AttributeManager.

  • BGen tests/GeneratorTests.NomenclatorTests.GetTrampolineNameNotGeneric: Failed: SetUp : System.ArgumentException : Can not instantiate proxy of class: AttributeManager.

Html Report (VSDrops) Download

❌ xtro tests

1 tests failed, 0 tests passed.

Failed tests

  • Xtro: Failed (Execution failed with exit code 1)
    • Xamarin.Tests.Xtro.RunTest: ExitCode
      Assert.That(rv, Is.EqualTo (0))
      Expected: 0
      But was: 2

Html Report (VSDrops) Download

❌ Tests on macOS Sonoma (14) tests

⚠️ Tests did not run because the Build macOS tests job failed.

Html Report (VSDrops) Download

❌ Tests on macOS Sequoia (15) tests

⚠️ Tests did not run because the Build macOS tests job failed.

Html Report (VSDrops) Download

❌ Tests on macOS Tahoe (26) tests

⚠️ Tests did not run because the Build macOS tests job failed.

Html Report (VSDrops) Download

Successes

✅ assembly-processing: All 1 tests passed. Html Report (VSDrops) Download
✅ cecil: All 1 tests passed. Html Report (VSDrops) Download
✅ dotnettests (iOS): All 1 tests passed. Html Report (VSDrops) Download
✅ dotnettests (MacCatalyst): All 1 tests passed. Html Report (VSDrops) Download
✅ dotnettests (macOS): All 1 tests passed. Html Report (VSDrops) Download
✅ dotnettests (Multiple platforms): All 1 tests passed. Html Report (VSDrops) Download
✅ dotnettests (tvOS): All 1 tests passed. Html Report (VSDrops) Download
✅ framework: All 2 tests passed. Html Report (VSDrops) Download
✅ fsharp: All 4 tests passed. Html Report (VSDrops) Download
✅ interdependent-binding-projects: All 4 tests passed. Html Report (VSDrops) Download
✅ introspection: All 7 tests passed. Html Report (VSDrops) Download
✅ linker (iOS): All 31 tests passed. Html Report (VSDrops) Download
✅ linker (MacCatalyst): All 31 tests passed. Html Report (VSDrops) Download
✅ linker (macOS): All 21 tests passed. Html Report (VSDrops) Download
✅ linker (tvOS): All 31 tests passed. Html Report (VSDrops) Download
✅ monotouch (iOS): All 25 tests passed. Html Report (VSDrops) Download
✅ monotouch (macOS): All 20 tests passed. Html Report (VSDrops) Download
✅ monotouch (tvOS): All 25 tests passed. Html Report (VSDrops) Download
✅ msbuild: All 2 tests passed. Html Report (VSDrops) Download
✅ sharpie: All 1 tests passed. Html Report (VSDrops) Download
✅ xcframework: All 4 tests passed. Html Report (VSDrops) Download

macOS tests

Linux Build Verification

Linux build succeeded

Pipeline on Agent
Hash: 429cd745c281dc79d2175ebac247e4b4d0895d09 [PR build]

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

Labels

Projects

None yet

Development

Successfully merging this pull request may close these issues.

3 participants