Skip to content

Commit

Permalink
[CFNetwork] Add Xcode13 beta 1 support. (#11966)
Browse files Browse the repository at this point in the history
  • Loading branch information
mandel-macaque authored Jun 18, 2021
1 parent 3590070 commit 8d2d06b
Show file tree
Hide file tree
Showing 14 changed files with 81 additions and 62 deletions.
6 changes: 5 additions & 1 deletion src/CFNetwork/CFHost.cs
Original file line number Diff line number Diff line change
Expand Up @@ -21,7 +21,11 @@ namespace CFNetwork {
namespace CoreServices {
#endif

// used by CFStream.cs (only?)
[Deprecated (PlatformName.WatchOS, 8, 0, message: Constants.UseNetworkInstead)]
[Deprecated (PlatformName.TvOS, 15, 0, message: Constants.UseNetworkInstead)]
[Deprecated (PlatformName.iOS, 15, 0, message: Constants.UseNetworkInstead)]
[Deprecated (PlatformName.MacCatalyst, 15, 0, message: Constants.UseNetworkInstead)]
[Deprecated (PlatformName.MacOSX, 12, 0, message: Constants.UseNetworkInstead)]
class CFHost : INativeObject, IDisposable {
internal IntPtr handle;

Expand Down
40 changes: 40 additions & 0 deletions src/CoreFoundation/CFStream.cs
Original file line number Diff line number Diff line change
Expand Up @@ -159,10 +159,20 @@ public abstract class CFStream : CFType, INativeObject, IDisposable {

#region Stream Constructors

[Deprecated (PlatformName.WatchOS, 8, 0, message: Constants.UseNetworkInstead)]
[Deprecated (PlatformName.TvOS, 15, 0, message: Constants.UseNetworkInstead)]
[Deprecated (PlatformName.iOS, 15, 0, message: Constants.UseNetworkInstead)]
[Deprecated (PlatformName.MacCatalyst, 15, 0, message: Constants.UseNetworkInstead)]
[Deprecated (PlatformName.MacOSX, 12, 0, message: Constants.UseNetworkInstead)]
[DllImport (Constants.CoreFoundationLibrary)]
internal extern static void CFStreamCreatePairWithSocket (/* CFAllocatorRef */ IntPtr allocator, CFSocketNativeHandle sock,
/* CFReadStreamRef* */ out IntPtr readStream, /* CFWriteStreamRef* */ out IntPtr writeStream);

[Deprecated (PlatformName.WatchOS, 8, 0, message: Constants.UseNetworkInstead)]
[Deprecated (PlatformName.TvOS, 15, 0, message: Constants.UseNetworkInstead)]
[Deprecated (PlatformName.iOS, 15, 0, message: Constants.UseNetworkInstead)]
[Deprecated (PlatformName.MacCatalyst, 15, 0, message: Constants.UseNetworkInstead)]
[Deprecated (PlatformName.MacOSX, 12, 0, message: Constants.UseNetworkInstead)]
public static void CreatePairWithSocket (CFSocket socket, out CFReadStream readStream,
out CFWriteStream writeStream)
{
Expand All @@ -175,11 +185,21 @@ public static void CreatePairWithSocket (CFSocket socket, out CFReadStream readS
writeStream = new CFWriteStream (write);
}

[Deprecated (PlatformName.WatchOS, 8, 0, message: Constants.UseNetworkInstead)]
[Deprecated (PlatformName.TvOS, 15, 0, message: Constants.UseNetworkInstead)]
[Deprecated (PlatformName.iOS, 15, 0, message: Constants.UseNetworkInstead)]
[Deprecated (PlatformName.MacCatalyst, 15, 0, message: Constants.UseNetworkInstead)]
[Deprecated (PlatformName.MacOSX, 12, 0, message: Constants.UseNetworkInstead)]
[DllImport (Constants.CFNetworkLibrary)]
internal extern static void CFStreamCreatePairWithPeerSocketSignature (/* CFAllocatorRef */ IntPtr allocator,
/* CFSocketSignature* */ ref CFSocketSignature sig,
/* CFReadStreamRef* */ out IntPtr readStream, /* CFWriteStreamRef* */ out IntPtr writeStream);

[Deprecated (PlatformName.WatchOS, 8, 0, message: Constants.UseNetworkInstead)]
[Deprecated (PlatformName.TvOS, 15, 0, message: Constants.UseNetworkInstead)]
[Deprecated (PlatformName.iOS, 15, 0, message: Constants.UseNetworkInstead)]
[Deprecated (PlatformName.MacCatalyst, 15, 0, message: Constants.UseNetworkInstead)]
[Deprecated (PlatformName.MacOSX, 12, 0, message: Constants.UseNetworkInstead)]
public static void CreatePairWithPeerSocketSignature (AddressFamily family, SocketType type,
ProtocolType proto, IPEndPoint endpoint,
out CFReadStream readStream,
Expand All @@ -196,13 +216,23 @@ public static void CreatePairWithPeerSocketSignature (AddressFamily family, Sock

#if !WATCH
// CFSocketStream.h in CFNetwork.framework (not CoreFoundation)
[Deprecated (PlatformName.WatchOS, 8, 0, message: Constants.UseNetworkInstead)]
[Deprecated (PlatformName.TvOS, 15, 0, message: Constants.UseNetworkInstead)]
[Deprecated (PlatformName.iOS, 15, 0, message: Constants.UseNetworkInstead)]
[Deprecated (PlatformName.MacCatalyst, 15, 0, message: Constants.UseNetworkInstead)]
[Deprecated (PlatformName.MacOSX, 12, 0, message: Constants.UseNetworkInstead)]
[DllImport (Constants.CFNetworkLibrary)]
internal extern static void CFStreamCreatePairWithSocketToCFHost (
/* CFAllocatorRef __nullable */ IntPtr allocator,
/* CFHostRef __nonnull */ IntPtr host, /* SInt32 */ int port,
/* CFReadStreamRef __nullable * __nullable */ out IntPtr readStream,
/* CFWriteStreamRef __nullable * __nullable */ out IntPtr writeStream);

[Deprecated (PlatformName.WatchOS, 8, 0, message: Constants.UseNetworkInstead)]
[Deprecated (PlatformName.TvOS, 15, 0, message: Constants.UseNetworkInstead)]
[Deprecated (PlatformName.iOS, 15, 0, message: Constants.UseNetworkInstead)]
[Deprecated (PlatformName.MacCatalyst, 15, 0, message: Constants.UseNetworkInstead)]
[Deprecated (PlatformName.MacOSX, 12, 0, message: Constants.UseNetworkInstead)]
public static void CreatePairWithSocketToHost (IPEndPoint endpoint,
out CFReadStream readStream,
out CFWriteStream writeStream)
Expand All @@ -217,11 +247,21 @@ public static void CreatePairWithSocketToHost (IPEndPoint endpoint,
}
#endif

[Deprecated (PlatformName.WatchOS, 8, 0, message: Constants.UseNetworkInstead)]
[Deprecated (PlatformName.TvOS, 15, 0, message: Constants.UseNetworkInstead)]
[Deprecated (PlatformName.iOS, 15, 0, message: Constants.UseNetworkInstead)]
[Deprecated (PlatformName.MacCatalyst, 15, 0, message: Constants.UseNetworkInstead)]
[Deprecated (PlatformName.MacOSX, 12, 0, message: Constants.UseNetworkInstead)]
[DllImport (Constants.CFNetworkLibrary)]
internal extern static void CFStreamCreatePairWithSocketToHost (/* CFAllocatorRef */ IntPtr allocator,
/* CFStringRef */ IntPtr host, /* UInt32 */ int port,
/* CFReadStreamRef* */ out IntPtr readStream, /* CFWriteStreamRef* */ out IntPtr writeStream);

[Deprecated (PlatformName.WatchOS, 8, 0, message: Constants.UseNetworkInstead)]
[Deprecated (PlatformName.TvOS, 15, 0, message: Constants.UseNetworkInstead)]
[Deprecated (PlatformName.iOS, 15, 0, message: Constants.UseNetworkInstead)]
[Deprecated (PlatformName.MacCatalyst, 15, 0, message: Constants.UseNetworkInstead)]
[Deprecated (PlatformName.MacOSX, 12, 0, message: Constants.UseNetworkInstead)]
public static void CreatePairWithSocketToHost (string host, int port,
out CFReadStream readStream,
out CFWriteStream writeStream)
Expand Down
3 changes: 3 additions & 0 deletions src/ObjCRuntime/ObsoleteConstants.cs
Original file line number Diff line number Diff line change
Expand Up @@ -9,6 +9,8 @@ partial class Constants {

internal const string UseCallKitInstead = "Use the 'CallKit' API instead.";

internal const string UseNetworkInstead = "Use 'Network.framework' instead.";

internal const string WatchKitRemoved = "The WatchKit framework has been removed from iOS.";

internal const string UnavailableOniOS = "This type is not available on iOS.";
Expand All @@ -18,5 +20,6 @@ partial class Constants {
internal const string MacOS32bitsUnavailable = "This framework is not available on 64bits macOS versions.";

internal const string iAdRemoved = "The iAd framework has been removed from iOS.";

}
}
56 changes: 28 additions & 28 deletions src/Security/SecureTransport.cs
Original file line number Diff line number Diff line change
Expand Up @@ -165,10 +165,10 @@ public enum SslStatus {

// Security.framework/Headers/SecureTransport.h
// untyped enum
[Deprecated (PlatformName.MacOSX, 10,15, message: "Use 'Network.framework' instead.")]
[Deprecated (PlatformName.iOS, 13,0, message: "Use 'Network.framework' instead.")]
[Deprecated (PlatformName.TvOS, 13,0, message: "Use 'Network.framework' instead.")]
[Deprecated (PlatformName.WatchOS, 6,0, message: "Use 'Network.framework' instead.")]
[Deprecated (PlatformName.MacOSX, 10,15, message: Constants.UseNetworkInstead)]
[Deprecated (PlatformName.iOS, 13,0, message: Constants.UseNetworkInstead)]
[Deprecated (PlatformName.TvOS, 13,0, message: Constants.UseNetworkInstead)]
[Deprecated (PlatformName.WatchOS, 6,0, message: Constants.UseNetworkInstead)]
public enum SslSessionOption {
BreakOnServerAuth,
BreakOnCertRequested,
Expand Down Expand Up @@ -197,10 +197,10 @@ public enum SslSessionOption {

// Security.framework/Headers/SecureTransport.h
// untyped enum
[Deprecated (PlatformName.MacOSX, 10,15, message: "Use 'Network.framework' instead.")]
[Deprecated (PlatformName.iOS, 13,0, message: "Use 'Network.framework' instead.")]
[Deprecated (PlatformName.TvOS, 13,0, message: "Use 'Network.framework' instead.")]
[Deprecated (PlatformName.WatchOS, 6,0, message: "Use 'Network.framework' instead.")]
[Deprecated (PlatformName.MacOSX, 10,15, message: Constants.UseNetworkInstead)]
[Deprecated (PlatformName.iOS, 13,0, message: Constants.UseNetworkInstead)]
[Deprecated (PlatformName.TvOS, 13,0, message: Constants.UseNetworkInstead)]
[Deprecated (PlatformName.WatchOS, 6,0, message: Constants.UseNetworkInstead)]
public enum SslAuthenticate {
Never,
Always,
Expand All @@ -209,32 +209,32 @@ public enum SslAuthenticate {

// Security.framework/Headers/SecureTransport.h
// untyped enum
[Deprecated (PlatformName.MacOSX, 10,15, message: "Use 'Network.framework' instead.")]
[Deprecated (PlatformName.iOS, 13,0, message: "Use 'Network.framework' instead.")]
[Deprecated (PlatformName.TvOS, 13,0, message: "Use 'Network.framework' instead.")]
[Deprecated (PlatformName.WatchOS, 6,0, message: "Use 'Network.framework' instead.")]
[Deprecated (PlatformName.MacOSX, 10,15, message: Constants.UseNetworkInstead)]
[Deprecated (PlatformName.iOS, 13,0, message: Constants.UseNetworkInstead)]
[Deprecated (PlatformName.TvOS, 13,0, message: Constants.UseNetworkInstead)]
[Deprecated (PlatformName.WatchOS, 6,0, message: Constants.UseNetworkInstead)]
public enum SslProtocolSide {
Server,
Client,
}

// Security.framework/Headers/SecureTransport.h
// untyped enum
[Deprecated (PlatformName.MacOSX, 10,15, message: "Use 'Network.framework' instead.")]
[Deprecated (PlatformName.iOS, 13,0, message: "Use 'Network.framework' instead.")]
[Deprecated (PlatformName.TvOS, 13,0, message: "Use 'Network.framework' instead.")]
[Deprecated (PlatformName.WatchOS, 6,0, message: "Use 'Network.framework' instead.")]
[Deprecated (PlatformName.MacOSX, 10,15, message: Constants.UseNetworkInstead)]
[Deprecated (PlatformName.iOS, 13,0, message: Constants.UseNetworkInstead)]
[Deprecated (PlatformName.TvOS, 13,0, message: Constants.UseNetworkInstead)]
[Deprecated (PlatformName.WatchOS, 6,0, message: Constants.UseNetworkInstead)]
public enum SslConnectionType {
Stream,
Datagram
}

// Security.framework/Headers/SecureTransport.h
// untyped enum
[Deprecated (PlatformName.MacOSX, 10,15, message: "Use 'Network.framework' instead.")]
[Deprecated (PlatformName.iOS, 13,0, message: "Use 'Network.framework' instead.")]
[Deprecated (PlatformName.TvOS, 13,0, message: "Use 'Network.framework' instead.")]
[Deprecated (PlatformName.WatchOS, 6,0, message: "Use 'Network.framework' instead.")]
[Deprecated (PlatformName.MacOSX, 10,15, message: Constants.UseNetworkInstead)]
[Deprecated (PlatformName.iOS, 13,0, message: Constants.UseNetworkInstead)]
[Deprecated (PlatformName.TvOS, 13,0, message: Constants.UseNetworkInstead)]
[Deprecated (PlatformName.WatchOS, 6,0, message: Constants.UseNetworkInstead)]
public enum SslSessionState {
Invalid = -1,
Idle,
Expand All @@ -246,10 +246,10 @@ public enum SslSessionState {

// Security.framework/Headers/SecureTransport.h
// untyped enum
[Deprecated (PlatformName.MacOSX, 10,15, message: "Use 'Network.framework' instead.")]
[Deprecated (PlatformName.iOS, 13,0, message: "Use 'Network.framework' instead.")]
[Deprecated (PlatformName.TvOS, 13,0, message: "Use 'Network.framework' instead.")]
[Deprecated (PlatformName.WatchOS, 6,0, message: "Use 'Network.framework' instead.")]
[Deprecated (PlatformName.MacOSX, 10,15, message: Constants.UseNetworkInstead)]
[Deprecated (PlatformName.iOS, 13,0, message: Constants.UseNetworkInstead)]
[Deprecated (PlatformName.TvOS, 13,0, message: Constants.UseNetworkInstead)]
[Deprecated (PlatformName.WatchOS, 6,0, message: Constants.UseNetworkInstead)]
public enum SslSessionStrengthPolicy {
Default,
ATSv1,
Expand All @@ -258,10 +258,10 @@ public enum SslSessionStrengthPolicy {

// Security.framework/Headers/SecureTransport.h
// untyped enum
[Deprecated (PlatformName.MacOSX, 10,15, message: "Use 'Network.framework' instead.")]
[Deprecated (PlatformName.iOS, 13,0, message: "Use 'Network.framework' instead.")]
[Deprecated (PlatformName.TvOS, 13,0, message: "Use 'Network.framework' instead.")]
[Deprecated (PlatformName.WatchOS, 6,0, message: "Use 'Network.framework' instead.")]
[Deprecated (PlatformName.MacOSX, 10,15, message: Constants.UseNetworkInstead)]
[Deprecated (PlatformName.iOS, 13,0, message: Constants.UseNetworkInstead)]
[Deprecated (PlatformName.TvOS, 13,0, message: Constants.UseNetworkInstead)]
[Deprecated (PlatformName.WatchOS, 6,0, message: Constants.UseNetworkInstead)]
public enum SslClientCertificateState {
None,
Requested,
Expand Down
10 changes: 5 additions & 5 deletions src/Security/SslConnection.cs
Original file line number Diff line number Diff line change
Expand Up @@ -20,10 +20,10 @@ namespace Security {

delegate SslStatus SslWriteFunc (IntPtr connection, IntPtr data, /* size_t* */ ref nint dataLength);

[Deprecated (PlatformName.MacOSX, 10,15, message: "Use 'Network.framework' instead.")]
[Deprecated (PlatformName.iOS, 13,0, message: "Use 'Network.framework' instead.")]
[Deprecated (PlatformName.TvOS, 13,0, message: "Use 'Network.framework' instead.")]
[Deprecated (PlatformName.WatchOS, 6,0, message: "Use 'Network.framework' instead.")]
[Deprecated (PlatformName.MacOSX, 10,15, message: Constants.UseNetworkInstead)]
[Deprecated (PlatformName.iOS, 13,0, message: Constants.UseNetworkInstead)]
[Deprecated (PlatformName.TvOS, 13,0, message: Constants.UseNetworkInstead)]
[Deprecated (PlatformName.WatchOS, 6,0, message: Constants.UseNetworkInstead)]
public abstract class SslConnection : IDisposable {

GCHandle handle;
Expand Down Expand Up @@ -121,4 +121,4 @@ public unsafe override SslStatus Write (IntPtr data, ref nint dataLength)
return SslStatus.Success;
}
}
}
}
5 changes: 0 additions & 5 deletions tests/xtro-sharpie/MacCatalyst-CoreFoundation.todo
Original file line number Diff line number Diff line change
Expand Up @@ -36,8 +36,3 @@
!missing-pinvoke! CFUserNotificationGetTypeID is not bound
!missing-pinvoke! CFUserNotificationReceiveResponse is not bound
!missing-pinvoke! CFUserNotificationUpdate is not bound
## appended from unclassified file
!deprecated-attribute-missing! CFStreamCreatePairWithPeerSocketSignature missing a [Deprecated] attribute
!deprecated-attribute-missing! CFStreamCreatePairWithSocket missing a [Deprecated] attribute
!deprecated-attribute-missing! CFStreamCreatePairWithSocketToCFHost missing a [Deprecated] attribute
!deprecated-attribute-missing! CFStreamCreatePairWithSocketToHost missing a [Deprecated] attribute
2 changes: 0 additions & 2 deletions tests/xtro-sharpie/MacCatalyst-CoreServices.todo

This file was deleted.

4 changes: 0 additions & 4 deletions tests/xtro-sharpie/iOS-CoreFoundation.todo

This file was deleted.

2 changes: 0 additions & 2 deletions tests/xtro-sharpie/iOS-CoreServices.todo

This file was deleted.

4 changes: 0 additions & 4 deletions tests/xtro-sharpie/macOS-CoreFoundation.todo

This file was deleted.

2 changes: 0 additions & 2 deletions tests/xtro-sharpie/macOS-CoreServices.todo
Original file line number Diff line number Diff line change
@@ -1,5 +1,3 @@
!deprecated-attribute-missing! CFHostCreateWithAddress missing a [Deprecated] attribute
!deprecated-attribute-missing! CFHostCreateWithName missing a [Deprecated] attribute
!deprecated-attribute-missing! LSCopyAllRoleHandlersForContentType missing a [Deprecated] attribute
!deprecated-attribute-missing! LSCopyApplicationURLsForBundleIdentifier missing a [Deprecated] attribute
!deprecated-attribute-missing! LSCopyApplicationURLsForURL missing a [Deprecated] attribute
Expand Down
4 changes: 0 additions & 4 deletions tests/xtro-sharpie/tvOS-CoreFoundation.todo

This file was deleted.

2 changes: 0 additions & 2 deletions tests/xtro-sharpie/tvOS-CoreServices.todo

This file was deleted.

3 changes: 0 additions & 3 deletions tests/xtro-sharpie/watchOS-CoreFoundation.todo

This file was deleted.

8 comments on commit 8d2d06b

@vs-mobiletools-engineering-service2
Copy link
Collaborator

Choose a reason for hiding this comment

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

❌ [CI 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) (no change)
Generator Diff (no change)

Packages generated

View packages

Test results

3 tests failed, 218 tests passed.

Failed tests

  • monotouch-test/Mac Catalyst/Debug [dotnet]: Failed (Tests run: 2622 Passed: 2488 Inconclusive: 35 Failed: 2 Ignored: 132)
  • [NUnit] Mono Mac OS X BCL tests group 1/Mac Full/Debug: Failed (Test run failed.
    Tests run: 6270 Passed: 5253 Inconclusive: 0 Failed: 1 Ignored: 417)
  • introspection/watchOS 32-bits - simulator/Debug (watchOS 5.0): Failed

Pipeline on Agent XAMBOT-1028.BigSur'
[CFNetwork] Add Xcode13 beta 1 support. (#11966)

@vs-mobiletools-engineering-service2
Copy link
Collaborator

Choose a reason for hiding this comment

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

🔥 Tests failed catastrophically on VSTS: device tests tvOS 🔥

Not enough free space in the host.

Pipeline on Agent
[CFNetwork] Add Xcode13 beta 1 support. (#11966)

@vs-mobiletools-engineering-service2
Copy link
Collaborator

Choose a reason for hiding this comment

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

⚠️ Tests were not ran (VSTS: device tests iOS). ⚠️

Results were skipped for this run due to provisioning problems Azure Devops. Please contact the bot administrator.

Pipeline on Agent
[CFNetwork] Add Xcode13 beta 1 support. (#11966)

@vs-mobiletools-engineering-service2
Copy link
Collaborator

Choose a reason for hiding this comment

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

⚠️ Tests were not ran (VSTS: device tests tvOS). ⚠️

Results were skipped for this run due to provisioning problems Azure Devops. Please contact the bot administrator.

Pipeline on Agent
[CFNetwork] Add Xcode13 beta 1 support. (#11966)

@vs-mobiletools-engineering-service2
Copy link
Collaborator

Choose a reason for hiding this comment

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

✅ Tests passed on macOS Mac Catalina (10.15) ✅

Tests passed

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

Pipeline on Agent
[CFNetwork] Add Xcode13 beta 1 support. (#11966)

@vs-mobiletools-engineering-service2
Copy link
Collaborator

Choose a reason for hiding this comment

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

✅ Tests passed on macOS Mac Mojave (10.14) ✅

Tests passed

All tests on macOS X Mac Mojave (10.14) passed.

Pipeline on Agent
[CFNetwork] Add Xcode13 beta 1 support. (#11966)

@vs-mobiletools-engineering-service2
Copy link
Collaborator

Choose a reason for hiding this comment

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

✅ Tests passed on macOS Mac High Sierra (10.13) ✅

Tests passed

All tests on macOS X Mac High Sierra (10.13) passed.

Pipeline on Agent
[CFNetwork] Add Xcode13 beta 1 support. (#11966)

@vs-mobiletools-engineering-service2
Copy link
Collaborator

Choose a reason for hiding this comment

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

⚠️ Tests were not ran (VSTS: device tests iOS32b). ⚠️

Results were skipped for this run due to provisioning problems Azure Devops. Please contact the bot administrator.

Pipeline on Agent
[CFNetwork] Add Xcode13 beta 1 support. (#11966)

Please sign in to comment.