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

ci(builds): CocoaPods install without Flipper #6955

Closed
wants to merge 8 commits into from

Conversation

leotm
Copy link
Contributor

@leotm leotm commented Aug 2, 2023

Development & PR Process

  1. Follow MetaMask Mobile Coding Standards
  2. Add release-xx label to identify the PR slated for a upcoming release (will be used in release discussion)
  3. Add needs-dev-review label when work is completed
  4. Add the appropiate QA label when dev review is completed
    • needs-qa: PR requires manual QA.
    • No QA/E2E only: PR does not require any manual QA effort. Prior to merging, ensure that you have successful end-to-end test runs in Bitrise.
    • Spot check on release build: PR does not require feature QA but needs non-automated verification. In the description section, provide test scenarios. Add screenshots, and or recordings of what was tested.
  5. Add QA Passed label when QA has signed off (Only required if the PR was labeled with needs-qa)
  6. Add your team's label, i.e. label starting with team- (or external-contributor label if your not a MetaMask employee)

Description

Follow-up

Changes

  • Remove cocoapods-install@2 steps that don't support custom flags like NO_FLIPPER=1
  • Replace with scripts that pod install without Flipper

Refs

Docs

Screenshots/Recordings

If applicable, add screenshots and/or recordings to visualize the before and after of your change

Issue

fixes #facebook/flipper#4278

Checklist

  • There is a related GitHub issue
  • Tests are included if applicable
  • Any added code is fully documented

@github-actions
Copy link
Contributor

github-actions bot commented Aug 2, 2023

CLA Signature Action: All authors have signed the CLA. You may need to manually re-run the blocking PR check if it doesn't pass in a few minutes.

Copy link
Contributor Author

@leotm leotm left a comment

Choose a reason for hiding this comment

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

Improvement: make this script a BitRise step re-used 3x

@leotm
Copy link
Contributor Author

leotm commented Aug 2, 2023

build_ios_release test run: https://app.bitrise.io/build/dad06dbb-1846-46bd-9a18-d13d952c1c72 ✅ no bottlenecks
edit: false positive result, iOS Sourcemaps & Build actually failing after 6m, so IPA failing deploy


ios_e2e_test test run: https://app.bitrise.io/build/bdd96ae0-d077-4cbc-b9d2-cb8696b9eb68 2 bottlenecks now 1 bottleneck after re-build :suspect:

