Skip to content

Move iOS package from framework to xcframework #8198

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

Closed
wants to merge 3 commits into from

Conversation

guoyu-wang
Copy link
Contributor

Description: Move iOS package from framework to xcframework

Motivation and Context

  • If we use framework, we cannot ship arm64 arch for both iphoneos and iphonesimulator at the same time due to the limitation of the framework, switch to xcframework for future release package
  • This probably will need some additional changes in the objc package
  • The E2E test was updated using framework or xcframework, (but not both at same time)

@guoyu-wang guoyu-wang requested a review from a team as a code owner June 30, 2021 01:46

# the actual build process for current arch
subprocess.run(build_command, shell=False, check=True, cwd=REPO_DIR)
# subprocess.run(build_command, shell=False, check=True, cwd=REPO_DIR)
Copy link
Contributor

Choose a reason for hiding this comment

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

uncomment this?

Copy link
Contributor Author

Choose a reason for hiding this comment

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

Uncommented, also removed some other print(...)

framework_path = os.path.join(c_framework_dir, 'onnxruntime.framework')
if not pathlib.Path(framework_path).exists():
raise FileNotFoundError('{} does not have onnxruntime.framework'.format(c_framework_dir))
has_framework = pathlib.Path(os.path.join(c_framework_dir, 'onnxruntime.framework')).exists()
Copy link
Contributor

Choose a reason for hiding this comment

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

has_framework

why do we still want to support the old style here?

Copy link
Contributor Author

Choose a reason for hiding this comment

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

For now I don't think cmake can generate xcframework by itself, will still keep the framework for individual ABI, since we will also need it go generate xcframework

@@ -56,6 +64,7 @@ def _test_ios_packages(args):

# replace the target strings
file_data = file_data.replace('${ORT_BASE_FRAMEWORK_ARCHIVE}', 'file:' + zip_file_path)
file_data = file_data.replace('${ORT_FRAMEWORK_NAME}', framework_name)
Copy link
Contributor

@edgchen1 edgchen1 Jun 30, 2021

Choose a reason for hiding this comment

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

file_data

could potentially specify the local pod directory in the Podfile
https://guides.cocoapods.org/using/the-podfile.html#using-the-files-from-a-folder-local-to-the-machine
then perhaps we could just have one podspec
just an idea - not necessarily for this PR

Copy link
Contributor Author

Choose a reason for hiding this comment

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

Will do in a future PR

@edgchen1
Copy link
Contributor

do these changes work with the iOS packaging pipeline? maybe that will show what objc package changes may be needed.

@guoyu-wang
Copy link
Contributor Author

Opened a new one #8805, closing this one since the code has changed a lot after this PR and it is hard to merge.

@guoyu-wang guoyu-wang closed this Aug 21, 2021
@guoyu-wang guoyu-wang deleted the gwang-msft/ios_xcframework branch September 14, 2021 01:37
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants