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

chore: improve android & iOS build step #18900

Merged
merged 1 commit into from
Feb 19, 2024
Merged

Conversation

siddarthkay
Copy link
Contributor

fixes #18888

Summary

make run-android was sometimes flaky because we used to send metro to background via nohup and then bring it back to foreground after we read metro logs.

Now we do not send metro to background.
The new workflow should now be less flaky.

Review notes

make run-clojure
make run-android OR make run-ios should just work

Platforms

  • Android
  • iOS

status: ready

@status-im-auto
Copy link
Member

status-im-auto commented Feb 19, 2024

Jenkins Builds

Click to see older builds (8)
Commit #️⃣ Finished (UTC) Duration Platform Result
✔️ 420f19b #1 2024-02-19 13:39:09 ~5 min tests 📄log
✔️ 420f19b #1 2024-02-19 13:39:47 ~6 min ios 📱ipa 📲
✔️ 420f19b #1 2024-02-19 13:40:35 ~7 min android-e2e 🤖apk 📲
✔️ 420f19b #1 2024-02-19 13:41:32 ~8 min android 🤖apk 📲
✔️ a60508b #2 2024-02-19 14:32:17 ~4 min tests 📄log
✔️ a60508b #2 2024-02-19 14:33:26 ~6 min ios 📱ipa 📲
✔️ a60508b #2 2024-02-19 14:34:47 ~7 min android-e2e 🤖apk 📲
✔️ a60508b #2 2024-02-19 14:34:55 ~7 min android 🤖apk 📲
Commit #️⃣ Finished (UTC) Duration Platform Result
✔️ 03fb843 #3 2024-02-19 15:24:18 ~5 min tests 📄log
✔️ 03fb843 #3 2024-02-19 15:24:49 ~6 min ios 📱ipa 📲
✔️ 03fb843 #3 2024-02-19 15:25:18 ~6 min android-e2e 🤖apk 📲
✔️ 03fb843 #3 2024-02-19 15:26:22 ~7 min android 🤖apk 📲
✔️ ec1f34d #4 2024-02-19 15:36:00 ~5 min tests 📄log
✔️ ec1f34d #4 2024-02-19 15:36:40 ~6 min ios 📱ipa 📲
✔️ ec1f34d #4 2024-02-19 15:37:18 ~6 min android 🤖apk 📲
✔️ ec1f34d #4 2024-02-19 15:37:59 ~7 min android-e2e 🤖apk 📲

@OmarBasem
Copy link
Contributor

@siddarthkay finally worked 🚀

Btw I noticed the android build took longer than usual, about 10 minutes

@siddarthkay
Copy link
Contributor Author

took longer than usual, about 10 minutes

hmm thats because its a nix build inside a sandbox.
Second time runs should be under a minute.

I'll try to improve speed of debug builds in the future.

@siddarthkay siddarthkay requested a review from a team February 19, 2024 14:01
Copy link
Member

@jakubgs jakubgs left a comment

Choose a reason for hiding this comment

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

Looks good, and works well on my NixOS machine.

@siddarthkay siddarthkay merged commit 107f263 into develop Feb 19, 2024
@siddarthkay siddarthkay deleted the get-rid-of-nohup branch February 19, 2024 15:41
@OmarBasem
Copy link
Contributor

took longer than usual, about 10 minutes

hmm thats because its a nix build inside a sandbox. Second time runs should be under a minute.

I'll try to improve speed of debug builds in the future.

@siddarthkay so yesterday and today I have built the app multiple times and every time it takes 10 minutes to build

@siddarthkay
Copy link
Contributor Author

I'm sure we can improve this in the future, by making sure we reuse the last derivation most of the time unless we detect changes in android directory or we pass a REBUILD flag or something.
cc @jakubgs @yakimant

@jakubgs
Copy link
Member

jakubgs commented Feb 21, 2024

Obviously Nix would rebuild the derivation if the source code changes.

@OmarBasem
Copy link
Contributor

Obviously Nix would rebuild the derivation if the source code changes.

Compared to a week before, the android build would take 2-3 minutes when there is code changes

@OmarBasem
Copy link
Contributor

OmarBasem commented Feb 21, 2024

Probably something that should be cached in the build process that is no longer being cached in the recent changes.

@jakubgs
Copy link
Member

jakubgs commented Feb 21, 2024

Nothing is being cached between Nix builds other than dependencies and tooling.

@siddarthkay
Copy link
Contributor Author

Compared to a week before, the android build would take 2-3 minutes when there is code changes

I'll log this as an issue and will think of possible solutions there.
Thanks for highlighting this @OmarBasem

@OmarBasem
Copy link
Contributor

Nothing is being cached between Nix builds other than dependencies and tooling.

From the logs I see, it seems to me that it rebuilds the dependencies everytime

@OmarBasem
Copy link
Contributor

Nothing is being cached between Nix builds other than dependencies and tooling.

From the logs I see, it seems to me that it rebuilds the dependencies everytime

Btw I tested building 2 times in a row without any code changes and it takes 10 minutes for both builds

@yqrashawn
Copy link
Contributor

yqrashawn commented Feb 23, 2024

Not related to this issue.

The thing that

  • breaks the build
  • requires rerun run-metro

in the past.

Is it status-go react native module triggered by yarn install?

siddarthkay added a commit that referenced this pull request Feb 24, 2024
fixes #18915

## Summary

