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!reader02.eternal-september.org!.POSTED!not-for-mail From: "Alejandro R. Mosteo" Newsgroups: comp.lang.ada Subject: Re: GNAT corrupted builds with below second changes Date: Thu, 15 Mar 2018 14:24:10 +0100 Organization: A noiseless patient Spider Message-ID: References: Mime-Version: 1.0 Content-Type: text/plain; charset=utf-8; format=flowed Content-Transfer-Encoding: 8bit Injection-Date: Thu, 15 Mar 2018 13:24:10 -0000 (UTC) Injection-Info: reader02.eternal-september.org; posting-host="53856402f7d8f9cf6211aee79fc9f38a"; logging-data="30138"; mail-complaints-to="abuse@eternal-september.org"; posting-account="U2FsdGVkX185X/S3Yjo2PrdXWenoPoeq" User-Agent: Mozilla/5.0 (X11; Linux x86_64; rv:52.0) Gecko/20100101 Thunderbird/52.6.0 In-Reply-To: Content-Language: en-US Cancel-Lock: sha1:IlUzlIDMG+wtmW8mNmtVJyy5wcY= Xref: reader02.eternal-september.org comp.lang.ada:50995 Date: 2018-03-15T14:24:10+01:00 List-Id: On 14/03/18 23:56, Randy Brukardt wrote: > "Alejandro R. Mosteo" wrote in message > news:p8atvh$74r$1@dont-email.me... >> Hi, >> >> I'm doing some automated testing that involves very fast file generation >> and recompilation. Platform is linux, GPL 2017 or FSF 7.2. I've observed >> that gprbuild seems to not detect that a file is changed if less than a >> second has elapsed. I will guess here that the timestamp being used has >> second precision. This leads to supposedly up-to-date builds that aren't, >> among other funny effects. >> >> I faintly remember having read about this somewhere, but I'm unable to >> find anything related in web searches. Anyone has experienced this? > > Not with GNAT, but we used to have such problems with Janus/Ada programs. I > believe it caused certain ACATS tests to intermittently fail. I think I > "fixed" that by introducing a delay into the compiler in certain > circumstances (the delay being barely noticable to humans, but long enough > to ensure that the time stamps are unique). I did this initially but it mounted up, so I'm now manually deleting .o/.ali files for a few critical files only. > [I don't remember for sure > whether I fixed the problem, but since I don't remember it happening in the > last 5 years, it seems likely that I did something to prevent it.] A better > fix would have been to stop using time for such checks (compiles having > gotten fast enough to make identical timestamps probable, and more so with > every new generation of computers), but that would have required a lot of > compiler and library change. (Definitely not the quick fix I was looking for > at the time.) > > It wouldn't surprise me if GNAT ran into similar issues -- the file > timestamps on Windows (which is what we were/are using) have a 2 second > granularity. > > Randy. The funny thing is I'm almost sure of having read somewhere that this had been addressed in gnat specifically, but I can't locate it. Thanks, Álex.