xamarin-macios icon indicating copy to clipboard operation
xamarin-macios copied to clipboard

[BGen] Update BGen solution to use latest C# version, Replaced Append calls with AppendFormat

Open dustin-wojciechowski opened this issue 1 year ago • 18 comments

This PR updates BGen to latest C# version.

After updating, and opening the BGen solution and updating the target framework, I received this error message:

Argument is 'ref' while parameter is declared as 'value' (in 'System.Text.StringBuilder.AppendInterpolatedStringHandler.AppendInterpolatedStringHandler(int, int, StringBuilder)' constructor call)

This appears related to how string interpolation by stringbuilder changed with C#10 and NET6. My solution was to use AppendFormat instead, and add AppendLine() without parameters where applicable to append the default line terminator.

See: https://devblogs.microsoft.com/dotnet/string-interpolation-in-c-10-and-net-6/

dustin-wojciechowski avatar Oct 30 '23 22:10 dustin-wojciechowski

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

github-actions[bot] avatar Oct 30 '23 23:10 github-actions[bot]

:fire: [PR Build] Build failed :fire:

Build failed for the job 'Build packages'

Pipeline on Agent Hash: 64e0f6a9243d321b2fd2a3d407f8aca683e2369c [PR build]

:fire: [PR Build] Build failed :fire:

Build failed for the job 'Build macOS tests'

Pipeline on Agent Hash: 64e0f6a9243d321b2fd2a3d407f8aca683e2369c [PR build]

:fire: [PR Build] Build failed :fire:

Build failed for the job 'Detect API changes'

Pipeline on Agent Hash: 64e0f6a9243d321b2fd2a3d407f8aca683e2369c [PR build]

:fire: Unable to find the contents for the comment: D:\a\1\s\change-detection\results\gh-comment.md does not exist :fire

Pipeline on Agent Hash: 64e0f6a9243d321b2fd2a3d407f8aca683e2369c [PR build]

:computer: [CI Build] Windows Integration Tests passed :computer:

:white_check_mark: All Windows Integration Tests passed.

Pipeline on Agent Hash: 35f3644b71276cf1374386f1b0a1ed6c6885ec03 [PR build]

:computer: [PR Build] Tests on macOS M1 - Mac Ventura (13.0) passed :computer:

:white_check_mark: All tests on macOS M1 - Mac Ventura (13.0) passed.

Pipeline on Agent Hash: [PR build]

:computer: [PR Build] Tests on macOS M1 - Mac Big Sur (11.5) passed :computer:

:white_check_mark: All tests on macOS M1 - Mac Big Sur (11.5) passed.

Pipeline on Agent Hash: [PR build]

:books: [PR Build] Artifacts :books:

Packages generated

View packages

Pipeline on Agent Hash: [PR build]

:white_check_mark: API diff for current PR / commit

Legacy Xamarin (No breaking changes)
  • ~iOS~ (no change detected)
  • ~tvOS~ (no change detected)
  • ~watchOS~ (no change detected)
  • ~macOS~ (no change detected)
NET (empty diffs)
  • ~iOS~: (empty diff detected)
  • ~tvOS~: (empty diff detected)
  • ~MacCatalyst~: (empty diff detected)
  • ~macOS~: (empty diff detected)

:white_check_mark: API diff vs stable

Legacy Xamarin (No breaking changes)
.NET (No breaking changes)
Legacy Xamarin (stable) vs .NET

:information_source: Generator diff

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

Pipeline on Agent Hash: 35f3644b71276cf1374386f1b0a1ed6c6885ec03 [PR build]

:fire: [CI Build] Test results :fire:

Test results

:x: Tests failed on VSTS: simulator tests

0 tests crashed, 1 tests failed, 234 tests passed.

Failures

:x: monotouch tests

1 tests failed, 40 tests passed.
  • monotouch-test/Mac [dotnet]/Debug (managed static registrar) [dotnet]: TimedOut (Execution timed out after 1200 seconds. Test run crashed)

Html Report (VSDrops) Download

Successes

:white_check_mark: bcl: All 69 tests passed. Html Report (VSDrops) Download :white_check_mark: cecil: All 1 tests passed. Html Report (VSDrops) Download :white_check_mark: dotnettests: All 1 tests passed. Html Report (VSDrops) Download :white_check_mark: fsharp: All 7 tests passed. Html Report (VSDrops) Download :white_check_mark: framework: All 8 tests passed. Html Report (VSDrops) Download :white_check_mark: generator: All 2 tests passed. Html Report (VSDrops) Download :white_check_mark: interdependent_binding_projects: All 7 tests passed. Html Report (VSDrops) Download :white_check_mark: install_source: All 1 tests passed. Html Report (VSDrops) Download :white_check_mark: introspection: All 8 tests passed. Html Report (VSDrops) Download :white_check_mark: linker: All 65 tests passed. Html Report (VSDrops) Download :white_check_mark: mac_binding_project: All 1 tests passed. Html Report (VSDrops) Download :white_check_mark: mmp: All 2 tests passed. Html Report (VSDrops) Download :white_check_mark: mononative: All 6 tests passed. Html Report (VSDrops) Download :white_check_mark: msbuild: All 2 tests passed. Html Report (VSDrops) Download :white_check_mark: mtouch: All 1 tests passed. Html Report (VSDrops) Download :white_check_mark: xammac: All 3 tests passed. Html Report (VSDrops) Download :white_check_mark: xcframework: All 8 tests passed. Html Report (VSDrops) Download :white_check_mark: xtro: All 2 tests passed. Html Report (VSDrops) Download

