This is the mail archive of the
libc-alpha@sourceware.org
mailing list for the glibc project.
Re: [PATCH] Re: Testsuite races -- updated
> I can't see why we're creating the datafile, then moving it into place
> as separate steps in this code to begin with. ISTM we should just have
> msgfmt put the bits were they belong.
In general there are two reasons for this.
1. atomic supersede
This only matters if there might be concurrent users of the old file.
It doesn't apply here.
2. avoid leaving partial output on failure
This matters for anything that's a make target, since the next make run
will see that the file exists and is new enough, and not run the
commands again. This applies especially to redirections, where the
command will create (and touch) the output file even if it fails
utterly. I don't know whether msgfmt reliably avoids touching (or else
removes) its output file in failure cases. But it never hurts to cover
this case.
> 2012-08-17 Jeff Law <law@redhat.com>
>
> * intl/Makefile (codeset_mo): New variable.
> $(codeset_mo): New target.
Missing parens around this.
> (tst-codeset.out): Depend on that. Remove explicit rule.
> (tst-gettext3.out, tst-gettext5.out): Likewise.
> (LOCPATH-ENV, tst-codeset-ENV): New variables.
> (tst-gettext3-ENV, tst-gettext5-ENV): Likewise.
> * intl/tst-codeset.sh: Remove.
> * intl/tst-gettext3.sh, intl/tst-gettext5.sh: Likewise.
Don't separate file names with a comma. Use separate lines.
> +$(codeset_mo):
> + $(make-target-directory)
> + msgfmt -o $@ tstcodeset.po
Unless you want to examine msgfmt and testify to its inability to leave a
partial output file on failure, make this $@T with a mv -f command.
> +$(objpfx)tst-codeset.out: $(objpfx)tst-codeset $(codeset_mo)
> +$(objpfx)tst-gettext3.out: $(objpfx)tst-gettext3 $(codeset_mo)
> +$(objpfx)tst-gettext5.out: $(objpfx)tst-gettext5 $(codeset_mo)
You don't actually need the first dependency here.
The pattern rule will supply it (and make it first so $< gets it).
Thanks,
Roland