Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

[msbuild] Automatically add the 'com.apple.security.cs.allow-jit' entitlement for desktop release builds. Fixes #15745. #15927

Conversation

rolfbjarne
Copy link
Member

  • Add support for specifying custom entitlements with an MSBuild item group.
  • Use this new support to automatically add the 'com.apple.security.cs.allow-jit'
    entitlement to .NET desktop apps when building for release, since all apps that
    go through notarization will need it in order to be able to use the JIT.

It's possible to override the default behavior by adding something like this to the project file:

<ItemGroup>
    <CustomEntitlements Include="com.apple.security.cs.allow-jit" Type="Remove" />
</ItemGroup>

Fixes #15745.

…itlement for desktop release builds. Fixes xamarin#15745.

* Add support for specifying custom entitlements with an MSBuild item group.
* Use this new support to automatically add the 'com.apple.security.cs.allow-jit'
  entitlement to .NET desktop apps when building for release, since all apps that
  go through notarization will need it in order to be able to use the JIT.

It's possible to override the default behavior by adding something like this to the project file:

    <ItemGroup>
        <CustomEntitlements Include="com.apple.security.cs.allow-jit" Type="Remove" />
    </ItemGroup>

Fixes xamarin#15745.
@rolfbjarne rolfbjarne added the bug If an issue is a bug or a pull request a bug fix label Sep 12, 2022
@vs-mobiletools-engineering-service2
Copy link
Collaborator

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

All tests on macOS Mac Catalina (10.15) passed.

Pipeline on Agent
Hash: 142f2271e3ca7c11368097b0c56e30afd6e8e2b3 [PR build]

@vs-mobiletools-engineering-service2
Copy link
Collaborator

📚 [PR Build] Artifacts 📚

Packages generated

View packages

Pipeline on Agent XAMBOT-1044.Monterey
Hash: 142f2271e3ca7c11368097b0c56e30afd6e8e2b3 [PR build]

@vs-mobiletools-engineering-service2
Copy link
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 is empty

Pipeline on Agent
Hash: 142f2271e3ca7c11368097b0c56e30afd6e8e2b3 [PR build]

@vs-mobiletools-engineering-service2
Copy link
Collaborator

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

Failed tests are:

  • monotouch-test

Pipeline on Agent
Hash: 142f2271e3ca7c11368097b0c56e30afd6e8e2b3 [PR build]

