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

[Security] Add Xcode 13 beta 4 support. #12365

Merged
merged 4 commits into from
Aug 10, 2021

Conversation

mandel-macaque
Copy link
Member

No description provided.

@mandel-macaque mandel-macaque added the note-highlight Worth calling out specifically in release notes label Aug 5, 2021
[Deprecated (PlatformName.MacOSX, 12, 0, message: "Use 'SecKeyCreateRandomKey' instead.")]
[Deprecated (PlatformName.iOS, 15, 0, message: "Use 'SecKeyCreateRandomKey' instead.")]
[Deprecated (PlatformName.TvOS, 15, 0, message: "Use 'SecKeyCreateRandomKey' instead.")]
[Deprecated (PlatformName.WatchOS, 8, 0, message: "Use 'SecKeyCreateRandomKey' instead.")]
Copy link
Contributor

Choose a reason for hiding this comment

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

You need to use the new (dotnet) attributes in manual bindings. Otherwise you're pushing extra work to fix #11055

#if NET
		[UnsupportedOSPlatform ("macos12.0")]
		[UnsupportedOSPlatform ("ios15.0")]
		[UnsupportedOSPlatform ("tvos15.0")]
		[UnsupportedOSPlatform ("maccatalyst15.0")]
#else
		[Deprecated (PlatformName.MacOSX, 12, 0, message: "Use 'SecKeyCreateRandomKey' instead.")]
 		[Deprecated (PlatformName.iOS, 15, 0, message: "Use 'SecKeyCreateRandomKey' instead.")]
 		[Deprecated (PlatformName.TvOS, 15, 0, message: "Use 'SecKeyCreateRandomKey' instead.")] 
 		[Deprecated (PlatformName.WatchOS, 8, 0, message:  "Use 'SecKeyCreateRandomKey' instead.")]
#endif

No need for [UnsupportedOSPlatform ("watchos")] since it's done at the assembly-level, see src/MinimumVersions.cs.in

However you need [UnsupportedOSPlatform ("maccatalyst15.0")] or [UnsupportedOSPlatform ("maccatalyst")] (and #if !MACCATALYST) if it has never been available.

Optionally you can add an [Obsolete] attribute to suggest an alternative. This is what the generator does, see src/ObjCRuntime/PlatformAvailability2.cs.

The tricky part is that it's general to all platforms, so you might need to use #if ... #endif around each [Obsolete] if the message is not identical (or if it's not deprecated on every platforms).

Copy link
Contributor

Choose a reason for hiding this comment

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

a bit more in #10580 (comment)

src/Security/Certificate.cs Show resolved Hide resolved
@vs-mobiletools-engineering-service2
Copy link
Collaborator

🔥 Tests failed catastrophically on Build (no summary found). 🔥

Result file $(TEST_SUMMARY_PATH) not found.

Pipeline on Agent
Merge ef1de3b into 244232d

@rolfbjarne
Copy link
Member

/azp run

@azure-pipelines
Copy link

Azure Pipelines successfully started running 1 pipeline(s).

@vs-mobiletools-engineering-service2
Copy link
Collaborator

🔥 Tests failed catastrophically on Build (no summary found). 🔥

Result file $(TEST_SUMMARY_PATH) not found.

Pipeline on Agent
Merge ef1de3b into 6d078c2

@vs-mobiletools-engineering-service2
Copy link
Collaborator

✅ [PR Build] Tests passed on Build. ✅

Tests passed on Build.

API diff

✅ API Diff from stable

View API diff

API & Generator diff

ℹ️ API Diff (from PR only) (please review changes)
Generator Diff (only version changes)

GitHub pages

Results can be found in the following github pages (it might take some time to publish):

🎉 All 92 tests passed 🎉

Pipeline on Agent XAMBOT-1101.BigSur'
Merge e2f0381 into ecad9d9

[UnsupportedOSPlatform ("tvos15.0")]
[UnsupportedOSPlatform ("maccatalyst15.0")]
#if __MACCATALYST__
[Obsolete ("Starting with maccatalyst15.0 API removed, please use 'SecKeyCreateRandomKey' instead.", DiagnosticId = "BI1234", UrlFormat = "https://github.com/xamarin/xamarin-macios/wiki/Obsolete")]
Copy link
Contributor

Choose a reason for hiding this comment

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

The API removed, please from my earlier example comes from ObsoletedAttribute.Message
IOW this specific API it not removed, just obsoleted

If that had been a generated it would have been:
"Starting with maccatalyst15.0 Use 'SecKeyCreateRandomKey' instead."

"Starting with " + platform + " + Message: "Use 'SecKeyCreateRandomKey' instead."

@vs-mobiletools-engineering-service2
Copy link
Collaborator

❌ [PR Build] Tests failed on Build ❌

Tests failed on Build.

API diff

✅ API Diff from stable

View API diff

API & Generator diff

ℹ️ API Diff (from PR only) (please review changes)
Generator Diff (only version changes)

GitHub pages

Results can be found in the following github pages (it might take some time to publish):

Test results

2 tests failed, 90 tests passed.

Failed tests

  • introspection/Mac Catalyst/Debug [dotnet]: TimedOut (Execution timed out after 1200 seconds.
    No test log file was produced)
  • monotouch-test/Mac Catalyst/Debug [dotnet]: Failed (Tests run: 2638 Passed: 2489 Inconclusive: 35 Failed: 1 Ignored: 148)

Pipeline on Agent XAMBOT-1104.BigSur'
Merge 0b0b40c into 9307052

@mandel-macaque
Copy link
Member Author

Unrelated errors: https://github.com/xamarin/maccore/issues/2414

@mandel-macaque mandel-macaque merged commit ae77aed into xamarin:main Aug 10, 2021
@mandel-macaque mandel-macaque deleted the security-xcode13-beta4 branch August 10, 2021 01:38
@dalexsoto dalexsoto added this to August 2021 in Xcode 13 Aug 31, 2021
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
note-highlight Worth calling out specifically in release notes
Projects
No open projects
Xcode 13
August 2021
Development

Successfully merging this pull request may close these issues.

None yet

5 participants