In this PR #18900 we added a `logs` folder in the root directory and it was discovered that we also have an `ios/logs` folder which the CI uses to generates logs during build time.
Its more consistent if we move those logs to the log folder in the root of the repo.
This commit fixes that and updates leftover usages.
siddarthkay added a commit that referenced this pull request Feb 24, 2024
fixes #18915

In this PR #18900 we added a `logs` folder in the root directory and it was discovered that we also have an `ios/logs` folder which the CI uses to generates logs during build time.
Its more consistent if we move those logs to the log folder in the root of the repo.
This commit fixes that and updates leftover usages.
siddarthkay added a commit that referenced this pull request Feb 24, 2024
fixes #18915

In this PR #18900 we added a `logs` folder in the root directory and it was discovered that we also have an `ios/logs` folder which the CI uses to generates logs during build time.
Its more consistent if we move those logs to the log folder in the root of the repo.
This commit fixes that and updates leftover usages.
siddarthkay added a commit that referenced this pull request Feb 24, 2024
fixes #18915

In this PR #18900 we added a `logs` folder in the root directory and it was discovered that we also have an `ios/logs` folder which the CI uses to generates logs during build time.
Its more consistent if we move those logs to the log folder in the root of the repo.
This commit fixes that and updates leftover usages.
siddarthkay added a commit that referenced this pull request Feb 24, 2024
fixes #18915

In this PR #18900 we added a `logs` folder in the root directory and it was discovered that we also have an `ios/logs` folder which the CI uses to generates logs during build time.
Its more consistent if we move those logs to the log folder in the root of the repo.
This commit fixes that and updates leftover usages.
siddarthkay added a commit that referenced this pull request Feb 24, 2024
fixes #18915

In this PR #18900 we added a `logs` folder in the root directory and it was discovered that we also have an `ios/logs` folder which the CI uses to generates logs during build time.
Its more consistent if we move those logs to the log folder in the root of the repo.
This commit fixes that and updates leftover usages.
ibrkhalil pushed a commit that referenced this pull request Feb 25, 2024
fixes #18888

## Summary
`make run-android` was sometimes flaky because we used to send metro to background via `nohup` and then bring it back to foreground after we read metro logs.

Now we do not send metro to background. We first wait for a successful build.
we then install the app on the simulator. After this is done we give command to sleep until metro server has started, Once metro server has started we open the installed app.

In this workflow the command to open the installed app goes in background and metro stays in foreground.
The new workflow should now be less flaky.

## Review notes
`make run-clojure`
`make run-android` OR `make run-ios` should just work 

#### Platforms
- Android
- iOS
siddarthkay added a commit that referenced this pull request Feb 26, 2024
fixes #18915

In this PR #18900 we added a `logs` folder in the root directory and it was discovered that we also have an `ios/logs` folder which the CI uses to generates logs during build time.
Its more consistent if we move those logs to the log folder in the root of the repo.
This commit fixes that and updates leftover usages.
siddarthkay added a commit that referenced this pull request Feb 26, 2024
fixes #18915

In this PR #18900 we added a `logs` folder in the root directory and it was discovered that we also have an `ios/logs` folder which the CI uses to generates logs during build time.
Its more consistent if we move those logs to the log folder in the root of the repo.
This commit fixes that and updates leftover usages.
siddarthkay added a commit that referenced this pull request Feb 26, 2024
fixes #18915

In this PR #18900 we added a `logs` folder in the root directory and it was discovered that we also have an `ios/logs` folder which the CI uses to generates logs during build time.
Its more consistent if we move those logs to the log folder in the root of the repo.
This commit fixes that and updates leftover usages.
siddarthkay added a commit that referenced this pull request Feb 27, 2024
fixes #18915

In this PR #18900 we added a `logs` folder in the root directory and it was discovered that we also have an `ios/logs` folder which the CI uses to generates logs during build time.
Its more consistent if we move those logs to the log folder in the root of the repo.
This commit fixes that and updates leftover usages.
siddarthkay added a commit that referenced this pull request Feb 27, 2024
fixes #18915

In this PR #18900 we added a `logs` folder in the root directory and it was discovered that we also have an `ios/logs` folder which the CI uses to generates logs during build time.
Its more consistent if we move those logs to the log folder in the root of the repo.
This commit fixes that and updates leftover usages.
siddarthkay added a commit that referenced this pull request Feb 27, 2024
fixes #18915

In this PR #18900 we added a `logs` folder in the root directory and it was discovered that we also have an `ios/logs` folder which the CI uses to generates logs during build time.
Its more consistent if we move those logs to the log folder in the root of the repo.
This commit fixes that and updates leftover usages.
siddarthkay added a commit that referenced this pull request Feb 27, 2024
fixes #18915

In this PR #18900 we added a `logs` folder in the root directory and it was discovered that we also have an `ios/logs` folder which the CI uses to generates logs during build time.
Its more consistent if we move those logs to the log folder in the root of the repo.
This commit fixes that and updates leftover usages.
@siddarthkay
Copy link
Contributor Author

Is it status-go react native module triggered by yarn install?

Its probably the runtime codegen introduced after react-native 0.72 that generates files at build time.
Haven't looked too deep into that but I am pretty sure this started happening since react-native 0.72 and was not the case before that upgrade..

@siddarthkay
Copy link
Contributor Author

I tested building 2 times in a row without any code changes and it takes 10 minutes for both builds

created issue to track -> #19081

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
Archived in project
Archived in project
Development

Successfully merging this pull request may close these issues.

make run-android is flaky
6 participants