From mboxrd@z Thu Jan 1 00:00:00 1970 X-Spam-Checker-Version: SpamAssassin 3.4.4 (2020-01-24) on polar.synack.me X-Spam-Level: X-Spam-Status: No, score=-1.9 required=5.0 tests=BAYES_00 autolearn=unavailable autolearn_force=no version=3.4.4 Path: eternal-september.org!reader01.eternal-september.org!feeder.eternal-september.org!nntp-feed.chiark.greenend.org.uk!ewrotcd!newsfeed.xs3.de!io.xs3.de!news.jacob-sparre.dk!franka.jacob-sparre.dk!pnx.dk!.POSTED.rrsoftware.com!not-for-mail From: "Randy Brukardt" Newsgroups: comp.lang.ada Subject: Re: GNAT Modification_Time limitation Date: Tue, 20 Nov 2018 17:53:58 -0600 Organization: JSA Research & Innovation Message-ID: References: <0577e947-d691-4b81-aca6-b2e86bbef634@googlegroups.com> <04221674-95d8-4d4a-8743-42877b13eead@googlegroups.com> Injection-Date: Tue, 20 Nov 2018 23:53:59 -0000 (UTC) Injection-Info: franka.jacob-sparre.dk; posting-host="rrsoftware.com:24.196.82.226"; logging-data="28056"; mail-complaints-to="news@jacob-sparre.dk" X-Priority: 3 X-MSMail-Priority: Normal X-Newsreader: Microsoft Outlook Express 6.00.2900.5931 X-MimeOLE: Produced By Microsoft MimeOLE V6.00.2900.7246 X-RFC2646: Format=Flowed; Original Xref: reader01.eternal-september.org comp.lang.ada:54852 Date: 2018-11-20T17:53:58-06:00 List-Id: wrote in message news:04221674-95d8-4d4a-8743-42877b13eead@googlegroups.com... ... >I had a similar real case because git created two files with the same >timestamp. And then it took me days to understand why some of >my tests appeared to be linked with both versions of utils.adb, since >I could see in the log file traces from both src1/utils.adb and >src2/utils.adb. Very very confusing. > >So I would indeed recommend that you don't bother with timestamps, >and only look at file contents (or use timestamp+file path at the very >least, or perhaps inodes). I wouldn't claim that the situation is that dire; it seems to be related to the particular implementation of a particular GNAT feature (project scenario variables). If you're not implementing something where the source code location can be changed for a particular build, then timestamps will work (but you have to remember that they are quite granular). It also seems to be related in part of source-based compilation (which necessarily keeps less information between builds). In a Janus/Ada project (which is very different than a GNAT project -- it's a binary DB-like file of compilation information), changing the location of a source file would invalidate the entire entry and essentially delete any existing compilations. More likely, however, is that a scenario would be set up using separate project files (most likely using Windows batch files/Unix shell-scripts to automate), so each would have their own set of compilation states. And it's completely impossible to bind multiple versions of a unit into a single executable; only one or the other could be selected - and if somehow some files were compiled against the wrong one, some or all of the compilation timestamps wouldn't match (which would cause binding failure). The moral here is how to implement a Make-like tool depends a lot on what capabilities it will have. Randy.