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

XCFramework setup #5695

Closed
wants to merge 22 commits into from
Closed

XCFramework setup #5695

wants to merge 22 commits into from

Conversation

mokagio
Copy link
Contributor

@mokagio mokagio commented Apr 22, 2023

WIP

To test:

PR submission checklist:

  • I have considered adding unit tests where possible.
  • I have considered if this change warrants user-facing release notes more info and have added them to RELEASE-NOTES.txt if necessary.

@mokagio mokagio force-pushed the mokagio/ios-xcframework-setup branch from 74fe5db to 1ea5a88 Compare April 22, 2023 12:14
@peril-wordpress-mobile
Copy link

peril-wordpress-mobile bot commented Apr 22, 2023

Wanna run full suite of Android and iOS UI tests? Click here and 'Approve' CI job!

mokagio added 22 commits May 8, 2023 16:29
Done in a dedicated commit, which should help renaming the folder
without conflicts in a rebase.
This was done with the BuildSettingExtractor app,
https://buildsettingextractor.com.

These settings are currently unused.
Done in a dedicated commit to make sure nothing was lost in the process
by checking the diff.
Notice that I had to manually remove `arm64-darwin-21` from
`Gemfile.lock` even though `.bundle/config` has options that should have
prevented it from being added. The good news is that if I run `bundle
install` again, no new entry is added to `PLATFORMS`.
Otherwise, they become a single string and `xcodebuild` doesn't behave
as expected.
Notice how `ENABLE_MODULE_VERIFIER` had to be turned to `NO`.

Otherwise, the build would have failed with the following errors:

```
Showing All Errors Only
VerifyModule /Users/gio/Developer/a8c/gutenberg-mobile/ios-xcframework/DerivedData/XCFrameworkScaffold/Build/Products/Debug-iphonesimulator/Gutenberg.framework (in target 'Gutenberg' from project 'XCFrameworkScaffold')
    cd /Users/gio/Developer/a8c/gutenberg-mobile/ios-xcframework
    /Applications/Xcode.app/Contents/Developer/Toolchains/XcodeDefault.xctoolchain/usr/bin/modules-verifier /Users/gio/Developer/a8c/gutenberg-mobile/ios-xcframework/DerivedData/XCFrameworkScaffold/Build/Products/Debug-iphonesimulator/Gutenberg.framework --clang /Applications/Xcode.app/Contents/Developer/Toolchains/XcodeDefault.xctoolchain/usr/bin/clang --diagnostic-filename-map /Users/gio/Developer/a8c/gutenberg-mobile/ios-xcframework/DerivedData/XCFrameworkScaffold/Build/Intermediates.noindex/XCFrameworkScaffold.build/Debug-iphonesimulator/Gutenberg.build/Gutenberg-diagnostic-filename-map.json --sdk /Applications/Xcode.app/Contents/Developer/Platforms/iPhoneSimulator.platform/Developer/SDKs/iPhoneSimulator16.4.sdk --intermediates-directory /Users/gio/Developer/a8c/gutenberg-mobile/ios-xcframework/DerivedData/XCFrameworkScaffold/Build/Intermediates.noindex/XCFrameworkScaffold.build/Debug-iphonesimulator/Gutenberg.build/VerifyModule --target arm64-apple-ios13.0-simulator --language objective-c --language objective-c++ --standard gnu11 --standard gnu++20

DerivedData/XCFrameworkScaffold/Build/Intermediates.noindex/XCFrameworkScaffold.build/Debug-iphonesimulator/Gutenberg.build/VerifyModule/Gutenberg_objective-c++_arm64-apple-ios13.0-simulator_gnu++20/Test/Test.framework/Headers/Test.h:1:9: error: (fatal) could not build module 'Gutenberg'
DerivedData/XCFrameworkScaffold/Build/Intermediates.noindex/XCFrameworkScaffold.build/Debug-iphonesimulator/Gutenberg.build/VerifyModule/Gutenberg_objective-c_arm64-apple-ios13.0-simulator_gnu11/Test/Test.framework/Headers/Test.h:1:9: error: (fatal) could not build module 'Gutenberg'
DerivedData/XCFrameworkScaffold/Build/Products/Debug-iphonesimulator/Gutenberg.framework/Headers/Gutenberg-Swift.h:264:9: error: (fatal) module 'React' not found

DerivedData/XCFrameworkScaffold/Build/Intermediates.noindex/XCFrameworkScaffold.build/Debug-iphonesimulator/Gutenberg.build/VerifyModule/Gutenberg_objective-c++_arm64-apple-ios13.0-simulator_gnu++20/Test/Test.framework/Headers/Test.h:1:9: (fatal) could not build module 'Gutenberg'

DerivedData/XCFrameworkScaffold/Build/Intermediates.noindex/XCFrameworkScaffold.build/Debug-iphonesimulator/Gutenberg.build/VerifyModule/Gutenberg_objective-c_arm64-apple-ios13.0-simulator_gnu11/Test/Test.framework/Headers/Test.h:1:9: (fatal) could not build module 'Gutenberg'

DerivedData/XCFrameworkScaffold/Build/Products/Debug-iphonesimulator/Gutenberg.framework/Headers/Gutenberg-Swift.h:264:9: (fatal) module 'React' not found
```

That is, during the "Verify Modularization" step, `React` can't be
found.

Disabled the modularization verification was the only "fix" that I could
find. The result of that step doesn't seem to interfere with the ability
to distribute this as an XCFramework and to use it successfully in a
client app.
@mokagio mokagio force-pushed the mokagio/ios-xcframework-setup branch from d22bf5d to 405605d Compare May 8, 2023 06:31
@mokagio
Copy link
Contributor Author

mokagio commented Jun 19, 2023

The experiment bore it's fruit and a production-worthy version is now on trunk. Closing.

@mokagio mokagio closed this Jun 19, 2023
@mokagio mokagio deleted the mokagio/ios-xcframework-setup branch June 19, 2023 04:04
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.

1 participant