Pipeline on Agent Hash: 35f3644b71276cf1374386f1b0a1ed6c6885ec03 [PR build]

:computer: [CI Build] Windows Integration Tests passed :computer:

:white_check_mark: All Windows Integration Tests passed.

Pipeline on Agent Hash: 835487215cdbe276d611caf5c31acfe50a7edcae [PR build]

:computer: [PR Build] Tests on macOS M1 - Mac Ventura (13.0) passed :computer:

:white_check_mark: All tests on macOS M1 - Mac Ventura (13.0) passed.

Pipeline on Agent Hash: [PR build]

:computer: [PR Build] Tests on macOS M1 - Mac Big Sur (11.5) passed :computer:

:white_check_mark: All tests on macOS M1 - Mac Big Sur (11.5) passed.

Pipeline on Agent Hash: [PR build]

:books: [PR Build] Artifacts :books:

Packages generated

View packages

Pipeline on Agent Hash: [PR build]

:white_check_mark: API diff for current PR / commit

Legacy Xamarin (No breaking changes)
  • ~iOS~ (no change detected)
  • ~tvOS~ (no change detected)
  • ~watchOS~ (no change detected)
  • ~macOS~ (no change detected)
NET (empty diffs)
  • ~iOS~: (empty diff detected)
  • ~tvOS~: (empty diff detected)
  • ~MacCatalyst~: (empty diff detected)
  • ~macOS~: (empty diff detected)

:white_check_mark: API diff vs stable

Legacy Xamarin (No breaking changes)
.NET (No breaking changes)
Legacy Xamarin (stable) vs .NET

:information_source: Generator diff

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

Pipeline on Agent Hash: 835487215cdbe276d611caf5c31acfe50a7edcae [PR build]

:rocket: [CI Build] Test results :rocket:

Test results

:white_check_mark: All tests passed on VSTS: simulator tests.

:tada: All 235 tests passed :tada:

Tests counts

:white_check_mark: bcl: All 69 tests passed. Html Report (VSDrops) Download :white_check_mark: cecil: All 1 tests passed. Html Report (VSDrops) Download :white_check_mark: dotnettests: All 1 tests passed. Html Report (VSDrops) Download :white_check_mark: fsharp: All 7 tests passed. Html Report (VSDrops) Download :white_check_mark: framework: All 8 tests passed. Html Report (VSDrops) Download :white_check_mark: generator: All 2 tests passed. Html Report (VSDrops) Download :white_check_mark: interdependent_binding_projects: All 7 tests passed. Html Report (VSDrops) Download :white_check_mark: install_source: All 1 tests passed. Html Report (VSDrops) Download :white_check_mark: introspection: All 8 tests passed. Html Report (VSDrops) Download :white_check_mark: linker: All 65 tests passed. Html Report (VSDrops) Download :white_check_mark: mac_binding_project: All 1 tests passed. Html Report (VSDrops) Download :white_check_mark: mmp: All 2 tests passed. Html Report (VSDrops) Download :white_check_mark: mononative: All 6 tests passed. Html Report (VSDrops) Download :white_check_mark: monotouch: All 41 tests passed. Html Report (VSDrops) Download :white_check_mark: msbuild: All 2 tests passed. Html Report (VSDrops) Download :white_check_mark: mtouch: All 1 tests passed. Html Report (VSDrops) Download :white_check_mark: xammac: All 3 tests passed. Html Report (VSDrops) Download :white_check_mark: xcframework: All 8 tests passed. Html Report (VSDrops) Download :white_check_mark: xtro: All 2 tests passed. Html Report (VSDrops) Download

Pipeline on Agent Hash: 835487215cdbe276d611caf5c31acfe50a7edcae [PR build]

Argument is 'ref' while parameter is declared as 'value' (in 'System.Text.StringBuilder.AppendInterpolatedStringHandler.AppendInterpolatedStringHandler(int, int, StringBuilder)' constructor call)

This looks like a bug in the C# compiler. I tried reproducing this by just bumping the lang version to 'latest' and building locally, but everything built just fine. Would you be able to create a smaller test case that reproduces this error? That way we could file it with the C# compiler team.

rolfbjarne avatar Nov 02 '23 11:11 rolfbjarne