Compile time issue

From 12th January, the compilation time has increased dramatically.

As you can see from this build log https://www.bitrise.io/build/c3e45e2d33c1f7f1 the compiler was stucked for about 1 hour on Realm_vers.c
Log:
[01:43:18]: ▸ Compiling uuid.cpp
[01:43:18]: ▸ Compiling weak_realm_notifier.cpp
[01:43:18]: ▸ Compiling Realm_vers.c
[02:49:03]: ▸ Linking Realm
[02:49:19]: ▸ Linking Realm

In the previous build https://www.bitrise.io/build/bce71fc4a9057b20 it was ok, as you can see below:
[03:45:02]: ▸ Compiling weak_realm_notifier.cpp
[03:45:02]: ▸ Compiling Realm_vers.c
[03:57:30]: ▸ Linking Realm
[03:57:46]: ▸ Linking Realm

The problem is that now the build time exceeds 90 minutes, so every build is aborted :confused:
Can you help me please?
Thank you

Hi there, this could be possibly an issue because of the change in the dependency, because in the near past we didn’t change anything, which could influence such thing, can you please try to rebuild the old build and see the results of that? :slight_smile:

Unfortunately there is no dependency changes, the Realm version of the previous build is the same (3.0.2) :confused:

Can you try to rebuild both builds you linked and let us know whether the previous build’s time now increases or the slower build’s time decreases?

1 Like

Old build: Bitrise - Mobile Continuous Integration and Delivery - iOS & Android Build Automation

[00:55:04]: ▸ Compiling Realm_vers.c
[01:58:09]: ▸ Linking Realm
[01:58:29]: ▸ Linking Realm
[01:58:49]: ▸ Generating ‘Realm.framework.dSYM’

New build: Bitrise - Mobile Continuous Integration and Delivery - iOS & Android Build Automation

[00:46:25]: ▸ Compiling Realm_vers.c
[01:50:25]: ▸ Linking Realm
[01:50:41]: ▸ Linking Realm
[01:50:58]: ▸ Generating ‘Realm.framework.dSYM’

As you can see the build time has also increased in the old build :confused:

Can you help me please?

Checked the build logs but I can’t highlight anything particular. Use used the Xcode 9.2 stack for all of these builds, and the Xcode 9.2 stack did not have any significant updates since Xcode 9.2 final, which was more than a month ago (https://github.com/bitrise-io/bitrise.io/commit/5e903670d2dcafbec6e9e9333c3d717412c507b7).

All other updates (https://github.com/bitrise-io/bitrise.io/commits/master/system_reports/osx-xcode-9.2.x.log) were just usual minor cache updates & bitrise cli upgrades.

Build infrastructure did not have any significant changes either for more than a couple of weeks now.

Can you please enable Support Access for the app (Settings tab of the app on bitrise.io)? We’ll try to check it ASAP!

In the meantime I bumped your Organization’s Build Time limit to 110 mins, hope that helps to get at least a successful build while we’re checking why it might take so long to build.

1 Like

I’m just curious, from where / with which tool do you get Realm in the build? Seems you use it as a CocoaPods Pod, but I did not see any related step in the workflow.

I saw that you use fastlane, but I did not find anything CocoaPods (pod install) related in the fastlane logs either.

Support access enabled!
Yes, we use CocoaPods as dependency manager and fastlane to automate building…you did not find any “pod install” because the branch already contains all the pods.

https://www.bitrise.io/build/091d15f66abba068 as you can see, 110 minutes are not enough :confused:

Got it. Is it possible to include Realm in pre-compiled form somehow, so that you don’t have to re-compile it in every build?

Checked the builds again → it seems you did not built the same commit again, just the same branch, but both builds built the tip of the branch at the time of the build, so the rebuild did build a different commit.

Just started a new build with the same commit you linked as the good one ( https://www.bitrise.io/build/311fedc44f9ad8cf ).

And indeed, the rebuild of the commit (https://www.bitrise.io/build/311fedc44f9ad8cf / 95b33f24d5eb852250ff95ff89cb13c3201e8fd5) took about the same time @vscafuto, in fact it took almost 3 mins less than the original (https://www.bitrise.io/build/bce71fc4a9057b20) did (~66 mins vs ~69 mins).

Based on this (and on the fact that all of our stats indicate that there’s no issue / slow down in the system) I’d suggest you to diff against this commit in your code and check what changed, as it seems the change was in the code itself.

Note: you can see which commit was built in the Git Clone step’s log, so you can find the last “faster” build on bitrise.io and just check the commit hash - then diff against that state of the code / check what changed in the code since the commit.

Of course if you’d have any questions just let us know, we’re always happy to help! :slight_smile:

Pre-compiling Realm might also be a good idea, based on the fact that it seems in the newer builds that was what took more time.

I think the problem started from the moment we switched the swift_version of the whole project (including pods) from 3.2 to 4.
We can’t include Realm in pre-compiled form because of some dependencies with our pods.
Do you have any suggest? :confused:

How long does it take to do a completely clean build of the project on your own Mac?

By completely clean I mean doing at least a completely new git clone of the repo into a /tmp/ directory, and then running the same (fastlane) command there.

1 Like

git clone:

Cloning into ‘mywellness’…
remote: Counting objects: 76448, done.
remote: Compressing objects: 100% (32001/32001), done.
remote: Total 76448 (delta 53297), reused 58655 (delta 41786)
Receiving objects: 100% (76448/76448), 620.50 MiB | 1.94 MiB/s, done.
Resolving deltas: 100% (53297/53297), done.

real 5m43.180s
user 0m20.554s
sys 0m7.745s

There is no problem on my local machine using the same branch and commit (and same fastlane command):
[15:17:19]: ▸ Compiling uuid.cpp
[15:17:19]: ▸ Compiling weak_realm_notifier.cpp
[15:17:19]: ▸ Compiling Realm_vers.c
[15:17:19]: ▸ Linking Realm
[15:17:30]: ▸ Linking Realm
[15:17:31]: ▸ Generating ‘Realm.framework.dSYM’

I will notify you the total time as soon as the workflow is finished

:+1:

you can also try to Remote Desktop / VNC into the build VM: https://gist.github.com/viktorbenei/c6d4fe1e68de739dbb5f4f15de76b9db if that helps

How can I send you the build log of the workflow executed on my own mac?

Just updated Realm to version 3.1.0 and CocoaPods to 1.4.0 rc1 but there’s still the issues…
Everything works on my own machine

Did you try to remote desktop / VNC into the build VM @vscafuto? see :point_up: Compile time issue