Want to contribute? Fork us in GitHub!

Global EO Cache

EO compilation process consists of several steps covered in details in this blog post. Most of the steps have various files (.eo, .xmir, etc.) as their input/output, and sometimes it’s very handy to have them persisted somewhere for reuse between compilation runs. ~/.eo/ folder acts as such persistent storage. Let’s have a closer look at its structure and how it is bound to compilation process.

The folder has the following structure:

~/.eo/
   |-- pulled/
   |-- parsed/
   +-- optimized/

Each subfolder can be considered as a local cache serving specific purpose. All caches store files based on version git-hash. For example org.eolang.array object source for version 0.27.0 within Pulled cache will be stored as ~/.eo/pulled/99b64cf/org/eolang/array.eo, where 99b64cf is git-hash for 0.27.0 version tag. Also, note that the file path corresponds to the package of the object.

Pulled cache contains .eo sources downloaded from Objectionary during Pull step. Every time pull step is executed it first checks presence of the file in pulled cache and would only go to remote Objectionary in case it’s missing locally. However, this behaviour can be adjusted by Maven -U option (see Bypassing object cache)

Parsed cache stores parsed .xmir files produced during Parse step. The structure of this folder is similar to pulled cache, namely it stores files based on hash+package: parsed/99b64cf/org/eolang/array.xmir An EO object discovered during previous compilation cycles and which has meaningful version (i.e. not like 0.0.0, *.*.* or empty) before actually being parsed would be checked in parsed cache first. If it’s found it will be copied to corresponding target. In case it’s missing it would be parsed from EO source.

Optimized cache is used during Optimize step and stores optimized .xmir files. It is functioning identical to Parsed cache.

To summarize: ~/.eo/ folder represents local file cache for EO compilation artifacts to make the process more performant. It’s possible that for further optimizations we will see more caches within ~/.eo/ in future.

And of course to clean up all caches you can always execute (for Bash) rm -rf ~/.eo :)