Carthage Building scheme makes Bitrise to timeout after 90 minutes - ios

I am using Bitrise and I have updated both my development machine and bitrise stack to Xcode 11.
When running a build, the Carthage dependencies need to be regenerated and since I am using AWS dependencies, even in my Mac book pro, they take a long time to build and they make the Bitrise build to time out.
Here there is an example on how my bitrise.yml is configured:
...
workflows:
test:
steps:
- gitlab-status:
run_if: not (enveq "BITRISE_GIT_COMMIT" "")
inputs:
- private_token: "$GITLAB_STATUS_TOKEN"
- preset_status: running
- api_base_url: https://gitlab.company.cloud/api/v4
- activate-ssh-key:
run_if: '{{getenv "SSH_RSA_PRIVATE_KEY" | ne ""}}'
- git-clone: {}
- cache-pull:
inputs:
- is_debug_mode: 'true'
- certificate-and-profile-installer: {}
- carthage:
inputs:
- verbose_log: 'yes'
- carthage_options: "--platform ios --no-use-binaries --cache-builds"
- cocoapods-install: {}
- xcode-test:
inputs:
- scheme: CompanyApp
- project_path: CompanyApp.xcworkspace
- simulator_device: iPhone 8
- xcode-test:
inputs:
- project_path: CompanyApp.xcworkspace
- simulator_device: iPhone 8
- scheme: CompanyAppUITests
- gitlab-status:
run_if: not (enveq "BITRISE_GIT_COMMIT" "")
inputs:
- private_token: "$GITLAB_STATUS_TOKEN"
- api_base_url: https://gitlab.company.cloud/api/v4
- cache-push:
is_always_run: true
inputs:
- is_debug_mode: 'true'
- deploy-to-bitrise-io: {}
...
Just in case, they are the last 2 lines from the build log
*** Building scheme "AWSLogs" in AWSiOSSDKv2.xcodeproj
*** Building scheme "AWSMachineLearning" in AWSiOSSDKv2.xcodeproj
Any ideas???

The solution is to not rebuild libraries in CI, after adding them to repository and skipping build part in CI you will see huge build time decrease.

Try removing --no-use-binaries.
By selecting to not use binaries, large dependencies can't provide you with pre-compiled binaries to greatly decrease compile times. If you remove that flag you should notice that compilation speeds up.

Related

IOS - Running script '[CP-User] Generate Specs The following build commands failed: PhaseScriptExecution [CP-User]\ Generate\ Specs In Azure Pipeline

I am working with the azure pipeline for CICD for React native app. I am using macOS Big Sur (11.4) and Xcode 12.4 as a local machine to create and test the app. App working fine on the local machine without any warning or issue for ios. However, when I am pushing the code on the Azure pipeline it is giving me errors as below,
2021-07-27T07:16:59.6470190Z ▸ Building library libRCTTypeSafety.a
2021-07-27T07:17:00.2028870Z ▸ Running script '[CP-User] Generate Specs'
2021-07-27T07:17:01.2282870Z ** BUILD FAILED **
2021-07-27T07:17:01.2284310Z
2021-07-27T07:17:01.2284960Z
2021-07-27T07:17:01.2285770Z The following build commands failed:
2021-07-27T07:17:01.2288070Z PhaseScriptExecution [CP-User] Generate\ Specs /Users/runner/Library/Developer/Xcode/DerivedData/QualityGateTest-fpifffctlauicvdetlisjqinofwg/Build/Intermediates.noindex/Pods.build/Release-iphonesimulator/FBReactNativeSpec.build/Script-650A047D1ACF74FC1AD8108A78938588.sh
2021-07-27T07:17:01.2289360Z (1 failure)
2021-07-27T07:17:01.2705660Z ##[debug]success of first tool:false
2021-07-27T07:17:01.2787820Z ##[debug]rc:0
2021-07-27T07:17:01.2788560Z ##[debug]success:true
2021-07-27T07:17:01.2807190Z ##[debug]task result: Failed
2021-07-27T07:17:01.2844600Z ##[error]Error: /usr/bin/xcodebuild failed with return code: 65
2021-07-27T07:17:01.2856630Z ##[debug]Processed: ##vso[task.issue type=error;]Error: /usr/bin/xcodebuild failed with return code: 65
2021-07-27T07:17:01.2866680Z ##[debug]Processed: ##vso[task.complete result=Failed;]Error: /usr/bin/xcodebuild failed with return code: 65
2021-07-27T07:17:01.2867800Z ##[debug]Agent.Version=2.189.0
My observation is that the Azure pipeline does not have macOS Big Sur as Agent. My local machine changes some configurations during POD install and adds the script to support the latest Xcode and macOS and the azure pipeline agent does not support macOS Big Sur reason it is not able to execute the script.
NOTE: I have tried all clean processes like yarn, pod, or delete node_module.
[azure-devops]
I have got the solution for the issue.
Actually, the latest version of macOS Big Sur (11.4) was not having a node install on VM.
A) I did some changes in the pipeline.
pool:
vmImage: macOS-11
steps:
- checkout: self
persistCredentials: true
clean: true
- task: NodeTool#0
displayName: 'Install Node'
inputs:
versionSpec: 'v16.6.2' # you can use your desired version here
- script: yarn install
displayName: Install Dependencies
B)
Also created patch inside react native lib for version 0.64. by adding "unset PREFIX" on node_modules/react-native/scripts/find-node.sh

