Wow it took me a long time to consider this problem : (
If our goal is not to have to do rebuild when a git checkout occurs, our algorithm can't rely on any hidden cache data because that data would not be rebuilt. Right now the most important way we use hidden cache data is to know how to delete files -- we essentially cache a graph of which files were written by which generators so that we can delete files which were written when a source disappears. For example let's say we have a config which takes *.orig.js and generates *.gen.js. While checking out a commit foo.orig.js and the generated foo.gen.js are created, but no changeset will be created for foo.orig.js. In this state when foo.orig.js is deleted foo.gen.js remains because it is not clear how to delete it.
Our original design for generators was not subject to this problem because it made deletion the responsibility of the generator itself. Thus the generator would simply process the remove foo.orig.js change and would be required to remove foo.gen.js. Presumably assistance would be offered to the author of generators in order to make sure they get this right.
Wow it took me a long time to consider this problem : (
If our goal is not to have to do rebuild when a git checkout occurs, our algorithm can't rely on any hidden cache data because that data would not be rebuilt. Right now the most important way we use hidden cache data is to know how to delete files -- we essentially cache a graph of which files were written by which generators so that we can delete files which were written when a source disappears. For example let's say we have a config which takes
*.orig.jsand generates*.gen.js. While checking out a commitfoo.orig.jsand the generatedfoo.gen.jsare created, but no changeset will be created forfoo.orig.js. In this state whenfoo.orig.jsis deletedfoo.gen.jsremains because it is not clear how to delete it.Our original design for generators was not subject to this problem because it made deletion the responsibility of the generator itself. Thus the generator would simply process the
remove foo.orig.jschange and would be required to removefoo.gen.js. Presumably assistance would be offered to the author of generators in order to make sure they get this right.