Skip to content

[dotnet] Add support for selecting whether to create P/Invoke wrappers or not. Fixes #4940. - #14961

Merged
rolfbjarne merged 2 commits into
dotnet:mainfrom
rolfbjarne:issue-4940
May 11, 2022
Merged

rolfbjarne merged 2 commits into
dotnet:mainfrom
rolfbjarne:issue-4940

Conversation

@rolfbjarne

Copy link
Copy Markdown
Member

Fixes #4940.

…s or not. Fixes dotnet#4940.

* This is a potential mitigation for slower transition to native code when
  exception marshalling is enabled (dotnet#14812).
* A minor modification was required in the linker, to make sure any modified
  assemblies are saved.

Fixes dotnet#4940.
@rolfbjarne
rolfbjarne requested review from chamons, emaf and mauroa as code owners May 9, 2022 20:19
@rolfbjarne rolfbjarne added the enhancement The issue or pull request is an enhancement label May 9, 2022
if (modified) {
var action = Context.Annotations.GetAction (assembly);
switch (action) {
case AssemblyAction.Copy:

@mauroa mauroa May 9, 2022 •

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.

Are you expecting more cases anytime soon or why choosing a switch for just one case?
You could avoid the nested if with if (modified && Context.Annotations.GetAction (assembly) == AssemblyAction.Copy) { ... }

Copy link
Copy Markdown
Member Author

Choose a reason for hiding this comment

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

I simplified this a bit

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

❤️

@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

Copy link
Copy Markdown
Collaborator

📚 [CI Build] Artifacts 📚

Artifacts were not provided.

Pipeline on Agent XAMBOT-1044.Monterey
Hash: 488fbd74c2b00e33cdb7bb9970801a32b54c3e56

@vs-mobiletools-engineering-service2

Copy link
Copy Markdown
Collaborator

💻 [PR Build] Tests on macOS Mac Catalina (10.15) passed 💻

✅ All tests on macOS Mac Catalina (10.15) passed.

Pipeline on Agent
Hash: 488fbd74c2b00e33cdb7bb9970801a32b54c3e56

@vs-mobiletools-engineering-service2

Copy link
Copy Markdown
Collaborator

📋 [PR Build] API Diff 📋

API Current PR diff

✅ API Diff (from PR only) (no change)

View API diff
View dotnet API diff
View dotnet legacy API diff
View dotnet iOS-MacCatalayst API diff

API diff

✅ API Diff from stable

View API diff
View dotnet API diff
View dotnet legacy API diff
View dotnet iOS-MacCatalayst API diff

Generator diff

✅ Generator Diff (no change)

Pipeline on Agent XAMBOT-1023.Monterey'
Hash: 488fbd74c2b00e33cdb7bb9970801a32b54c3e56

@vs-mobiletools-engineering-service2

Copy link
Copy Markdown
Collaborator

❌ [PR Build] Tests on macOS M1 - Mac Big Sur (11.5) failed ❌

Failed tests are:

  • dontlink
  • linksdk
  • linkall

Pipeline on Agent
Hash: 488fbd74c2b00e33cdb7bb9970801a32b54c3e56

@vs-mobiletools-engineering-service2

Copy link
Copy Markdown
Collaborator

❌ [CI Build] Tests failed on VSTS: simulator tests iOS ❌

Tests failed on VSTS: simulator tests iOS.

Test results

17 tests failed, 132 tests passed.

Failed tests

  • link sdk/Mac [dotnet]/Debug [dotnet]: Failed (Test run failed.
    Tests run: 117 Passed: 107 Inconclusive: 0 Failed: 1 Ignored: 9)
  • link sdk/Mac [dotnet]/Release [dotnet]: Failed (Test run failed.
    Tests run: 117 Passed: 106 Inconclusive: 0 Failed: 1 Ignored: 10)
  • link sdk/Mac Catalyst [dotnet]/Debug [dotnet]: Failed (Test run failed.
    Tests run: 129 Passed: 119 Inconclusive: 0 Failed: 1 Ignored: 9)
  • link sdk/Mac Catalyst [dotnet]/Release [dotnet]: Failed (Test run failed.
    Tests run: 129 Passed: 118 Inconclusive: 0 Failed: 1 Ignored: 10)
  • link sdk/Mac Modern/Debug: Failed (Test run failed.
    Tests run: 9 Passed: 8 Inconclusive: 0 Failed: 1 Ignored: 0)
  • link sdk/iOS Unified 64-bits - simulator/Debug [dotnet]: Failed
  • link sdk/iOS Unified 64-bits - simulator/Debug: Failed
  • link sdk/iOS Unified 64-bits - simulator/Release: Failed
  • link sdk/tvOS - simulator/Release [dotnet]: Failed
  • link sdk/tvOS - simulator/Debug: Failed
  • link sdk/tvOS - simulator/Release: Failed
  • trimmode link/Mac [dotnet]/Debug [dotnet]: Failed (Test run failed.
    Tests run: 117 Passed: 107 Inconclusive: 0 Failed: 1 Ignored: 9)
  • trimmode link/Mac Catalyst [dotnet]/Release [dotnet]: Failed (Test run failed.
    Tests run: 129 Passed: 118 Inconclusive: 0 Failed: 1 Ignored: 10)
  • trimmode link/iOS Unified 64-bits - simulator/Debug [dotnet]: Failed
  • trimmode link/iOS Unified 64-bits - simulator/Release [dotnet]: Failed
  • trimmode link/tvOS - simulator/Debug [dotnet]: Failed
  • link all/Mac Modern/Debug: Failed (Test run failed.
    Tests run: 20 Passed: 18 Inconclusive: 0 Failed: 1 Ignored: 1)

Pipeline on Agent XAMBOT-1044.Monterey
Merge 488fbd7 into d1b7606

@rolfbjarne

Copy link
Copy Markdown
Member Author

Test failures are unrelated (#14943).

@rolfbjarne
rolfbjarne merged commit 92eda7f into dotnet:main May 11, 2022
@rolfbjarne
rolfbjarne deleted the issue-4940 branch May 11, 2022 14:42
rolfbjarne added a commit to rolfbjarne/macios that referenced this pull request May 11, 2022
…s or not. Fixes dotnet#4940. (dotnet#14961)

* This is a potential mitigation for slower transition to native code when
  exception marshalling is enabled (dotnet#14812).
* A minor modification was required in the linker, to make sure any modified
  assemblies are saved.

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

Labels

enhancement The issue or pull request is an enhancement

Projects

None yet

Development

Successfully merging this pull request may close these issues.

Make it possible to opt in to PInvoke wrapper generation

6 participants