Expo build fails in CI but builds locally (babel-preset-expo has been ignored because it contains invalid configuration)

Classic case of it works on my machine. I am building two react-native apps. App A and App B. Both of the applications were bootstrapped using expo.
When I run the command to build either app locally expo build:ios they both build. Yet when I attempt to build the applications in gitlab-ci only application B fails to build with the following message:
[23:07:28] warn Package babel-preset-expo has been ignored because it contains invalid configuration. Reason: Cannot find module 'babel-preset-expo/package.json'
[23:07:28] Require stack:
[23:07:28] - /builds/XXX/application-b/node_modules/react-native/node_modules/#react-native-community/cli/build/tools/config/resolveNodeModuleDir.js
[23:07:28] - /builds/XXX/application-b/node_modules/react-native/node_modules/#react-native-community/cli/build/tools/releaseChecker/index.js
[23:07:28] - /builds/XXX/application-b/node_modules/react-native/node_modules/#react-native-community/cli/build/commands/server/runServer.js
[23:07:28] - /builds/XXX/application-b/node_modules/react-native/node_modules/#react-native-community/cli/build/commands/server/server.js
[23:07:28] - /builds/XXX/application-b/node_modules/react-native/node_modules/#react-native-community/cli/build/commands/index.js
[23:07:28] - /builds/XXX/application-b/node_modules/react-native/node_modules/#react-native-community/cli/build/index.js
[23:07:28] - /builds/XXX/application-b/node_modules/react-native/local-cli/cli.js
[23:07:28]
[23:07:29] Starting Metro Bundler on port 19001.
[23:07:29] debug Watch mode is not supported in this environment
[23:07:29] debug Checking for a newer version of React Native
[23:07:29] debug Current version: 0.61.4
[23:07:29] debug No release cache found
[23:07:29] debug No release cache found
[23:07:29] debug Checking for newer releases on GitHub
[23:07:29] debug No release cache found
[23:07:30] Publishing to channel 'default'...
[23:07:30] debug Saving "6d6386b01438c6ef0acd213d304b5839" to cache
[23:07:30] debug No release cache found
[23:07:30] debug No release cache found
[23:07:30] debug Latest release: 0.60.0
[23:07:32] Building iOS bundle
[23:07:43] node_modules/expo/AppEntry.js: Cannot find module 'babel-preset-expo' from '/builds/XXX/application-b'
[23:07:43] › Closing Expo server
[23:07:43] node_modules/expo/AppEntry.js: Cannot find module 'babel-preset-expo' from '/builds/XXX/application-b'
[23:07:43] Failed building JavaScript bundle.
[23:07:43] ::ffff:127.0.0.1 - - [06/Apr/2020:23:07:43 +0000] "GET /node_modules/expo/AppEntry.bundle?dev=false&minify=true&hot=false&platform=ios HTTP/1.1" 500 - "-" "axios/0.19.0"
[23:07:43] › Stopping Metro bundler
[23:07:43] Packager URL http://127.0.0.1:19001/node_modules/expo/AppEntry.bundle?dev=false&minify=true&hot=false&platform=ios returned unexpected code 500. Please open your project in the Expo app and see if there are any errors. Also scroll up and make sure there were no errors or warnings when opening your project.
I have tried having the CI explicitly install the module babel-preset-expo, but that does not fix the issue. My babel.config.js is identical for both apps and looks like this:
module.exports = function(api) {
api.cache(true);
return {
presets: ['babel-preset-expo'],
};
};
I have the following lines in my both of my package.json:
"devDependencies": {
"#babel/core": "^7.0.0",
"babel-preset-expo": "^8.0.0"
},
The file in both applications being referenced in the error AppEntry.js is identical as well.
Here is my gitlab-ci.yml:
image: node/alpine
cache:
key: ${CI_COMMIT_REF_SLUG}
paths:
- ~/.npm
stages:
- deploy
- tag
before_script:
- echo $CI_BUILD_REF
- echo $CI_PROJECT_DIR
- apk add --no-cache bash build-base gcc git python3 curl
- PATCH=`git log --pretty=oneline | wc -l | sed -e 's/^[[:space:]]*//'`
- VERSION=`cat VERSION`
- VERSION=${VERSION%?}
- TAG="${VERSION}${PATCH}"
- echo "Build version = ${TAG}"
expo-build:
stage: deploy
artifacts:
paths:
- ipas/
script:
- sed -i "s/0.0.0/${TAG}/g" app.json
- npm ci --production --cache .npm --prefer-offline
- npx expo login -u $EXPO_USERNAME -p $EXPO_PASSWORD
- EXPO_DEBUG=true npx expo build:ios --non-interactive # This works because it has been already built once through the cli, credentials cannot be pass into env
- mkdir -p ipas
- curl "$(npx expo url:ipa --non-interactive)" -o ipas/bravo-teller-$TAG.ipa
only:
- master
Any feedback or suggestions as to what this could be would be greatly appreciated. Thanks
Actually, the babel-preset-expo is not a devDependencies you should add it to dependencies furthermore likely you should use lazy load by using the following code on your babel configuration:
[
'babel-preset-expo',
{
lazyImports: true,
},
]

