Upgrade min ios version to 13.0 (#20773)

To align with Office and other MS products.
Office's support policy is:
"Office for iPad and iPhone is supported on the two most recent versions
of iOS and iPadOS. When a new version of iOS or iPadOS is released, the
Office Operating System requirement becomes the two most recent
versions: the new version of iOS or iPadOS and the previous version."
(from https://products.office.com/office-system-requirements)

The latest iOS version is 17. So they support both 17 and 16. Here I set
our min iOS version to 13 so that it will be a superset of what Office
supports.

This change would allow us using C++17's std::filesystem feature in the
core framework. The modifications were generated by running
```bash
 find . -type f -exec sed -i "s/apple_deploy_target[ =]12.0/apple_deploy_target=13.0/g"  {} \;
```

Cannot use 15.0 because otherwise iOS packaging would fail with:

```
/Users/runner/work/1/b/apple_framework/intermediates/iphoneos_arm64/Release/_deps/coremltools-src/mlmodel/src/MILBlob/Util/Span.hpp:288:9: error: cannot use 'throw' with exceptions disabled
        MILVerifyIsTrue(index < Size(), std::range_error, "index out of bounds");
```

The Google OSS libraries we use only officially support iOS 15+.
This commit is contained in:
Changming Sun 2024-06-04 10:15:20 -07:00 committed by GitHub
parent c5087b9b58
commit 3dd6fcc089
No known key found for this signature in database
GPG key ID: B5690EEEBB952194
16 changed files with 17 additions and 62 deletions

View file

@ -1,7 +1,7 @@
require_relative '../node_modules/react-native/scripts/react_native_pods'
require_relative '../node_modules/@react-native-community/cli-platform-ios/native_modules'
platform :ios, '12.4'
platform :ios, '13.0'
target 'OnnxruntimeModuleExample' do
config = use_native_modules!

View file

@ -1,7 +1,7 @@
require_relative '../node_modules/react-native/scripts/react_native_pods'
require_relative '../node_modules/@react-native-community/cli-platform-ios/native_modules'
platform :ios, '12.4'
platform :ios, '13.0'
def shared
config = use_native_modules!

View file

@ -15,7 +15,7 @@ Pod::Spec.new do |spec|
spec.license = package["license"]
spec.authors = package["author"]
spec.platforms = { :ios => "12.4" }
spec.platforms = { :ios => "13.0" }
spec.source = { :git => "https://github.com/Microsoft/onnxruntime.git", :tag => "rel-#{spec.version}" }
spec.source_files = "ios/*.{h,mm}"

View file

@ -187,7 +187,7 @@ def parse_args():
os.path.basename(__file__),
description="""Create iOS framework and podspec for one or more osx_archs (xcframework)
and building properties specified in the given build config file, see
tools/ci_build/github/apple/default_mobile_ios_framework_build_settings.json for details.
tools/ci_build/github/apple/default_full_apple_framework_build_settings.json for details.
The output of the final xcframework and podspec can be found under [build_dir]/framework_out.
Please note, this building script will only work on macOS.
""",

View file

@ -28,11 +28,11 @@
],
"iphoneos": [
"--ios",
"--apple_deploy_target=12.0"
"--apple_deploy_target=13.0"
],
"iphonesimulator": [
"--ios",
"--apple_deploy_target=12.0"
"--apple_deploy_target=13.0"
]
}
}

View file

