[gambit-list] Separating generated files?

Christian Jaeger christian at pflanze.mine.nu
Wed Oct 15 12:45:56 EDT 2008


Matthieu Moy wrote:
> I think the first question is: do you (and why) need to use a version
> control system for generated files?

The project in question is a self-hosting compiler which compiles to C 
as an intermediary language. Providing the generated C files to users 
makes installation easy (it avoids the bootstrapping issue). So it's 
more 'severe' of an issue than just one of for example generating 
documentation files using a 3rd-party tool.

What may make matters worse, is that there are interdependencies between 
a number of hand-written C files and the generated files, so it's not 
always possible to use an older compiler version to reproduce the 
generated C files for a newer compiler; so if you want to merge newer 
compiler sources, you may also need the generated files, at least if you 
want that without fuss. So, there is always a need to somehow transmit 
the generated files too. I guess that this is easier than code the 
system in a way to always allow backwards compatibility (I haven't 
worked on the compiler itself yet, so this is a guess and may need 
confirmation).

Apart from that, I've found it useful (in another project, writing a 
document translator) to keep generated files in a VCS (Git) as well (I 
checked them into the *same* repository as the translator source, even 
if it felt ugly (for the previously mentioned reasons)), as then when I 
changed the translator, I could easily see where it had effect on the 
generated output. It can even serve as a debugging help kind of like a 
test suite does. This may be the case here, too (again, I'm guessing here).

How are other compiler projects which are bootstrapping via C dealing 
with this?

Christian.




More information about the Gambit-list mailing list