Creating Multiarch Manifest

I'm trying to use Google Cloud Build to build multiarch images and a supporting manifest so I can run my containers on both amd64 and arm processors. I can successfully build two images, but I'm unable to generate the multiarch manifest necessary... getting errors that manifests for the images I've just generated don't exist.
Here's the stage that fails:
- name: 'gcr.io/cloud-builders/docker'
id: 'manifest'
env:
- 'DOCKER_CLI_EXPERIMENTAL=enabled'
args:
- 'manifest'
- 'create'
- 'gcr.io/$PROJECT_ID/village:$COMMIT_SHA'
- 'gcr.io/$PROJECT_ID/village:arm32v6'
- 'gcr.io/$PROJECT_ID/village:amd64'
waitFor: ['amd64', 'arm']
which produces the error:
no such manifest: gcr.io/village/village:arm32v6
Already have image (with digest): gcr.io/cloud-builders/docker
A previous step of my build results in: Step #1 - "arm": Successfully tagged gcr.io/village/village:arm32v6.
Do I somehow need to push the individual images before generating the multiarch manifests? Is it possible run continue running cloud-build commands after pushing images?
It turns out you have to push the dependencies before you can create the manifest. Adding a step like below did the trick!
- name: 'gcr.io/cloud-builders/docker'
id: 'push-arm'
args:
- 'push'
- 'gcr.io/$PROJECT_ID/village:arm32v6'
waitFor: ['arm']
I ended up documenting the final configs here in case anyone else runs into this problem.

I can't build android-27 , tool-27.0.2 with travis.CI

Can any one help me?
Stuck from my side.
https://travis-ci.org/XinyueZ/mvvm-template/jobs/313586340
I can 't build (./gradlew test) it.
my yml is:
language: android
android:
components:
- tools
- platform-tools
- build-tools-27.0.2
- android-27
- add-on
- extra
licenses:
- 'android-sdk-license-.+'
jdk:
- oraclejdk8
script:
- ./gradlew :repository:testMockDebugUnitTest :repository:testProdDebugUnitTest :repository:testProdReleaseUnitTest
before_cache:
- rm -f $HOME/.gradle/caches/modules-2/modules-2.lock
cache:
directories:
- $HOME/.m2
- $HOME/.gradle/caches/
- $HOME/.gradle/wrapper/
buildToolsVersion = '27.0.2'
I have tried 27.0.1 as well, same failed.
I had one or three times successed, just 2 hours later, something went wrong.
same yml, no change.
See here
It seems Google uploaded a new version of the android-27 package and the checksum is now different and the download fails. For the moment, you need to install it yourself using the sdkmanager CLI instead. Here's what you would need to add to your .travis.yml file:
before_install:
- yes | sdkmanager "platforms;android-27"

Build status picture stays at "build unknown"

Even if the builds are passing on Travis, the Build Status picture seems to have stopped changing. It still says "build unknown".
My .travis.yml contains:
language: node_js
node_js:
- "0.12"
- "0.11"
- "0.10"
- "iojs-v2.1.0"
- "iojs-v1.0.4"
services:
- mongodb
What's the problem?
It was due to a Travis issue that is now corrected.

Resources