Skip to content

[src] Make all generated P/Invokes use blittable signatures. Fixes #18685. - #19034

Merged
rolfbjarne merged 4 commits into
dotnet:mainfrom
rolfbjarne:blittable-generator
Sep 19, 2023
Merged

rolfbjarne merged 4 commits into
dotnet:mainfrom
rolfbjarne:blittable-generator

Conversation

@rolfbjarne

@rolfbjarne rolfbjarne commented Sep 15, 2023 •

Copy link
Copy Markdown
Member

This means:

  • Change all bool and char arguments in P/Invokes to be byte and ushort, respectively.
  • Change all out/ref arguments to be pointers instead.
  • Update managed binding code accordingly.
  • Update a struct (GKTriangle) to not use a MarshalAs field, but instead only use blittable fields.
  • Update tests accordingly.

One side effect is that legacy binding projects may need a reference to the System.Runtime.CompilerServices.Unsafe NuGet now (this is a built-in dependency in .NET) in order to compile successfully.

Fixes #18685.

@github-actions

Copy link
Copy Markdown
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.

…tnet#18685.

This means:

* Change all bool and char arguments in P/Invokes to be byte and ushort, respectively.
* Change all out/ref arguments to be pointers instead.
* Update managed binding code accordingly.
* Update a struct (GKTriangle) to not use a MarshalAs field, but instead only use blittable fields.
* Update tests accordingly.

Fixes dotnet#18685.
@rolfbjarne
rolfbjarne marked this pull request as ready for review September 18, 2023 08:32
@vs-mobiletools-engineering-service2

This comment has been minimized.

@mandel-macaque

Copy link
Copy Markdown
Contributor

@rolfbjarne THANK YOU, it was in my todo.

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

Our bgen testing infrastructure isn't really setup to add a reference to a
NuGet (System.Runtime.CompilerServices.Unsafe), so just move a few tests that
hit this issue to be .NET only (when the
System.Runtime.CompilerServices.Unsafe reference is implicit).
@vs-mobiletools-engineering-service2

Copy link
Copy Markdown
Collaborator

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

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

Pipeline on Agent
Hash: [PR build]

@vs-mobiletools-engineering-service2

Copy link
Copy Markdown
Collaborator

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

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

Pipeline on Agent
Hash: [PR build]

@vs-mobiletools-engineering-service2

Copy link
Copy Markdown
Collaborator

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

✅ API diff vs stable

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

ℹ️ Generator diff

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

Pipeline on Agent
Hash: 753118ea5b180faf20e91845cd125e4f013169e0 [PR build]

@vs-mobiletools-engineering-service2

Copy link
Copy Markdown
Collaborator

💻 [CI Build] Windows Integration Tests passed 💻

✅ All Windows Integration Tests passed.

Pipeline on Agent
Hash: 753118ea5b180faf20e91845cd125e4f013169e0 [PR build]

@vs-mobiletools-engineering-service2

Copy link
Copy Markdown
Collaborator

📚 [PR Build] Artifacts 📚

Packages generated

View packages

Pipeline on Agent
Hash: [PR build]

@vs-mobiletools-engineering-service2

This comment has been minimized.

@vs-mobiletools-engineering-service2

Copy link
Copy Markdown
Collaborator

🔥 [CI Build] Test results 🔥

Test results

❌ Tests failed on VSTS: simulator tests

0 tests crashed, 6 tests failed, 228 tests passed.

Failures

❌ monotouch tests [attempt 2]

6 tests failed, 29 tests passed.
Details
  • monotouch-test/Mac [dotnet]/Debug [dotnet]: Failed (Test run failed.
    Tests run: 2775 Passed: 2687 Inconclusive: 3 Failed: 2 Ignored: 86)
  • monotouch-test/Mac [dotnet]/Debug (static registrar) [dotnet]: Failed (Test run failed.
    Tests run: 2772 Passed: 2684 Inconclusive: 3 Failed: 2 Ignored: 86)
  • monotouch-test/Mac [dotnet]/Release [dotnet]: Failed (Test run failed.
    Tests run: 2772 Passed: 2681 Inconclusive: 3 Failed: 2 Ignored: 89)
  • monotouch-test/Mac [dotnet]/Release (all optimizations) [dotnet]: Failed (Test run failed.
    Tests run: 2772 Passed: 2685 Inconclusive: 3 Failed: 2 Ignored: 85)
  • monotouch-test/Mac [dotnet]/Debug (managed static registrar) [dotnet]: Failed (Test run failed.
    Tests run: 2772 Passed: 2684 Inconclusive: 3 Failed: 2 Ignored: 86)
  • monotouch-test/Mac [dotnet]/Release (managed static registrar, all optimizations) [dotnet]: Failed (Test run failed.
    Tests run: 2772 Passed: 2684 Inconclusive: 3 Failed: 2 Ignored: 86)

Html Report (VSDrops) Download

Successes

✅ bcl: All 69 tests passed. [attempt 2] Html Report (VSDrops) Download
✅ cecil: All 1 tests passed. Html Report (VSDrops) Download
✅ dotnettests: All 1 tests passed. Html Report (VSDrops) Download
✅ fsharp: All 7 tests passed. Html Report (VSDrops) Download
✅ framework: All 8 tests passed. [attempt 2] Html Report (VSDrops) Download
✅ generator: All 2 tests passed. Html Report (VSDrops) Download
✅ interdependent_binding_projects: All 7 tests passed. Html Report (VSDrops) Download
✅ install_source: All 1 tests passed. Html Report (VSDrops) Download
✅ introspection: All 8 tests passed. [attempt 2] Html Report (VSDrops) Download
✅ linker: All 65 tests passed. Html Report (VSDrops) Download
✅ mac_binding_project: All 1 tests passed. Html Report (VSDrops) Download
✅ mmp: All 2 tests passed. Html Report (VSDrops) Download
✅ mononative: All 12 tests passed. Html Report (VSDrops) Download
✅ msbuild: All 2 tests passed. Html Report (VSDrops) Download
⚠️ mtouch: No tests selected. Html Report (VSDrops) Download
✅ xammac: All 3 tests passed. Html Report (VSDrops) Download
✅ xcframework: All 8 tests passed. Html Report (VSDrops) Download
✅ xtro: All 2 tests passed. Html Report (VSDrops) Download

Pipeline on Agent
Hash: 753118ea5b180faf20e91845cd125e4f013169e0 [PR build]

@rolfbjarne

Copy link
Copy Markdown
Member Author

@rolfbjarne
rolfbjarne merged commit 5f3c312 into dotnet:main Sep 19, 2023
@rolfbjarne
rolfbjarne deleted the blittable-generator branch September 19, 2023 08:41
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.

[Generator] Generator does not create BlittablePInvokes when a boolean is present in a parameter

4 participants