ditto-lang/ditto

Add caching to `build.ninja` generation :floppy_disk:

Opened this issue · 0 comments

Atm we parse every source file on every ditto make in order to generate the build.ninja.

fn prepare_build_graph(
sources: Sources,
package_sources: PackageSources,
ditto_version: &semver::Version,
) -> Result<(BuildGraph, BuildGraphNodes)> {

This is hella inefficient. Particularly given that package sources aren't really going to change.

So I reckon we should generate a build.ninja.fragment for each package, and stitch them together on warm ditto make runs. That fragment should be invalidated/regenerated when the package sources are touched.