public inbox for gdb-patches@sourceware.org
 help / color / mirror / Atom feed
From: Pedro Alves <pedro@palves.net>
To: Andrew Burgess <aburgess@redhat.com>, gdb-patches@sourceware.org
Cc: Tom Tromey <tom@tromey.com>
Subject: Re: [PATCHv3 6/6] gdb/doc: fix parallel build of pdf and dvi files
Date: Fri, 14 Jun 2024 20:00:10 +0100	[thread overview]
Message-ID: <cb844575-7b18-4f97-9ae2-dd0a7addd3ce@palves.net> (raw)
In-Reply-To: <412817c6d07836aa2ba2026ac9047fb283c481ea.1717696065.git.aburgess@redhat.com>

On 2024-06-06 18:49, Andrew Burgess wrote:
> When building with 'make -j20 -C gdb/doc all-doc' I often see problems
> caused from trying to build some dvi files in parallel with some pdf
> files.  The problem files are: gdb.dvi and gdb.pdf; stabs.dvi and
> stabs.pdf; and annotate.dvi and annotate.pdf.
> 
> The problem is that building these files create temporary files in the
> local directory.  There's already a race here that two make threads
> might try to create these files at the same time.
> 
> But it gets worse, to avoid issues where a failed build could leave
> these temporary files in a corrupted state, and so prevent the next
> build from succeeding, the recipe for each of these files delete all
> the temporary files first, this obviously causes problems if some
> other thread has already started the build and is relying on these
> temporary files.
> 
> To work around this problem I propose we start using the --build flag
> for texi2dvi (which is the same tool used to create the pdf files).
> The --build flag allows for the temporary files to be placed into a
> sub-directory, e.g. creating gdb.pdf will create the temporary files
> in gdb.t2d/pdf/ and gdb.dvi uses gdb.t2d/dvi/, in this way the
> temporary files will never clash, and we can easily delete the
> specific sub-directory at the start of the recipe to ensure a
> successful build.
> 
> Very old versions of texi2dvi don't support --build, so I've added a
> configure check for this option.  If the option is not supported then
> we don't use it.  This means we fall back to placing temporary files
> in the local directory, which means parallel builds will remain
> broken.  The --build option is definitely present in texi2dvi version
> 6.1, from 2016, so any version after that should be fine.
> 

If we care about old versions enough to support them like this, then
couldn't we instead make the subdirectories ourselves and build there,
instead of using --build?  That way, we would only have one code path,
and it would work the same in new or old texi2dvi?

I mean, make the rule do something like:

  mkdir -p pdf && cd pdf && texi2dvi ...


  reply	other threads:[~2024-06-14 19:00 UTC|newest]

Thread overview: 42+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2024-05-11  9:37 [PATCH 0/4] gdb/doc: build fixes and improvements Andrew Burgess
2024-05-11  9:37 ` [PATCH 1/4] gdb/doc: don't delete *.pod files too early Andrew Burgess
2024-05-13 16:13   ` Tom Tromey
2024-05-14 15:53     ` Andrew Burgess
2024-05-11  9:37 ` [PATCH 2/4] gdb/doc: don't try to copy GDBvn.texi from the source tree Andrew Burgess
2024-05-13 16:12   ` Tom Tromey
2024-05-13 17:33     ` Eli Zaretskii
2024-05-14 13:32       ` Andrew Burgess
2024-06-14 19:06     ` Pedro Alves
2024-05-11  9:37 ` [PATCH 3/4] gdb/doc: fix parallel build of refcard related targets Andrew Burgess
2024-05-13 16:13   ` Tom Tromey
2024-05-11  9:37 ` [PATCH 4/4] gdb/doc: fix parallel build of pdf and dvi files Andrew Burgess
2024-05-13 16:18   ` Tom Tromey
2024-05-14 13:40     ` Andrew Burgess
2024-05-31  8:18 ` [PATCHv2 0/5] gdb/doc: parallel build fixes and improvements Andrew Burgess
2024-05-31  8:18   ` [PATCHv2 1/5] gdb/doc: don't try to copy GDBvn.texi from the source tree Andrew Burgess
2024-05-31  8:18   ` [PATCHv2 2/5] gdb/doc: allow for version.subst in " Andrew Burgess
2024-05-31 10:40     ` Eli Zaretskii
2024-06-03 14:22       ` Andrew Burgess
2024-06-06 11:59         ` Eli Zaretskii
2024-06-06 17:52           ` Andrew Burgess
2024-05-31  8:18   ` [PATCHv2 3/5] gdb/doc: also look in srcdir when running TEXI2POD Andrew Burgess
2024-05-31  8:18   ` [PATCHv2 4/5] gdb/doc: fix parallel build of refcard related targets Andrew Burgess
2024-05-31  8:18   ` [PATCHv2 5/5] gdb/doc: fix parallel build of pdf and dvi files Andrew Burgess
2024-06-06 17:49   ` [PATCHv3 0/6] gdb/doc: parallel build fixes and improvements Andrew Burgess
2024-06-06 17:49     ` [PATCHv3 1/6] gdb/doc: don't try to copy GDBvn.texi from the source tree Andrew Burgess
2024-06-14 18:45       ` Pedro Alves
2024-06-06 17:49     ` [PATCHv3 2/6] gdb/doc: merge rules for building .1 and .5 man pages Andrew Burgess
2024-06-06 17:49     ` [PATCHv3 3/6] gdb/doc: allow for version.subst in the source tree Andrew Burgess
2024-06-14 18:44       ` Pedro Alves
2024-06-06 17:49     ` [PATCHv3 4/6] gdb/doc: also look in srcdir when running TEXI2POD Andrew Burgess
2024-06-06 17:49     ` [PATCHv3 5/6] gdb/doc: fix parallel build of refcard related targets Andrew Burgess
2024-06-06 17:49     ` [PATCHv3 6/6] gdb/doc: fix parallel build of pdf and dvi files Andrew Burgess
2024-06-14 19:00       ` Pedro Alves [this message]
2024-06-15  9:44         ` Andrew Burgess
2024-06-15 12:40           ` Eli Zaretskii
2024-06-15 14:59             ` Andrew Burgess
2024-06-15 15:04             ` Andrew Burgess
2024-06-21 15:35               ` Pedro Alves
2024-06-24 11:16                 ` Andrew Burgess
2024-06-25 13:39               ` Andrew Burgess
2024-06-14 18:14     ` [PATCHv3 0/6] gdb/doc: parallel build fixes and improvements Tom Tromey

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=cb844575-7b18-4f97-9ae2-dd0a7addd3ce@palves.net \
    --to=pedro@palves.net \
    --cc=aburgess@redhat.com \
    --cc=gdb-patches@sourceware.org \
    --cc=tom@tromey.com \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for read-only IMAP folder(s) and NNTP newsgroup(s).