GNU bug report logs - #19614
make dist exits succesfully even when tar exits with error

Previous Next

Package: automake;

Reported by: Dimitrios Apostolou <jimis <at> gmx.net>

Date: Fri, 16 Jan 2015 15:02:02 UTC

Severity: normal

Tags: confirmed

Full log


View this message in rfc822 format

From: Bogdan <bogdro_rep <at> gmx.us>
To: Nick Bowler <nbowler <at> draconx.ca>, Karl Berry <karl <at> freefriends.org>
Cc: jimis <at> gmx.net, automake-patches <at> gnu.org
Subject: bug#19614: Split packaging invocation to catch errors
Date: Tue, 18 Jul 2023 21:26:44 +0200
Nick Bowler <nbowler <at> draconx.ca>, Tue Jul 18 2023 08:55:53 GMT+0200
(Central European Summer Time)
> On 2023-07-17, Karl Berry <karl <at> freefriends.org> wrote:
>> Hi Dimitrios, Bogdan - back on this bug from 2015 (sorry):
>>      https://debbugs.gnu.org/cgi/bugreport.cgi?bug=19614
>>
>> Bogdan sent a patch that splits the tar and compress into separate
>> invocations.  It seems basically good to me, but the dist-formats test
>> fails because it builds multiple archive formats (.tar.gz, .tar.bz2,
>> etc.) in parallel, and so removing $(distdir).tar (and .err) files are
>> subject to a race condition.
>
>>   dist-gzip: distdir
>> -	tardir=$(distdir) && $(am__tar) | eval GZIP= gzip $(GZIP_ENV) -c
>>> $(distdir).tar.gz
>> +	tardir=$(distdir) && $(am__tar) > $(distdir).tar 2>$(distdir).tarerr
>>
>> So my question is, will it suffice in this limited case to just put $$
>> into the filenames? It seems like it should be ok to me, but I'm not
>> sure I have enough imagination to know why that would fail. I can't see
>> figuring out how to run mktemp here.
>
> With the tar file generation as a separate command, it should be
> straightforward to avoid this problem by just moving the tar generation
> and error checking commands into a separate rule.  Then changing all the
> various dist-xyz commands to depend on that instead of distdir.  Example:
>
>    $(distdir).tar: distdir
>    	commands to tar it
>
>    dist-gzip: $(distdir).tar
>    	commands to gzip it
>
> and so on.  Then there should be no race with parallel "make dist" as
> the tar file will only be generated once.


 Probably a better idea than mine, e.g.

tmpname=`mktemp $(distdir)/dist.XXXXXX`
tardir=$(distdir) && $(am__tar) > $(tmpname).tar 2>$(distdir).err

or

tardir=$(distdir) && $(am__tar) > $(distdir)-$RANDOM.tar 2>$(distdir).err

[...]

--
Regards - Bogdan ('bogdro') D.                 (GNU/Linux & FreeDOS)
X86 assembly (DOS, GNU/Linux):    http://bogdro.evai.pl/index-en.php
Soft(EN): http://bogdro.evai.pl/soft  http://bogdro.evai.pl/soft4asm
www.Xiph.org  www.TorProject.org  www.LibreOffice.org  www.GnuPG.org





This bug report was last modified 1 year and 334 days ago.

Previous Next


GNU bug tracking system
Copyright (C) 1999 Darren O. Benham, 1997,2003 nCipher Corporation Ltd, 1994-97 Ian Jackson.