From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: from us-smtp-delivery-124.mimecast.com (us-smtp-delivery-124.mimecast.com [170.10.133.124]) by sourceware.org (Postfix) with ESMTPS id 24E59387084B for ; Sat, 15 Jun 2024 09:44:19 +0000 (GMT) DMARC-Filter: OpenDMARC Filter v1.4.2 sourceware.org 24E59387084B Authentication-Results: sourceware.org; dmarc=pass (p=none dis=none) header.from=redhat.com Authentication-Results: sourceware.org; spf=pass smtp.mailfrom=redhat.com ARC-Filter: OpenARC Filter v1.0.0 sourceware.org 24E59387084B Authentication-Results: server2.sourceware.org; arc=none smtp.remote-ip=170.10.133.124 ARC-Seal: i=1; a=rsa-sha256; d=sourceware.org; s=key; t=1718444660; cv=none; b=D9kOCOuGp+gayNAziUQCMiJRDevNx8FEpHImAyYHFYZLtdIa0xrFD8NX+gXjnbVP6L8V/aiCPQur95PSOO3SEyN7RNATQU7a8xNo9qqLj8jcP19ewnZGbPyewJ2TXDR3b2uGPJihd3kwLmtalwdnEyoHNcyq/RmrX1ENSNr8j4k= ARC-Message-Signature: i=1; a=rsa-sha256; d=sourceware.org; s=key; t=1718444660; c=relaxed/simple; bh=VbaYcLd2QnM+9ApiA6oYnE2Dz1hph7doCqXB5Dfx1dc=; h=DKIM-Signature:From:To:Subject:Date:Message-ID:MIME-Version; b=nW4a9ip5fYZytSsrZnKlbl8PTIv64PadySrMNVVf5FU1X6c+yRrtjAQQLFdLnGIH9KpL2Yn7vGmskTPcoIcqXcxu4CTBMlyuB11uacMPWd3X8YbgyvQJeGMlKM5Ns0OthujcbxZOveaPlnmBmnTafqd30DXk8Ijz7F+lN2vVg1I= ARC-Authentication-Results: i=1; server2.sourceware.org DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=redhat.com; s=mimecast20190719; t=1718444658; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:cc:mime-version:mime-version:content-type:content-type: in-reply-to:in-reply-to:references:references; bh=24L/tQwT+YJDC7FwkYk4q7/AM46r+TuQJodlxWwwd64=; b=RTj6RALGPxma/1/0Eg8SLjlqbnE6RNNGxPwYttIW9TCEdyYXSwlBCZvEJOHE50LFJaL1Pb 9PN5VhQHBLr44WRHqYKVqzwB8Hx9vXk95KlmZdMLSYiIM2Urh91oxRjV3Tt+RWzITiE5yO NgvvR+aVs4zVEpdr9Zf9t00/SFBtdRE= Received: from mail-ej1-f72.google.com (mail-ej1-f72.google.com [209.85.218.72]) by relay.mimecast.com with ESMTP with STARTTLS (version=TLSv1.3, cipher=TLS_AES_256_GCM_SHA384) id us-mta-28-u_eIW6DWNQ-QCtwdTCAkbA-1; Sat, 15 Jun 2024 05:44:17 -0400 X-MC-Unique: u_eIW6DWNQ-QCtwdTCAkbA-1 Received: by mail-ej1-f72.google.com with SMTP id a640c23a62f3a-a6ef4489474so172810766b.0 for ; Sat, 15 Jun 2024 02:44:17 -0700 (PDT) X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20230601; t=1718444656; x=1719049456; h=mime-version:message-id:date:references:in-reply-to:subject:cc:to :from:x-gm-message-state:from:to:cc:subject:date:message-id:reply-to; bh=24L/tQwT+YJDC7FwkYk4q7/AM46r+TuQJodlxWwwd64=; b=Cqsz+l7fTk7L3omgt5eOuxU65u3OF1AAMjIohbk6bw29WVROHuXh4e2HbgIR+RtdrY RCKnOVgPvr2qV74HNhy8QYfvuUs9g0ceWgGalDUdaWyZgtpgrPvQfxfO+ltg5e9pyfkb c4pIKG/D7dTPNJd+EvoNO/uOx9BwdBr6wNLmIMp+XSB/37+bt+B9qjOfzEYXGdMxvAyD v0mdITpGgMRzKlfyOHuuW0K4Hdmh/M6Q3PlipL0DkzUBemzfwfw2RYnUTloMNKd+Ze5u CEkhK0h0DOlBGHAv+uGAz77WNSclExcgKXQtc1fO6pqlcOje+m56gQAfvjy7XATVNjBv MCxw== X-Forwarded-Encrypted: i=1; AJvYcCWuXmwtEVgNdo2I2/7dn85N6BL88sh9npDzwE4MTbBCvXrzszFFWArcofWr+5cl2hgJv3vGOiJXyAxVFKCd0aIyq8+q03LcFYMwLQ== X-Gm-Message-State: AOJu0YwfcsgK90lkpLSs8afw5J1M19NWd/9GB7JiWfXQj20mv1dpcEER FP9oYPv4Ofqbh8s2L7RVuiIHfR2TSXDD/zNwxMjYo/hJF02f5sRk4/9jAlHQhYHcVRHhQOOe4vs 4NcxCDW1EI1rHk/XrVtuaRv0z3JEZCBXeAJhG4wkJU+YR7jh7vWcLcV7uccg= X-Received: by 2002:a17:906:34d9:b0:a6f:15a3:b085 with SMTP id a640c23a62f3a-a6f60dc5539mr285472066b.51.1718444655975; Sat, 15 Jun 2024 02:44:15 -0700 (PDT) X-Google-Smtp-Source: AGHT+IEzRtJuQtPz/vfzI/LkpxkALj723OEkEnAld+UgkPVdjherPfz78p0e6pbM16OfuR/kdH9gUQ== X-Received: by 2002:a17:906:34d9:b0:a6f:15a3:b085 with SMTP id a640c23a62f3a-a6f60dc5539mr285471366b.51.1718444655413; Sat, 15 Jun 2024 02:44:15 -0700 (PDT) Received: from localhost (92.40.185.178.threembb.co.uk. [92.40.185.178]) by smtp.gmail.com with ESMTPSA id a640c23a62f3a-a6f56db6182sm280047066b.51.2024.06.15.02.44.14 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Sat, 15 Jun 2024 02:44:15 -0700 (PDT) From: Andrew Burgess To: Pedro Alves , gdb-patches@sourceware.org Cc: Tom Tromey Subject: Re: [PATCHv3 6/6] gdb/doc: fix parallel build of pdf and dvi files In-Reply-To: References: <412817c6d07836aa2ba2026ac9047fb283c481ea.1717696065.git.aburgess@redhat.com> Date: Sat, 15 Jun 2024 10:44:13 +0100 Message-ID: <871q4y8rrm.fsf@redhat.com> MIME-Version: 1.0 X-Mimecast-Spam-Score: 0 X-Mimecast-Originator: redhat.com Content-Type: text/plain X-Spam-Status: No, score=0.1 required=5.0 tests=BAYES_00,DKIMWL_WL_HIGH,DKIM_SIGNED,DKIM_VALID,DKIM_VALID_AU,DKIM_VALID_EF,RCVD_IN_ABUSEAT,RCVD_IN_BARRACUDACENTRAL,RCVD_IN_DNSWL_NONE,RCVD_IN_MSPIKE_H4,RCVD_IN_MSPIKE_WL,RCVD_IN_SBL_CSS,SPF_HELO_NONE,SPF_NONE,TXREP,T_SCC_BODY_TEXT_LINE autolearn=no autolearn_force=no version=3.4.6 X-Spam-Checker-Version: SpamAssassin 3.4.6 (2021-04-09) on server2.sourceware.org List-Id: Pedro Alves writes: > 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 ... I took a look at this approach and the problem is fixing all the include paths passed to the texi2dvi command, it all gets a bit messy as we need to add '../' to the start of every include path. I'm happy to drop the configure part of this patch, looking at the texinfo NEWS file the --build=tidy option was added in release 4.9 which came out in June 2007. So if we're willing to make texinfo 4.9 a (doc) build requirement then I'll update the patch. Thanks, Andrew