A deeper look at what fastlane does in the eas build command

Before posting your question, make sure you’ve read the documentation for both EAS Build & Submit.

If your Android or iOS build is failing- make sure you do your own research on the error message first before posting (this will give you a better understanding, and you might even find that someone else has already solved the issue!) It is not up to the Expo team to debug your project or build.

In your post, please share:

  • Whether you are bare or managed workflow
  • Your eas-cli version
  • What you have tried so far

First, this question is not related with a problem, but rather a question to understand the inner mechanics of the eas build command’s fastlane portion.

When we use the eas build, it is always the fastlane that I notice taking so much time. And when I watch what’s going on from the logs, I see the compilation of the modules is taking too much time.

I am no a compiler expert neither have I any idea about what may be the constraints that fastlane has.

But I wonder, is if it is impossible to avoid compiling same codes each and every time? Of course when using the expo / react-native, in each compilation there are certain parts that needs to be recompiled (because developer changes those parts). But also there are parts (especially coming from packages installed) that each compilation should yield the same output. I wonder why it can not be done, to pre-compile the non-changing parts and somehow link pre-compiled “libraries” in a very fast way within the fastlane.

PS: As I said, I am not a compiler expert, but each time I do eas-build, this makes me wonder… If the question is off-topic, please let me know.

Yes, most of the expo packages are already precompiled(especially the heavy ones), but we can’t control third-party libraries which are mostly built from source. This is sth library authors would need to do.

The other approach that could be used is caching intermittent build results between builds. Each build happens on a clean new VM, but we provide cache option in eas.json that you can use to cache certain files between builds. I can’t tell you how exactly to configure that so xcode picks up those build files from previous build without recompiling, but technically it should be possible.

1 Like

First, thanks a lot for the answer @wkozyra .

When I checked the build details, the “Run fastlane” block, I see lots of “Compiling” logs. And when I took the unique items I found below items are the ones being compiled.

So is there a method for me to “pre-compile” these items so that they don’t re-compile each time? (Maybe I am wrong but what I observe is, this is the slowest step in my compilation.)

Interestingly, these are either expo libraries or react-native’s mostly used third party libraries which are coming “mostly” by default within an expo project.

expo
expo-apple-authentication
expo-application
expo-clipboard
expo-constants
expo-crypto
expo-dev-launcher
expo-dev-menu
expo-error-recovery
expo-file-system
expo-font
expo-json-utils
expo-keep-awake
expo-linear-gradient
expo-location
expo-manifests
expo-modules-core
expo-random
expo-splash-screen
expo-updates-interface
expo-web-browser
react-native
react-native-gesture-handler
react-native-maps
react-native-reanimated
react-native-safe-area-context
react-native-screens
react-native-svg
react-native-vector-icons

PS: I am not providing full logs, in order to reduce verbose.