Comment on lines +281 to +285
bool booleanValue;
if (string.Equals (value, "true", StringComparison.OrdinalIgnoreCase)) {
booleanValue = true;
} else if (string.Equals (value, "false", StringComparison.OrdinalIgnoreCase)) {
booleanValue = false;
Copy link
Member

Choose a reason for hiding this comment

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

Why not use https://docs.microsoft.com/en-us/dotnet/api/system.boolean.tryparse?view=net-6.0 look like it supports several representations for bool:

// The example displays the following output:
//       Unable to parse '<null>'.
//       Unable to parse ''.
//       'True' --> True
//       'False' --> False
//       'true' --> True
//       'false' --> False
//       '    true    ' --> True
//       Unable to parse '0'.
//       Unable to parse '1'.
//       Unable to parse '-1'.
//       Unable to parse 'string'.

Copy link
Member

@mandel-macaque mandel-macaque left a comment

Choose a reason for hiding this comment

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

Approving but you could use the try parse method.

@vs-mobiletools-engineering-service2
Copy link
Collaborator

🔥 [CI Build] Test results 🔥

Test results

❌ Tests failed on VSTS: simulator tests

6 tests crashed, 16 tests failed, 184 tests passed.

Failures

❌ bcl tests

1 tests failed, 68 tests passed.
  • [NUnit] Mono Mac OS X BCL tests group 3/Mac Full/Debug: Failed (Test run failed.
    Tests run: 11328 Passed: 10553 Inconclusive: 0 Failed: 1 Ignored: 97)

Html Report (VSDrops) Download

❌ generator tests

🔥 Failed catastrophically on VSTS: simulator tests - generator (no summary found).

Html Report (VSDrops) Download

❌ interdependent_binding_projects tests

🔥 Failed catastrophically on VSTS: simulator tests - interdependent_binding_projects (no summary found).

Html Report (VSDrops) Download

❌ linker tests

3 tests failed, 62 tests passed.
  • link all/iOS Unified 64-bits - simulator/Debug: LaunchFailure
  • link all/tvOS - simulator/Release [dotnet]: BuildFailure
  • link sdk/iOS Unified 64-bits - simulator/Debug: LaunchFailure

Html Report (VSDrops) Download

❌ monotouch tests

12 tests failed, 11 tests passed.
  • monotouch-test/tvOS - simulator/Debug [dotnet]: Failed
  • monotouch-test/tvOS - simulator/Debug: Failed
  • monotouch-test/tvOS - simulator/Debug (LinkSdk) [dotnet]: Failed
  • monotouch-test/tvOS - simulator/Debug (static registrar) [dotnet]: Failed
  • monotouch-test/tvOS - simulator/Release (all optimizations) [dotnet]: Failed
  • monotouch-test/tvOS - simulator/Debug (LinkSdk): Failed
  • monotouch-test/tvOS - simulator/Debug (static registrar): Failed
  • monotouch-test/tvOS - simulator/Release (all optimizations): Failed
  • monotouch-test/watchOS 32-bits - simulator/Debug: Failed
  • monotouch-test/watchOS 32-bits - simulator/Debug (LinkSdk): Failed
  • monotouch-test/watchOS 32-bits - simulator/Debug (static registrar): Failed
  • monotouch-test/watchOS 32-bits - simulator/Release (all optimizations): Failed

Html Report (VSDrops) Download

❌ mtouch tests

🔥 Failed catastrophically on VSTS: simulator tests - mtouch (no summary found).

Html Report (VSDrops) Download

❌ xammac tests

🔥 Failed catastrophically on VSTS: simulator tests - xammac (no summary found).

Html Report (VSDrops) Download

❌ xcframework tests

🔥 Failed catastrophically on VSTS: simulator tests - xcframework (no summary found).

Html Report (VSDrops) Download

❌ xtro tests

🔥 Failed catastrophically on VSTS: simulator tests - xtro (no summary found).

Html Report (VSDrops) Download

Successes

✅ 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. Html Report (VSDrops) Download
✅ install_source: All 1 tests passed. Html Report (VSDrops) Download
✅ introspection: All 8 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

Pipeline on Agent
Hash: [PR build]

@vs-mobiletools-engineering-service2
Copy link
Collaborator

🔥 [CI Build] Test results 🔥

Test results

❌ Tests failed on VSTS: simulator tests

1 tests crashed, 12 tests failed, 209 tests passed.

Failures

❌ monotouch tests [attempt 2]

12 tests failed, 11 tests passed.
  • monotouch-test/tvOS - simulator/Debug [dotnet]: Failed
  • monotouch-test/tvOS - simulator/Debug: Failed
  • monotouch-test/tvOS - simulator/Debug (LinkSdk) [dotnet]: Failed
  • monotouch-test/tvOS - simulator/Debug (static registrar) [dotnet]: Failed
  • monotouch-test/tvOS - simulator/Release (all optimizations) [dotnet]: Failed
  • monotouch-test/tvOS - simulator/Debug (LinkSdk): Failed
  • monotouch-test/tvOS - simulator/Debug (static registrar): Failed
  • monotouch-test/tvOS - simulator/Release (all optimizations): Failed
  • monotouch-test/watchOS 32-bits - simulator/Debug: Failed
  • monotouch-test/watchOS 32-bits - simulator/Debug (LinkSdk): Failed
  • monotouch-test/watchOS 32-bits - simulator/Debug (static registrar): Failed
  • monotouch-test/watchOS 32-bits - simulator/Release (all optimizations): Failed

Html Report (VSDrops) Download

❌ xtro tests

🔥 Failed catastrophically on VSTS: simulator tests - xtro (no summary found).

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. Html Report (VSDrops) Download
✅ generator: All 2 tests passed. [attempt 2] Html Report (VSDrops) Download
✅ interdependent_binding_projects: All 7 tests passed. [attempt 2] Html Report (VSDrops) Download
✅ install_source: All 1 tests passed. Html Report (VSDrops) Download
✅ introspection: All 8 tests passed. Html Report (VSDrops) Download
✅ linker: All 65 tests passed. [attempt 2] 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: All 1 tests passed. [attempt 2] Html Report (VSDrops) Download
✅ xammac: All 3 tests passed. [attempt 2] Html Report (VSDrops) Download
✅ xcframework: All 8 tests passed. [attempt 2] Html Report (VSDrops) Download

Pipeline on Agent
Hash: [PR build]

@vs-mobiletools-engineering-service2
Copy link
Collaborator

🔥 [CI Build] Test results 🔥

Test results

❌ Tests failed on VSTS: simulator tests

0 tests crashed, 12 tests failed, 211 tests passed.

Failures

❌ monotouch tests [attempt 3]

12 tests failed, 11 tests passed.
  • monotouch-test/tvOS - simulator/Debug [dotnet]: Failed
  • monotouch-test/tvOS - simulator/Debug: Failed
  • monotouch-test/tvOS - simulator/Debug (LinkSdk) [dotnet]: Failed
  • monotouch-test/tvOS - simulator/Debug (static registrar) [dotnet]: Failed
  • monotouch-test/tvOS - simulator/Release (all optimizations) [dotnet]: Failed
  • monotouch-test/tvOS - simulator/Debug (LinkSdk): Failed
  • monotouch-test/tvOS - simulator/Debug (static registrar): Failed
  • monotouch-test/tvOS - simulator/Release (all optimizations): Failed
  • monotouch-test/watchOS 32-bits - simulator/Debug: Failed
  • monotouch-test/watchOS 32-bits - simulator/Debug (LinkSdk): Failed
  • monotouch-test/watchOS 32-bits - simulator/Debug (static registrar): Failed
  • monotouch-test/watchOS 32-bits - simulator/Release (all optimizations): Failed

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. Html Report (VSDrops) Download
✅ generator: All 2 tests passed. [attempt 2] Html Report (VSDrops) Download
✅ interdependent_binding_projects: All 7 tests passed. [attempt 2] Html Report (VSDrops) Download
✅ install_source: All 1 tests passed. Html Report (VSDrops) Download
✅ introspection: All 8 tests passed. Html Report (VSDrops) Download
✅ linker: All 65 tests passed. [attempt 2] 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: All 1 tests passed. [attempt 2] Html Report (VSDrops) Download
✅ xammac: All 3 tests passed. [attempt 2] Html Report (VSDrops) Download
✅ xcframework: All 8 tests passed. [attempt 2] Html Report (VSDrops) Download
✅ xtro: All 2 tests passed. [attempt 3] Html Report (VSDrops) Download

Pipeline on Agent
Hash: [PR build]

@rolfbjarne
Copy link
Member Author

Test failures are unrelated (#15939).

@rolfbjarne rolfbjarne merged commit 4019996 into xamarin:main Sep 13, 2022
@rolfbjarne rolfbjarne deleted the msbuild-jit-allowed-entitlement-issue-15745 branch September 13, 2022 15:41
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug If an issue is a bug or a pull request a bug fix
Projects
None yet
Development

Successfully merging this pull request may close these issues.

Consider adding allow-jit entitlement by default for macOS project built in release
6 participants