# logs
# ...
CompileC /Users/vagrant/git/ios/build/Build/Intermediates.noindex/Pods.build/Debug-iphonesimulator/React-Core.build/Objects-normal/x86_64/RCTAppSetupUtils.o /Users/vagrant/git/node_modules/react-native/React/AppSetup/RCTAppSetupUtils.mm normal x86_64 objective-c++ com.apple.compilers.llvm.clang.1_0.compiler (in target 'React-Core' from project 'Pods')
    cd /Users/vagrant/git/ios/Pods
    /Applications/Xcode-14.2.0.app/Contents/Developer/Toolchains/XcodeDefault.xctoolchain/usr/bin/clang -x objective-c++ -target x86_64-apple-ios12.4-simulator -fmessage-length\=0 -fdiagnostics-show-note-include-stack -fmacro-backtrace-limit\=0 -std\=c++1z -stdlib\=libc++ -fobjc-arc -fmodules -fmodules-cache-path\=/Users/vagrant/git/ios/build/ModuleCache.noindex -fmodules-prune-interval\=86400 -fmodules-prune-after\=345600 -fbuild-session-file\=/Users/vagrant/git/ios/build/ModuleCache.noindex/Session.modulevalidation -fmodules-validate-once-per-build-session -Wnon-modular-include-in-framework-module -Werror\=non-modular-include-in-framework-module -fmodule-name\=React -Wno-trigraphs -fpascal-strings -O0 -fno-common -Wno-missing-field-initializers -Wno-missing-prototypes -Werror\=return-type -Wdocumentation -Wunreachable-code -Wno-implicit-atomic-properties -Werror\=deprecated-objc-isa-usage -Wno-objc-interface-ivars -Werror\=objc-root-class -Wno-arc-repeated-use-of-weak -Wimplicit-retain-self -Wno-non-virtual-dtor -Wno-overloaded-virtual -Wno-exit-time-destructors -Wduplicate-method-match -Wno-missing-braces -Wparentheses -Wswitch -Wunused-function -Wno-unused-label -Wno-unused-parameter -Wunused-variable -Wunused-value -Wempty-body -Wuninitialized -Wconditional-uninitialized -Wno-unknown-pragmas -Wno-shadow -Wno-four-char-constants -Wno-conversion -Wconstant-conversion -Wint-conversion -Wbool-conversion -Wenum-conversion -Wno-float-conversion -Wnon-literal-null-conversion -Wobjc-literal-conversion -Wshorten-64-to-32 -Wno-newline-eof -Wno-selector -Wno-strict-selector-match -Wundeclared-selector -Wdeprecated-implementations -Wno-c++11-extensions -Wno-implicit-fallthrough -DPOD_CONFIGURATION_DEBUG\=1 -DDEBUG\=1 -DCOCOAPODS\=1 -DRCT_METRO_PORT\= -DFB_SONARKIT_ENABLED\=1 -DOBJC_OLD_DISPATCH_PROTOTYPES\=0 -isysroot /Applications/Xcode-14.2.0.app/Contents/Developer/Platforms/iPhoneSimulator.platform/Developer/SDKs/iPhoneSimulator16.2.sdk -fasm-blocks -fstrict-aliasing -Wprotocol -Wdeprecated-declarations -Winvalid-offsetof -g -Wno-sign-conversion -Winfinite-recursion -Wmove -Wcomma -Wblock-capture-autoreleasing -Wstrict-prototypes -Wrange-loop-analysis -Wno-semicolon-before-method-body -Wunguarded-availability -fobjc-abi-version\=2 -fobjc-legacy-dispatch -index-store-path /Users/vagrant/git/ios/build/Index.noindex/DataStore -iquote /Users/vagrant/git/ios/build/Build/Intermediates.noindex/Pods.build/Debug-iphonesimulator/React-Core.build/React-Core-generated-files.hmap -I/Users/vagrant/git/ios/build/Build/Intermediates.noindex/Pods.build/Debug-iphonesimulator/React-Core.build/React-Core-own-target-headers.hmap -I/Users/vagrant/git/ios/build/Build/Intermediates.noindex/Pods.build/Debug-iphonesimulator/React-Core.build/React-Core-all-non-framework-target-headers.hmap -ivfsoverlay /Users/vagrant/git/ios/build/Build/Intermediates.noindex/Pods.build/Debug-iphonesimulator/React-Core.build/all-product-headers.yaml -iquote /Users/vagrant/git/ios/build/Build/Intermediates.noindex/Pods.build/Debug-iphonesimulator/React-Core.build/React-Core-project-headers.hmap -I/Users/vagrant/git/ios/build/Build/Products/Debug-iphonesimulator/React-Core/include -I/Users/vagrant/git/ios/Pods/Headers/Private -I/Users/vagrant/git/ios/Pods/Headers/Private/React-Core -I/Users/vagrant/git/ios/Pods/Headers/Public -I/Users/vagrant/git/ios/Pods/Headers/Public/DoubleConversion -I/Users/vagrant/git/ios/Pods/Headers/Public/RCT-Folly -I/Users/vagrant/git/ios/Pods/Headers/Public/React-Core -I/Users/vagrant/git/ios/Pods/Headers/Public/React-callinvoker -I/Users/vagrant/git/ios/Pods/Headers/Public/React-cxxreact -I/Users/vagrant/git/ios/Pods/Headers/Public/React-jsi -I/Users/vagrant/git/ios/Pods/Headers/Public/React-jsiexecutor -I/Users/vagrant/git/ios/Pods/Headers/Public/React-jsinspector -I/Users/vagrant/git/ios/Pods/Headers/Public/React-logger -I/Users/vagrant/git/ios/Pods/Headers/Public/React-perflogger -I/Users/vagrant/git/ios/Pods/Headers/Public/React-runtimeexecutor -I/Users/vagrant/git/ios/Pods/Headers/Public/Yoga -I/Users/vagrant/git/ios/Pods/Headers/Public/fmt -I/Users/vagrant/git/ios/Pods/Headers/Public/glog -I/Users/vagrant/git/node_modules/react-native/ReactCommon -I/Users/vagrant/git/ios/Pods/boost -I/Users/vagrant/git/ios/Pods/DoubleConversion -I/Users/vagrant/git/ios/Pods/RCT-Folly -I/Users/vagrant/git/ios/Pods/Headers/Public/FlipperKit -I/Users/vagrant/git/ios/Pods/Headers/Public/ReactCommon -I/Users/vagrant/git/ios/Pods/Headers/Public/React-RCTFabric -I/Users/vagrant/git/ios/build/Build/Intermediates.noindex/Pods.build/Debug-iphonesimulator/React-Core.build/DerivedSources-normal/x86_64 -I/Users/vagrant/git/ios/build/Build/Intermediates.noindex/Pods.build/Debug-iphonesimulator/React-Core.build/DerivedSources/x86_64 -I/Users/vagrant/git/ios/build/Build/Intermediates.noindex/Pods.build/Debug-iphonesimulator/React-Core.build/DerivedSources -F/Users/vagrant/git/ios/build/Build/Products/Debug-iphonesimulator/React-Core -fmodule-map-file\=/Users/vagrant/git/ios/Pods/Headers/Public/folly/RCT-Folly.modulemap -fmodule-map-file\=/Users/vagrant/git/ios/Pods/Headers/Public/yoga/Yoga.modulemap -DFOLLY_NO_CONFIG -DFOLLY_MOBILE\=1 -DFOLLY_USE_LIBCPP\=1 -Wno-comma -Wno-shorten-64-to-32 -Wno-documentation -include /Users/vagrant/git/ios/Pods/Target\ Support\ Files/React-Core/React-Core-prefix.pch -MMD -MT dependencies -MF /Users/vagrant/git/ios/build/Build/Intermediates.noindex/Pods.build/Debug-iphonesimulator/React-Core.build/Objects-normal/x86_64/RCTAppSetupUtils.d --serialize-diagnostics /Users/vagrant/git/ios/build/Build/Intermediates.noindex/Pods.build/Debug-iphonesimulator/React-Core.build/Objects-normal/x86_64/RCTAppSetupUtils.dia -c /Users/vagrant/git/node_modules/react-native/React/AppSetup/RCTAppSetupUtils.mm -o /Users/vagrant/git/ios/build/Build/Intermediates.noindex/Pods.build/Debug-iphonesimulator/React-Core.build/Objects-normal/x86_64/RCTAppSetupUtils.o -index-unit-output-path /Pods.build/Debug-iphonesimulator/React-Core.build/Objects-normal/x86_64/RCTAppSetupUtils.o
