Skip to content
Code on GitHub (opens in a new tab)

← All the news

Ehundu 0.13.0

The incremental build leaves the process. Until now only ehundu servir built incrementally, because what a build remembers did not survive the process that made it; whoever embedded the engine in a web process, such as an editing panel, had to build the whole site on every save. The new CompiladorIncrementalEnProceso class (compilar, avanzar and olvidar, docs/biblioteca.md (opens in a new tab)) saves what it remembers in .ehundu/memoria.bin, inside the project, and the next build, even from another process, takes advantage of it: on the largest of the test sites, 1,204 pages, changing one page rebuilds one and takes about 3 s, against the 35-45 s of a full build. The result is always that of a full build: the same files and the same warnings.

And it can be spread over calls. avanzar($proyecto, $segundos) rebuilds pages until the budget runs out and saves what it has done; the next call carries on. No separate state is needed, as in batch building: a memory with half the pages is a memory with pages missing, and the plan of the incremental build rebuilds the missing ones and reuses the valid ones, also if the project changes between two calls. The Informe of the call that finishes counts the whole build, not just its part. The 0.12 batches stay as they were, for whoever wants to spread a full build without saving anything about the site.

The memory is ignored without an error if it is not valid. If it is missing, damaged or cut off, was written by another version of the memory or of the engine (it carries a fingerprint of the size and date of its code, so updating the engine makes the first build a full one), or belongs to another project, a full build is done. It is only saved when a call ends well, and it is not written again if no page has been rebuilt. A call that arrives while another is building the same project does not spoil it: avanzar returns ocupado() and compilar waits. The memory weighs about the same as salida/ plus what was read (97 MB on the 1,204-page site) and the process that loads it needs about 350 MB on that site; .ehundu/ carries its own .gitignore, and can be deleted whenever you like (docs/formato.md (opens in a new tab), §10.5, decision 126; docs/compilacion.md (opens in a new tab)).

0.12 sites build the same: nothing changes that does not use the new class, and the ehundu command does not use it. Built from scratch with 0.12.0 and with this one, the twenty-three test sites (PDFs included) give the same files, one by one; and built with the persisted incremental build, spread over calls and then without changes, they give the same as in one go.

This version on GitHub (opens in a new tab), with the ehundu.phar.