https://kotlinlang.org logo
s

sendoav

12/09/2021, 2:29 PM
Hi all! I have an umbrella framework containing 6 kotlin modules. Even the smallest change in one module provokes the linkPodDebugFrameworkIos64 to take more than 4 minutes, is it normal? I have already checked some tips to improve native compilation time but I'm not able to lower from 4 minutes. I'm using kotlin 1.5.30
k

Karel Petránek

12/09/2021, 2:35 PM
Sadly this is pretty normal, we are on 10+ minutes on a relatively small project, any change seems to trigger re-linking and that always runs for a long time.
s

sendoav

12/09/2021, 2:41 PM
Have you tried to modularize the kotlin shared code?
k

Karel Petránek

12/09/2021, 3:07 PM
Yes, it helps a bit but if you change a module that other modules depend on, it is pretty much the same total time
m

Matti MK

12/10/2021, 9:41 AM
Jumping into the conversation a bit later: what do you recon is causing these long build times? Is it the modularisation or something else related to the build? I checked mine and after a small change to
commonMain
the build took 1s
On GitHub action’s
macos
CI the build takes significantly longer, that’s about 15mins. However, there’s some small steps like
xcodegen
and
pod install
+ buildtime scripts that affect it
s

sendoav

12/10/2021, 11:12 AM
The modularization helps reducing time. Some of the steps related to module compilation are are already cached if you dont modify a module. The most time consuming step is related to linking and creating the framework. In my case we have quite a big number of classes within each module
👍 1
m

Matti MK

12/10/2021, 11:17 AM
Yep, I was wondering if there’s something specific about KMM and modularisation. So, basically I guess that for you “the smallest change in one module” is actually a change to some form of a root module that has a number of other modules depending on it and as such those other modules need to be recompiled as well. I suppose the linking part is completely separate from the compilation of the modules, as in that you’ll always have to do the linking task which takes X time no matter the extent of the change?
s

sendoav

12/10/2021, 11:21 AM
Yeap, just for testing I have creating a very tiny module and just changed it, without affecting the rest of modules, but the linking task takes the same time, it is independent of the kind of change. It is related to the size of content you are converting to ios framework
👍 1
m

Matti MK

12/10/2021, 11:23 AM
How are you linking these modules to the iOS project? Are they all in one pod?
s

sendoav

12/10/2021, 11:24 AM
yes, it os one umbrella framework included in one single pod
m

Matti MK

12/10/2021, 11:24 AM
I am wondering whether it could be possible to split them up into a number of different pods and that way have a bit more of a granular linking happening. However, you’d still have dependencies in-between the pods so…
s

sendoav

12/10/2021, 11:29 AM
Till now I think it is not possible, in order to include more than one kmm module as a framework they need to be independent
👍 1
10 Views