/Users/vagrant/git/node_modules/react-native/React/AppSetup/RCTAppSetupUtils.mm:27:9: fatal error: 'FlipperKit/FlipperClient.h' file not found
#import <FlipperKit/FlipperClient.h>
        ^~~~~~~~~~~~~~~~~~~~~~~~~~~~
1 error generated.
# ...
** BUILD FAILED **

The following build commands failed:
	CompileC /Users/vagrant/git/ios/build/Build/Intermediates.noindex/Pods.build/Debug-iphonesimulator/React-Core.build/Objects-normal/x86_64/RCTAppSetupUtils.o /Users/vagrant/git/node_modules/react-native/React/AppSetup/RCTAppSetupUtils.mm normal x86_64 objective-c++ com.apple.compilers.llvm.clang.1_0.compiler (in target 'React-Core' from project 'Pods')
(1 failure)
error Command failed with exit code 65.
info Visit https://yarnpkg.com/en/docs/cli/run for documentation about this command.

Important: 'detox build' is a convenience shortcut for calling your own build command, as provided in the config file.
Failures in this build command are not the responsibility of Detox. You are responsible for maintaining this command.

Command failed: yarn start:ios:e2e

error Command failed with exit code 1.

Invalid base path /Users/vagrant/git/e2e/reports/: lstat /Users/vagrant/git/e2e/reports/: no such file or directory :suspect:


