Add a layer of caching to omicron-package #2773
Closed
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
This commit adds a very simple caching system to omicron-package. Upon running for the first time, omicron-package will write out a JSON file containing file paths and hashes of content. Upon subsequent builds, if the file exists with the same contents, it will skip the step of building the package.
On atrium, repeated builds take 3 seconds for me, compared to roughly ten seconds currently.
I am happy with any and all feedback here; I am trying to make basic progress rather than build a build system from scratch, ha! Also, I decided to go with a global here, because then I wouldn't need to pass configuration through a bunch of layers of functions. If you'd prefer a style where this is stored inside the configuration, or sitting on the stack of main, or something else, happy to make changes like that as well.