Skip to content

Commit adcc379

Browse files
Copilotagockejkoritzinsky
authored
Update macOS minimum version from 12.0 to 14.0, Mac Catalyst to 17.0, and remove obsolete availability checks (#123200)
# Description macOS 12 is out of support. Updated minimum deployment target to 14.0 and Mac Catalyst to 17.0 (which shipped with macOS 14.0 Sonoma) across build configuration, native compilation, installers, and tests. Additionally, removed obsolete runtime availability checks (`__builtin_available` in Objective-C and `@available` in Swift) that are no longer necessary with the new minimum requirements. **Core configuration:** - `Directory.Build.props`: `macOSVersionMin` and `MacCatalystVersionMin` properties - `eng/native/configurecompiler.cmake`: `CMAKE_OSX_DEPLOYMENT_TARGET` and Mac Catalyst compiler targets - `eng/native/build-commons.sh`: Mac Catalyst deployment target **Build targets:** - `src/coreclr/nativeaot/BuildIntegration/Microsoft.NETCore.Native.Unix.targets` - `src/tasks/Crossgen2Tasks/Microsoft.NET.CrossGen.targets` **Mono AOT compilation:** - `src/mono/msbuild/common/MonoAOTCompiler.props`: Mac Catalyst mtriple arguments - `src/mono/msbuild/apple/build/AppleBuild.targets`: Mac Catalyst mtriple arguments **Installers:** - Distribution templates (arm64 and x64): `os-version min` requirement **Tests:** - 8 Swift interop CMakeLists.txt files **Removed obsolete availability checks:** - `src/native/libs/System.Security.Cryptography.Native.Apple/pal_networkframework.m`: Removed checks for macOS 12.3, iOS 15.4, tvOS 15.4 - `src/native/libs/System.Security.Cryptography.Native.Apple/pal_rsa.c`: Removed check for macOS 10.15, iOS 13, tvOS 13 - `src/native/libs/System.Security.Cryptography.Native.Apple/pal_sec.c`: Removed check for iOS 11.3, tvOS 11.3 - `src/native/libs/System.Security.Cryptography.Native.Apple/pal_ecc.c`: Removed check for macOS 10.15, iOS 13, tvOS 13 - `src/native/libs/System.Security.Cryptography.Native.Apple/pal_swiftbindings.swift`: HKDF functions retain `@available(iOS 14, tvOS 14, *)` annotations (macOS annotation removed since HKDF was introduced in macOS 11, below our new minimum) - `src/native/minipal/memorybarrierprocesswide.c`: Removed check for macOS 10.14, iOS 12, tvOS 9 and fallback code - `src/mono/mono/utils/mono-codeman.c`: Removed checks for macOS 11 in write protection functions - `src/mono/mono/utils/mono-mmap.c`: Removed check for macOS 11 in MAP_JIT flag handling # Customer Impact Customers on macOS 12 will no longer be able to run .NET. Customers on Mac Catalyst versions older than 17.0 will also be affected. This aligns with Apple's current support lifecycle. # Regression No. This is a forward-looking change to drop support for an EOL operating system version and align Mac Catalyst with the corresponding macOS release. # Testing Configuration changes updated version constants from 12.0 to 14.0 for macOS across 14 files and from 15.2 to 17.0 for Mac Catalyst across 7 files. Additionally, removed obsolete runtime availability checks across 8 files, simplifying the codebase by eliminating unnecessary fallback code paths for OS versions below the new minimums. HKDF functions retain appropriate `@available` annotations for iOS 14 and tvOS 14 where these APIs are above the minimum supported versions. # Risk Low. Changes consist of version constant updates and removal of obsolete runtime checks for OS versions we no longer support. All updates are consistent and the removed checks were for versions below our new minimums, so the previously guarded code will now always execute. HKDF availability annotations are correctly maintained for iOS and tvOS where needed. <!-- START COPILOT CODING AGENT SUFFIX --> <!-- START COPILOT ORIGINAL PROMPT --> <details> <summary>Original prompt</summary> > The repo currently sets > <macOSVersionMin>12.0</macOSVersionMin>. 12 is out of support. We should update to 14. </details> <!-- START COPILOT CODING AGENT TIPS --> --- 💡 You can make Copilot smarter by setting up custom instructions, customizing its development environment and configuring Model Context Protocol (MCP) servers. Learn more [Copilot coding agent tips](https://gh.io/copilot-coding-agent-tips) in the docs. --------- Co-authored-by: copilot-swe-agent[bot] <198982749+Copilot@users.noreply.github.com> Co-authored-by: agocke <515774+agocke@users.noreply.github.com> Co-authored-by: jkoritzinsky <1571408+jkoritzinsky@users.noreply.github.com>
1 parent b19edc0 commit adcc379

18 files changed

Lines changed: 57 additions & 74 deletions

File tree

Directory.Build.props

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -42,8 +42,8 @@
4242
<AndroidApiLevelMin>21</AndroidApiLevelMin>
4343
<iOSVersionMin>13.0</iOSVersionMin>
4444
<tvOSVersionMin>13.0</tvOSVersionMin>
45-
<macOSVersionMin>12.0</macOSVersionMin>
46-
<MacCatalystVersionMin>15.2</MacCatalystVersionMin>
45+
<macOSVersionMin>14.0</macOSVersionMin>
46+
<MacCatalystVersionMin>17.0</MacCatalystVersionMin>
4747
</PropertyGroup>
4848

4949
<PropertyGroup>

eng/native/build-commons.sh

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -93,7 +93,7 @@ build_native()
9393

9494
# set default macCatalyst deployment target
9595
# keep in sync with SetOSTargetMinVersions in the root Directory.Build.props
96-
cmakeArgs="-DCMAKE_SYSTEM_NAME=Darwin -DCMAKE_OSX_SYSROOT=macosx -DCMAKE_SYSTEM_VARIANT=maccatalyst -DCMAKE_OSX_DEPLOYMENT_TARGET=15.2 $cmakeArgs"
96+
cmakeArgs="-DCMAKE_SYSTEM_NAME=Darwin -DCMAKE_OSX_SYSROOT=macosx -DCMAKE_SYSTEM_VARIANT=maccatalyst -DCMAKE_OSX_DEPLOYMENT_TARGET=17.0 $cmakeArgs"
9797
fi
9898

9999
if [[ "$targetOS" == android || "$targetOS" == linux-bionic ]]; then

eng/native/configurecompiler.cmake

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -713,10 +713,10 @@ if (CLR_CMAKE_HOST_UNIX OR CLR_CMAKE_HOST_WASI)
713713
endif()
714714
add_link_options(${DISABLE_OVERRIDING_MIN_VERSION_ERROR})
715715
if(CLR_CMAKE_HOST_ARCH_ARM64)
716-
set(CLR_CMAKE_MACCATALYST_COMPILER_TARGET "arm64-apple-ios15.2-macabi")
716+
set(CLR_CMAKE_MACCATALYST_COMPILER_TARGET "arm64-apple-ios17.0-macabi")
717717
add_link_options(-target ${CLR_CMAKE_MACCATALYST_COMPILER_TARGET})
718718
elseif(CLR_CMAKE_HOST_ARCH_AMD64)
719-
set(CLR_CMAKE_MACCATALYST_COMPILER_TARGET "x86_64-apple-ios15.2-macabi")
719+
set(CLR_CMAKE_MACCATALYST_COMPILER_TARGET "x86_64-apple-ios17.0-macabi")
720720
add_link_options(-target ${CLR_CMAKE_MACCATALYST_COMPILER_TARGET})
721721
else()
722722
clr_unknown_arch()
@@ -730,7 +730,7 @@ if (CLR_CMAKE_HOST_UNIX OR CLR_CMAKE_HOST_WASI)
730730
set(CMAKE_OBJC_FLAGS "${CMAKE_OBJC_FLAGS}-target ${CLR_CMAKE_MACCATALYST_COMPILER_TARGET} ${DISABLE_OVERRIDING_MIN_VERSION_ERROR}")
731731
set(CMAKE_OBJCXX_FLAGS "${CMAKE_OBJCXX_FLAGS} -target ${CLR_CMAKE_MACCATALYST_COMPILER_TARGET} ${DISABLE_OVERRIDING_MIN_VERSION_ERROR}")
732732
elseif(CLR_CMAKE_HOST_OSX)
733-
set(CMAKE_OSX_DEPLOYMENT_TARGET "12.0")
733+
set(CMAKE_OSX_DEPLOYMENT_TARGET "14.0")
734734
if(CLR_CMAKE_HOST_ARCH_ARM64)
735735
add_compile_options(-arch arm64)
736736
elseif(CLR_CMAKE_HOST_ARCH_AMD64)

src/coreclr/nativeaot/BuildIntegration/Microsoft.NETCore.Native.Unix.targets

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -79,7 +79,7 @@ The .NET Foundation licenses this file to you under the MIT license.
7979
</PropertyGroup>
8080

8181
<PropertyGroup Condition="'$(_IsiOSLikePlatform)' == 'true'">
82-
<AppleMinOSVersion Condition="'$(AppleMinOSVersion)' == '' and '$(_targetOS)' == 'maccatalyst'">15.2</AppleMinOSVersion>
82+
<AppleMinOSVersion Condition="'$(AppleMinOSVersion)' == '' and '$(_targetOS)' == 'maccatalyst'">17.0</AppleMinOSVersion>
8383
<AppleMinOSVersion Condition="'$(AppleMinOSVersion)' == '' and ($(_targetOS.StartsWith('ios')) or $(_targetOS.StartsWith('tvos')))">13.0</AppleMinOSVersion>
8484

8585
<_AppleSdkName Condition="'$(_targetOS)' == 'ios'">iphoneos</_AppleSdkName>
@@ -99,7 +99,7 @@ The .NET Foundation licenses this file to you under the MIT license.
9999
</PropertyGroup>
100100

101101
<PropertyGroup Condition="'$(_targetOS)' == 'osx'">
102-
<AppleMinOSVersion Condition="'$(AppleMinOSVersion)' == ''">12.0</AppleMinOSVersion>
102+
<AppleMinOSVersion Condition="'$(AppleMinOSVersion)' == ''">14.0</AppleMinOSVersion>
103103
<TargetTriple Condition="'$(_targetArchitecture)' == 'x64'">x86_64-apple-macos$(AppleMinOSVersion)</TargetTriple>
104104
<TargetTriple Condition="'$(_targetArchitecture)' == 'arm64'">arm64-apple-macos$(AppleMinOSVersion)</TargetTriple>
105105
</PropertyGroup>

src/installer/pkg/sfx/bundle/shared-framework-distribution-template-arm64.xml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -7,7 +7,7 @@
77
<volume-check>
88
<allowed-os-versions>
99
<!-- keep in sync with SetOSTargetMinVersions in the root Directory.Build.props -->
10-
<os-version min="12.0" />
10+
<os-version min="14.0" />
1111
</allowed-os-versions>
1212
</volume-check>
1313
</installer-gui-script>

src/installer/pkg/sfx/bundle/shared-framework-distribution-template-x64.xml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -7,7 +7,7 @@
77
<volume-check>
88
<allowed-os-versions>
99
<!-- keep in sync with SetOSTargetMinVersions in the root Directory.Build.props -->
10-
<os-version min="12.0" />
10+
<os-version min="14.0" />
1111
</allowed-os-versions>
1212
</volume-check>
1313
</installer-gui-script>

src/mono/msbuild/apple/build/AppleBuild.targets

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -175,9 +175,9 @@
175175

176176
<ItemGroup>
177177
<MonoAOTCompilerDefaultAotArguments Condition="'$(TargetArchitecture)' == 'arm64' and '$(TargetOS)' != 'maccatalyst'" Include="mtriple=arm64-ios" />
178-
<MonoAOTCompilerDefaultAotArguments Condition="'$(TargetArchitecture)' == 'arm64' and '$(TargetOS)' == 'maccatalyst'" Include="mtriple=arm64-apple-ios15.2-macabi" />
178+
<MonoAOTCompilerDefaultAotArguments Condition="'$(TargetArchitecture)' == 'arm64' and '$(TargetOS)' == 'maccatalyst'" Include="mtriple=arm64-apple-ios17.0-macabi" />
179179
<MonoAOTCompilerDefaultAotArguments Condition="'$(TargetArchitecture)' == 'x64' and '$(TargetOS)' != 'maccatalyst'" Include="mtriple=x86_64-ios" />
180-
<MonoAOTCompilerDefaultAotArguments Condition="'$(TargetArchitecture)' == 'x64' and '$(TargetOS)' == 'maccatalyst'" Include="mtriple=x86_64-apple-ios15.2-macabi" />
180+
<MonoAOTCompilerDefaultAotArguments Condition="'$(TargetArchitecture)' == 'x64' and '$(TargetOS)' == 'maccatalyst'" Include="mtriple=x86_64-apple-ios17.0-macabi" />
181181
<MonoAOTCompilerDefaultAotArguments Include="static" />
182182
<MonoAOTCompilerDefaultAotArguments Include="dwarfdebug" />
183183
<MonoAOTCompilerDefaultAotArguments Condition="'$(TargetArchitecture)' == 'arm64'" Include="mattr=+crc" /> <!-- enable System.Runtime.Intrinsics.Arm (Crc32 and ArmBase for now) -->

src/mono/msbuild/common/MonoAOTCompiler.props

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,9 +1,9 @@
11
<Project>
22
<ItemGroup Condition="'$(TargetOS)' == 'ios' or '$(TargetOS)' == 'iossimulator' or '$(TargetOS)' == 'tvos' or '$(TargetOS)' == 'tvossimulator' or '$(TargetOS)' == 'maccatalyst'">
33
<MonoAOTCompilerDefaultAotArguments Condition="'$(TargetArchitecture)' == 'arm64' and '$(TargetOS)' != 'maccatalyst'" Include="mtriple=arm64-ios" />
4-
<MonoAOTCompilerDefaultAotArguments Condition="'$(TargetArchitecture)' == 'arm64' and '$(TargetOS)' == 'maccatalyst'" Include="mtriple=arm64-apple-ios15.2-macabi" />
4+
<MonoAOTCompilerDefaultAotArguments Condition="'$(TargetArchitecture)' == 'arm64' and '$(TargetOS)' == 'maccatalyst'" Include="mtriple=arm64-apple-ios17.0-macabi" />
55
<MonoAOTCompilerDefaultAotArguments Condition="'$(TargetArchitecture)' == 'x64' and '$(TargetOS)' != 'maccatalyst'" Include="mtriple=x86_64-ios" />
6-
<MonoAOTCompilerDefaultAotArguments Condition="'$(TargetArchitecture)' == 'x64' and '$(TargetOS)' == 'maccatalyst'" Include="mtriple=x86_64-apple-ios15.2-macabi" />
6+
<MonoAOTCompilerDefaultAotArguments Condition="'$(TargetArchitecture)' == 'x64' and '$(TargetOS)' == 'maccatalyst'" Include="mtriple=x86_64-apple-ios17.0-macabi" />
77
<MonoAOTCompilerDefaultAotArguments Condition="'$(TargetArchitecture)' == 'arm64'" Include="mattr=+crc" /> <!-- enable System.Runtime.Intrinsics.Arm (Crc32 and ArmBase for now) -->
88
<!--<MonoAOTCompilerDefaultAotArguments Include="direct-pinvoke" />--> <!-- TODO: enable direct-pinvokes (to get rid of -force_loads)-->
99
</ItemGroup>

src/native/libs/System.Security.Cryptography.Native.Apple/pal_networkframework.m

Lines changed: 33 additions & 50 deletions
Original file line numberDiff line numberDiff line change
@@ -51,30 +51,24 @@
5151
{
5252
void* ptr = NULL;
5353

54-
if (__builtin_available(macOS 12.3, iOS 15.4, tvOS 15.4, watchOS 8.4, *))
55-
{
56-
nw_protocol_options_t framer_options = nw_framer_copy_options(framer);
57-
assert(framer_options != NULL);
54+
nw_protocol_options_t framer_options = nw_framer_copy_options(framer);
55+
assert(framer_options != NULL);
5856

59-
NSNumber* num = nw_framer_options_copy_object_value(framer_options, MANAGED_CONTEXT_KEY);
60-
assert(num != NULL);
61-
[num getValue:&ptr];
62-
[num release];
57+
NSNumber* num = nw_framer_options_copy_object_value(framer_options, MANAGED_CONTEXT_KEY);
58+
assert(num != NULL);
59+
[num getValue:&ptr];
60+
[num release];
6361

64-
nw_release(framer_options);
65-
}
62+
nw_release(framer_options);
6663

6764
return ptr;
6865
}
6966

7067
static void FramerOptionsSetManagedContext(nw_protocol_options_t framer_options, void* context)
7168
{
72-
if (__builtin_available(macOS 12.3, iOS 15.4, tvOS 15.4.0, watchOS 8.4, *))
73-
{
74-
NSNumber *ref = [NSNumber numberWithLong:(long)context];
75-
nw_framer_options_set_object_value(framer_options, MANAGED_CONTEXT_KEY, ref);
76-
[ref release];
77-
}
69+
NSNumber *ref = [NSNumber numberWithLong:(long)context];
70+
nw_framer_options_set_object_value(framer_options, MANAGED_CONTEXT_KEY, ref);
71+
[ref release];
7872
}
7973

8074
static tls_protocol_version_t PalSslProtocolToTlsProtocolVersion(PAL_SslProtocol palProtocolId)
@@ -313,23 +307,17 @@ PALEXPORT nw_connection_t AppleCryptoNative_NwConnectionCreate(int32_t isServer,
313307
// This writes encrypted TLS frames to the safe handle. It is executed on NW Thread pool
314308
static nw_framer_output_handler_t framer_output_handler = ^(nw_framer_t framer, nw_framer_message_t message, size_t message_length, bool is_complete)
315309
{
316-
if (__builtin_available(macOS 12.3, iOS 15.4, tvOS 15.4, watchOS 2.0, *))
317-
{
318-
void* context = FramerGetManagedContext(framer);
319-
size_t size = message_length;
310+
void* context = FramerGetManagedContext(framer);
311+
size_t size = message_length;
320312

321-
nw_framer_parse_output(framer, 1, message_length, NULL, ^size_t(uint8_t *buffer, size_t buffer_length, bool is_complete2)
322-
{
323-
(_writeFunc)(context, buffer, buffer_length);
324-
(void)is_complete2;
325-
(void)message;
326-
return buffer_length;
327-
});
328-
}
329-
else
313+
nw_framer_parse_output(framer, 1, message_length, NULL, ^size_t(uint8_t *buffer, size_t buffer_length, bool is_complete2)
330314
{
331-
assert(0);
332-
}
315+
(_writeFunc)(context, buffer, buffer_length);
316+
(void)is_complete2;
317+
(void)message;
318+
return buffer_length;
319+
});
320+
333321
(void)is_complete;
334322
};
335323

@@ -584,23 +572,18 @@ PALEXPORT int32_t AppleCryptoNative_Init(StatusUpdateCallback statusFunc, WriteC
584572
assert(statusFunc != NULL);
585573
assert(writeFunc != NULL);
586574

587-
if (__builtin_available(macOS 12.3, iOS 15.4, tvOS 15.4.0, watchOS 8.4, *))
588-
{
589-
_writeFunc = writeFunc;
590-
_statusFunc = statusFunc;
591-
_challengeFunc = challengeFunc;
592-
_framerDefinition = nw_framer_create_definition("com.dotnet.networkframework.tlsframer",
593-
NW_FRAMER_CREATE_FLAGS_DEFAULT, framer_start);
594-
_tlsDefinition = nw_protocol_copy_tls_definition();
595-
_tlsQueue = dispatch_queue_create("com.dotnet.networkframework.tlsqueue", NULL);
596-
_inputQueue = _tlsQueue;
597-
598-
// The endpoint values (127.0.0.1:42) are arbitrary - they just need to be
599-
// syntactically and semantically valid since the connection is never established.
600-
_endpoint = nw_endpoint_create_host("127.0.0.1", "42");
601-
602-
return 0;
603-
}
604-
605-
return 1;
575+
_writeFunc = writeFunc;
576+
_statusFunc = statusFunc;
577+
_challengeFunc = challengeFunc;
578+
_framerDefinition = nw_framer_create_definition("com.dotnet.networkframework.tlsframer",
579+
NW_FRAMER_CREATE_FLAGS_DEFAULT, framer_start);
580+
_tlsDefinition = nw_protocol_copy_tls_definition();
581+
_tlsQueue = dispatch_queue_create("com.dotnet.networkframework.tlsqueue", NULL);
582+
_inputQueue = _tlsQueue;
583+
584+
// The endpoint values (127.0.0.1:42) are arbitrary - they just need to be
585+
// syntactically and semantically valid since the connection is never established.
586+
_endpoint = nw_endpoint_create_host("127.0.0.1", "42");
587+
588+
return 0;
606589
}

src/tasks/Crossgen2Tasks/Microsoft.NET.CrossGen.targets

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -556,8 +556,8 @@ Copyright (c) .NET Foundation. All rights reserved.
556556
</PropertyGroup>
557557

558558
<PropertyGroup>
559-
<AppleMinOSVersion Condition="'$(AppleMinOSVersion)' == '' and '$(_AppleTargetOS)' == 'osx'">12.0</AppleMinOSVersion>
560-
<AppleMinOSVersion Condition="'$(AppleMinOSVersion)' == '' and '$(_AppleTargetOS)' == 'maccatalyst'">15.2</AppleMinOSVersion>
559+
<AppleMinOSVersion Condition="'$(AppleMinOSVersion)' == '' and '$(_AppleTargetOS)' == 'osx'">14.0</AppleMinOSVersion>
560+
<AppleMinOSVersion Condition="'$(AppleMinOSVersion)' == '' and '$(_AppleTargetOS)' == 'maccatalyst'">17.0</AppleMinOSVersion>
561561
<AppleMinOSVersion Condition="'$(AppleMinOSVersion)' == '' and ($(_AppleTargetOS.StartsWith('ios')) or $(_AppleTargetOS.StartsWith('tvos')))">13.0</AppleMinOSVersion>
562562

563563
<_AppleSdkName Condition="'$(_AppleTargetOS)' == 'ios'">iphoneos</_AppleSdkName>

0 commit comments

Comments
 (0)