build_ios_qa test run: https://app.bitrise.io/build/1680a4a9-f7f5-445a-b5c4-b41880be2664 ✅ no bottlenecks
edit: false positive result, iOS Sourcemaps & Build actually failing after 6m, so IPA failing deploy

@jpcloureiro
Copy link
Contributor

jpcloureiro commented Aug 3, 2023

Should be good to go once the script gets into a reusable bitrise step, just like you mentioned ✅

Thanks for looking into this @leotm!

@leotm
Copy link
Contributor Author

leotm commented Aug 3, 2023

main:ios_e2e_test passing: https://app.bitrise.io/build/7f2793f5-6040-4be1-be20-9b3b2dd7c34e as expected 44m aug3

updating branch with main then re-running ios_e2e_test
https://app.bitrise.io/build/36e0fdf8-3397-48ab-93f7-6394ffaa46e4

edit: same error as before :suspect:
RN should not be trying to import Flipper
since it should be disabled via the flag
edit: should be fixed in ff06275

@leotm
Copy link
Contributor Author

leotm commented Aug 11, 2023

e2e round 2: post-ff06275

ios_e2e_test test run: https://app.bitrise.io/build/31657ded-b32a-47b7-afe5-ce64d70662d4
build_ios_release ...build_ios_qa ...

edit: still failing relying on Flipperkit, dive deeper

edit: addressed with detailed explanation in 530c29e

Since this is still calling scripts/cocoapods/flipper.rb:
Setting React-RCTAppDelegate > config.build_settings > FB_SONARKIT_ENABLED=1
Causing React/AppSetup/RCTAppSetupUtils.mm to wrongly try importing FlipperKit

Introduced in RN v0.62
- https://github.com/facebook/react-native/blob/v0.62.0/template/ios/Podfile
- #1586

We should have removed in RN v0.64
- https://github.com/facebook/react-native/blob/v0.64.0/template/ios/Podfile
- https://github.com/facebook/react-native/blob/v0.63.5/template/ios/Podfile
@leotm
Copy link
Contributor Author

leotm commented Aug 11, 2023

e2e round 3: post-530c29e

@sonarcloud
Copy link

sonarcloud bot commented Aug 16, 2023

Kudos, SonarCloud Quality Gate passed!    Quality Gate passed

Bug A 0 Bugs
Vulnerability A 0 Vulnerabilities
Security Hotspot A 0 Security Hotspots
Code Smell A 0 Code Smells

No Coverage information No Coverage information
No Duplication information No Duplication information

warning The version of Java (11.0.20) you have used to run this analysis is deprecated and we will stop accepting it soon. Please update to at least Java 17.
Read more here

Copy link
Contributor

github-actions bot commented May 2, 2024

This PR has been automatically marked as stale because it has not had recent activity in the last 90 days. It will be closed in 7 days. Thank you for your contributions.

@github-actions github-actions bot added the stale Issues that have not had activity in the last 90 days label May 2, 2024
Copy link
Contributor

github-actions bot commented May 9, 2024

This PR was closed because there has been no follow up activity in 7 days. Thank you for your contributions.

@github-actions github-actions bot closed this May 9, 2024
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
product-backlog stale Issues that have not had activity in the last 90 days team-mobile-platform
Projects
None yet
Development

Successfully merging this pull request may close these issues.

None yet

4 participants