From: Ludovic Brenta on 10 May 2007 12:37 Stefan Bellon <sbellon(a)sbellon.de> writes: > Gautier wrote: > >> - time stamps to check need of recompilations > > I've always wondered about the focussing on time stamps. I think the way > to do it would be to calculate a hash sum (md5, sha1, ...) on the token > stream without comments. This way you wouldn't have to recompile if you > do layout and commentary changes, and even if you touch the file, you > don't inadvertently trigger a recompilation. That's what GNAT does, only it uses a simple checksum for performance reasons. Calculating the checksum and comparing it with the one in the library (.ali files in the case of GNAT) has to be faster than recompiling the file. -- Ludovic Brenta.
From: Stefan Bellon on 10 May 2007 12:43 Ludovic Brenta wrote: > Stefan Bellon <sbellon(a)sbellon.de> writes: > > Gautier wrote: > > > >> - time stamps to check need of recompilations > > > > I've always wondered about the focussing on time stamps. I think > > the way to do it would be to calculate a hash sum (md5, sha1, ...) > > on the token stream without comments. This way you wouldn't have to > > recompile if you do layout and commentary changes, and even if you > > touch the file, you don't inadvertently trigger a recompilation. > > That's what GNAT does, only it uses a simple checksum for performance > reasons. Calculating the checksum and comparing it with the one in > the library (.ali files in the case of GNAT) has to be faster than > recompiling the file. But timestamps are considered as well. If you touch a file without modifying it otherwise, it triggers a recompilation. -- Stefan Bellon
From: Ludovic Brenta on 10 May 2007 12:49 Stefan Bellon writes: > Ludovic Brenta wrote: > >> Stefan Bellon writes: >> > Gautier wrote: >> > >> >> - time stamps to check need of recompilations >> > >> > I've always wondered about the focussing on time stamps. I think >> > the way to do it would be to calculate a hash sum (md5, sha1, ...) >> > on the token stream without comments. This way you wouldn't have to >> > recompile if you do layout and commentary changes, and even if you >> > touch the file, you don't inadvertently trigger a recompilation. >> >> That's what GNAT does, only it uses a simple checksum for performance >> reasons. Calculating the checksum and comparing it with the one in >> the library (.ali files in the case of GNAT) has to be faster than >> recompiling the file. > > But timestamps are considered as well. If you touch a file without > modifying it otherwise, it triggers a recompilation. Not in my experience. Changing the timestamp causes a recalculation of the checksum, that's all. Even after adding whitespace or pretty-printing the file, there is no recompilation. -- Ludovic Brenta.
From: Jean-Pierre Rosen on 10 May 2007 12:25 Stefan Bellon a �crit : > Gautier wrote: > >> - time stamps to check need of recompilations > > I've always wondered about the focussing on time stamps. I think the way > to do it would be to calculate a hash sum (md5, sha1, ...) on the token > stream without comments. This way you wouldn't have to recompile if you > do layout and commentary changes, and even if you touch the file, you > don't inadvertently trigger a recompilation. > Gnatmake can do that (see option -m) -- --------------------------------------------------------- J-P. Rosen (rosen(a)adalog.fr) Visit Adalog's web site at http://www.adalog.fr
From: Stefan Bellon on 10 May 2007 13:02
Ludovic Brenta wrote: > Stefan Bellon writes: > > But timestamps are considered as well. If you touch a file without > > modifying it otherwise, it triggers a recompilation. > > Not in my experience. Changing the timestamp causes a recalculation > of the checksum, that's all. Even after adding whitespace or > pretty-printing the file, there is no recompilation. Hmmmm: bellonsn(a)cube$ gnatmake foo.adb gnatmake: "foo" up to date. bellonsn(a)cube$ touch foo.adb bellonsn(a)cube$ gnatmake foo.adb gcc -c foo.adb gnatbind -x foo.ali gnatlink foo.ali -- Stefan Bellon |