-
Notifications
You must be signed in to change notification settings - Fork 29.7k
Set DEFINES_MODULE=YES in plugin templates #41828
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
Conversation
|
It looks like this pull request may not have tests. Please make sure to add tests before merging. While there are exceptions to this rule, if this patch modifies code it is probably not an exception. Reviewers: Read the Tree Hygiene page and make sure this patch meets those guidelines before LGTMing. |
[plugin_lint_mac] [STDOUT]
[plugin_lint_mac] [STDOUT]
[plugin_lint_mac] [STDOUT] ══════════════╡ ••• Lint Objective-C iOS plugin as framework ••• ╞══════════════
[plugin_lint_mac] [STDOUT]
[plugin_lint_mac] [STDOUT]
[plugin_lint_mac] [STDOUT] Executing: pod lib lint /var/folders/mv/qlhc4vsj6tqct166rw3zwmth00mfq2/T/flutter_plugin_test.xD49g7/test_plugin_objc/ios/test_plugin_objc.podspec --allow-warnings
[plugin_lint_mac] [STDOUT] stdout:
[plugin_lint_mac] [STDOUT] stdout: -> test_plugin_objc
[plugin_lint_mac] [STDOUT] stdout: -> test_plugin_objc (0.0.1)
[plugin_lint_mac] [STDOUT] stdout: - WARN | license: Missing license type.
[plugin_lint_mac] [STDOUT] stdout: - WARN | description: The description is equal to the summary.
[plugin_lint_mac] [STDOUT] stdout: - WARN | [iOS] keys: Missing primary key for `source` attribute. The acceptable ones are: `git, hg, http, svn`.
[plugin_lint_mac] [STDOUT] stdout: - NOTE | xcodebuild: note: Using new build system
[plugin_lint_mac] [STDOUT] stdout: - NOTE | [iOS] xcodebuild: note: Planning build
[plugin_lint_mac] [STDOUT] stdout: - NOTE | [iOS] xcodebuild: note: Constructing build description
[plugin_lint_mac] [STDOUT] stdout: - NOTE | [iOS] xcodebuild: ld: warning: ignoring file /Users/m/Library/Developer/Xcode/DerivedData/App-aycfmfvsahumpbfprgugltlwsvlz/Build/Products/Release-iphonesimulator/test_plugin_objc/test_plugin_objc.framework/test_plugin_objc, building for iOS Simulator-i386 but attempting to link with file built for iOS Simulator-x86_64
[plugin_lint_mac] [STDOUT] stdout: - NOTE | [iOS] xcodebuild: ld: warning: ignoring file Flutter/Flutter.framework/Flutter, missing required architecture i386 in file Flutter/Flutter.framework/Flutter (3 slices)
[plugin_lint_mac] [STDOUT] stdout: - NOTE | [iOS] xcodebuild: warning: Skipping code signing because the target does not have an Info.plist file and one is not being generated automatically. (in target 'App' from project 'App')
[plugin_lint_mac] [STDOUT] stdout:
[plugin_lint_mac] [STDOUT] stdout: test_plugin_objc passed validation.
[plugin_lint_mac] [STDOUT] "pod" exit code: 0
[plugin_lint_mac] [STDOUT]
[plugin_lint_mac] [STDOUT]
[plugin_lint_mac] [STDOUT] ═══════════════╡ ••• Lint Objective-C iOS plugin as library ••• ╞═══════════════
[plugin_lint_mac] [STDOUT]
[plugin_lint_mac] [STDOUT]
[plugin_lint_mac] [STDOUT] Executing: pod lib lint /var/folders/mv/qlhc4vsj6tqct166rw3zwmth00mfq2/T/flutter_plugin_test.xD49g7/test_plugin_objc/ios/test_plugin_objc.podspec --allow-warnings --use-libraries
[plugin_lint_mac] [STDOUT] stdout:
[plugin_lint_mac] [STDOUT] stdout: -> test_plugin_objc
[plugin_lint_mac] [STDOUT] stdout: -> test_plugin_objc (0.0.1)
[plugin_lint_mac] [STDOUT] stdout: - WARN | license: Missing license type.
[plugin_lint_mac] [STDOUT] stdout: - WARN | description: The description is equal to the summary.
[plugin_lint_mac] [STDOUT] stdout: - WARN | [iOS] keys: Missing primary key for `source` attribute. The acceptable ones are: `git, hg, http, svn`.
[plugin_lint_mac] [STDOUT] stdout: - NOTE | xcodebuild: note: Using new build system
[plugin_lint_mac] [STDOUT] stdout: - NOTE | [iOS] xcodebuild: note: Planning build
[plugin_lint_mac] [STDOUT] stdout: - NOTE | [iOS] xcodebuild: note: Constructing build description
[plugin_lint_mac] [STDOUT] stdout: - NOTE | [iOS] xcodebuild: warning: Skipping code signing because the target does not have an Info.plist file and one is not being generated automatically. (in target 'App' from project 'App')
[plugin_lint_mac] [STDOUT] stdout: - NOTE | [iOS] xcodebuild: ld: warning: ignoring file /Users/m/Library/Developer/Xcode/DerivedData/App-cpheslfzecttzkbjakovdldlcjsw/Build/Products/Release-iphonesimulator/test_plugin_objc/libtest_plugin_objc.a, building for iOS Simulator-i386 but attempting to link with file built for iOS Simulator-x86_64
[plugin_lint_mac] [STDOUT] stdout: - NOTE | [iOS] xcodebuild: ld: warning: ignoring file Flutter/Flutter.framework/Flutter, missing required architecture i386 in file Flutter/Flutter.framework/Flutter (3 slices)
[plugin_lint_mac] [STDOUT] stdout:
[plugin_lint_mac] [STDOUT] stdout: test_plugin_objc passed validation.
[plugin_lint_mac] [STDOUT] "pod" exit code: 0
[plugin_lint_mac] [STDOUT]
[plugin_lint_mac] [STDOUT] This is CocoaPods/CocoaPods#9210. Essentially it's trying to build Release against the i386 simulator, and failing. This is caused because ONLY_ACTIVE_ARCH=NO in Release and Flutter.framework doesn't have i386 bits. |
|
Also note: DEFINES_MODULE=YES by default when I make a new Obj-C or Swift framework in Xcode 11. |
dnfield
left a comment
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
LGTM
Codecov Report
@@ Coverage Diff @@
## master #41828 +/- ##
==========================================
- Coverage 59.25% 58.41% -0.84%
==========================================
Files 193 194 +1
Lines 18882 18934 +52
==========================================
- Hits 11188 11061 -127
- Misses 7694 7873 +179
Continue to review full report at Codecov.
|
zanderso
left a comment
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
The PR description has some good info in it that sounds like it would be useful to have as comments in the code as well.
dev/bots/test.dart
Outdated
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Is there an issue filed for this TODO?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I'll add a comment for |
Codecov Report
@@ Coverage Diff @@
## master #41828 +/- ##
==========================================
- Coverage 59.25% 58.41% -0.84%
==========================================
Files 193 194 +1
Lines 18882 18934 +52
==========================================
- Hits 11188 11061 -127
- Misses 7694 7873 +179
Continue to review full report at Codecov.
|
|
Merging, dashboard is lying, Cirrus is really green. |
|
FWIW, I would rather we not add more "devicelab" tests that don't run in the device lab. It's very confusing that we have tests that claim to run in one environment but run in another. |
Gotcha, I was keeping it consistent with module_test_ios. I can move it wherever you want. |
Description
platformto iOS so tests don't run (and fail) for macOS.DEFINES_MODULEin the podspec. See CocoaPod modular headers docs. DEFINES_MODULE=YES by default when I make a new Obj-C or Swift framework in Xcode 11.VALID_ARCHSto x86_64 for the simulator. This is the CocoaPods-suggested workaround to prevent tests from running on the i386 simulator. See Fix linting when armv7 is included but i386 isn't CocoaPods/CocoaPods#8159.Flutter.framework doesn't include i386 and ONLY_ACTIVE_ARCH=NO on Release means Xcode will try to run the i386 simulator. Limit it to x86_64 on the simulator No way to add passing test_spec that doesn't cause build warning "Mapping architecture armv7 to i386. Ensure that this target's Architectures and Valid Architectures build settings are configured correctly for the iOS Simulator platform" CocoaPods/CocoaPods#9210. Not necessary on macOS since there is no simulator!
Related Issues
Fixes #41801
See also #41007.
Tests
I added the following tests:
pod lib lintfor Objective-C plugins.you may ask. Anything importing Swift plugins does not build when ONLY_ACTIVE_ARCH=NO (the default in Release) and a simulator is targeted since there is no i386 bits in the Flutter.framework. This was true before this patch since Flutter doesn't run in Release on the simulator. In any case, the Swift import doesn't build in Release, though I'm not really sure why it works for Objc.
Checklist
Before you create this PR confirm that it meets all requirements listed below by checking the relevant checkboxes (
[x]). This will ensure a smooth and quick review process.///).flutter analyze --flutter-repo) does not report any problems on my PR.Breaking Change
Does your PR require Flutter developers to manually update their apps to accommodate your change?