@ -24,13 +24,13 @@
"--ios",
"--use_xcode",
"--use_xnnpack",
"--apple_deploy_target=12.0"
"--apple_deploy_target=13.0"
],
"iphonesimulator": [
"--ios",
"--use_xcode",
"--use_xnnpack",
"--apple_deploy_target=12.0"
"--apple_deploy_target=13.0"
],
"macabi":[
"--macos=Catalyst",

View file

@ -1,34 +0,0 @@
{
"build_osx_archs": {
"iphoneos": [
"arm64"
],
"iphonesimulator": [
"arm64",
"x86_64"
]
},
"build_params": {
"base": [
"--parallel",
"--use_xcode",
"--build_apple_framework",
"--minimal_build=extended",
"--disable_rtti",
"--disable_ml_ops",
"--disable_exceptions",
"--enable_reduced_operator_type_support",
"--use_coreml",
"--skip_tests",
"--cmake_extra_defines=onnxruntime_BUILD_UNIT_TESTS=OFF"
],
"iphoneos": [
"--ios",
"--apple_deploy_target=12.0"
],
"iphonesimulator": [
"--ios",
"--apple_deploy_target=12.0"
]
}
}

View file

@ -25,11 +25,11 @@
],
"iphoneos": [
"--ios",
"--apple_deploy_target=12.0"
"--apple_deploy_target=13.0"
],
"iphonesimulator": [
"--ios",
"--apple_deploy_target=12.0"
"--apple_deploy_target=13.0"
],
"macosx": [
"--macos=MacOSX",

View file

@ -16,7 +16,7 @@
],
"iphonesimulator": [
"--ios",
"--apple_deploy_target=12.0"
"--apple_deploy_target=13.0"
]
}
}

View file

@ -18,7 +18,7 @@ Run the script:
python3 tools/ci_build/github/apple/build_and_assemble_apple_pods.py \
--staging-dir /path/to/staging/dir \
--include-ops-by-config /path/to/custom.config \
--build-settings-file tools/ci_build/github/apple/default_mobile_ios_framework_build_settings.json
--build-settings-file tools/ci_build/github/apple/default_full_apple_framework_build_settings.json
```
This will do a custom build and create the pod package files for it in `/path/to/staging/dir`.

View file

@ -58,7 +58,7 @@ jobs:
--ios \
--apple_sysroot iphonesimulator \
--osx_arch x86_64 \
--apple_deploy_target 12.0 \
--apple_deploy_target=13.0 \
--use_xcode \
--config RelWithDebInfo \
--build_apple_framework \

View file

@ -89,10 +89,6 @@ stages:
displayName: "Set common variables"
name: SetCommonVariables
- template: templates/stages/mac-ios-packaging-build-stage.yml
parameters:
packageVariant: Mobile
- template: templates/stages/mac-ios-packaging-build-stage.yml
parameters:
packageVariant: Full

View file

@ -445,14 +445,14 @@ stages:
python tools/ci_build/github/apple/build_apple_framework.py \
--build_dir "$(Build.BinariesDirectory)/ios_framework" \
--build_dynamic_framework \
tools/ci_build/github/apple/default_mobile_ios_framework_build_settings.json
tools/ci_build/github/apple/default_full_apple_framework_build_settings.json
displayName: "Build iOS dynamic framework"
- script: |
python tools/ci_build/github/apple/test_apple_packages.py \
--framework_info_file "$(Build.BinariesDirectory)/ios_framework/xcframework_info.json" \
--c_framework_dir "$(Build.BinariesDirectory)/ios_framework/framework_out" \
--variant Mobile
--variant Full
displayName: "Test pod with iOS framework"
- stage: IosMinimalTrainingBuild

View file

@ -2,7 +2,6 @@ parameters:
- name: packageVariant
type: string
values:
- Mobile
- Full
- Training
@ -22,12 +21,6 @@ stages:
xcodeVersion: "14.2"
ortPodVersion: $[stageDependencies.IosPackaging_SetCommonVariables.j.outputs['SetCommonVariables.ORT_POD_VERSION']]
${{ if eq(parameters.packageVariant, 'Mobile') }}:
buildSettingsFile: "tools/ci_build/github/apple/default_mobile_ios_framework_build_settings.json"
optionalIncludeOpsByConfigOption: "--include-ops-by-config tools/ci_build/github/android/mobile_package.required_operators.config"
cPodName: onnxruntime-mobile-c
objcPodName: onnxruntime-mobile-objc
${{ if eq(parameters.packageVariant, 'Full') }}:
buildSettingsFile: "tools/ci_build/github/apple/default_full_apple_framework_build_settings.json"
cPodName: onnxruntime-c

View file

@ -14,7 +14,7 @@
],
"iphonesimulator": [
"--ios",
"--apple_deploy_target=12.0"
"--apple_deploy_target=13.0"
]
}
}

View file

@ -19,7 +19,7 @@
],
"iphonesimulator": [
"--ios",
"--apple_deploy_target=12.0"
"--apple_deploy_target=13.0"
]
}
}