D-Programming-Language/tools — pull request #26 by AndrejMitrovic (2012-04-17 16:05:59+00:00)
Title: Implement rebuild on compiler version change

Currently RDMD will not recompile a file if you've upgraded/downgraded the compiler. E.g. this source:

import std.stdio;
void main()
{
writeln(__VERSION__);
}

Once compiled with RDMD 2.058, it will print `2058`. If you then upgrade your compiler (e.g. via DVM), the new RDMD will not recompile the file and you'll get the same version printed out, **unless** you pass the `--force` switch.

This is a problem when e.g. you're trying to figure out if a bug is a regression (you'll end up re-running the same executable after downgrading compilers).

I tried implementing it by checking the `version` field of the .deps file, however the deps file doesn't always get regenerated, and this gets very complicated to figure out. But the simplest way to implement this is to simply prepend the current compiler version number to the temporary folder name.