From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: by sourceware.org (Postfix, from userid 48) id 60DA73858CDB; Thu, 18 May 2023 19:35:30 +0000 (GMT) DKIM-Filter: OpenDKIM Filter v2.11.0 sourceware.org 60DA73858CDB DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gcc.gnu.org; s=default; t=1684438530; bh=1b0s3tgumxFDsopZYbh4h+W/9iJtdZuv5EVZPwYu7oA=; h=From:To:Subject:Date:In-Reply-To:References:From; b=ZWsuWqZrG3DN1Je1GlOqXjNNCPhHdCTevLP1NAZZKPuwhEDXyiqgHt8U/80Zw+Q81 ANQfpo02zvya23MSoA+Fw5fq4c7Bgm++NYDHai1M3b/MQOJdxGmjJKgAWWsRakrrNk Erpa1sloYc4IZAcspGykhczAskvsrA1l+dDrnn4A= From: "slyfox at gcc dot gnu.org" To: gcc-bugs@gcc.gnu.org Subject: [Bug other/109898] 'make install -j' sometimes corrupts 'dir' file for .info files due to parallel 'install-info' calls Date: Thu, 18 May 2023 19:35:29 +0000 X-Bugzilla-Reason: CC X-Bugzilla-Type: changed X-Bugzilla-Watch-Reason: None X-Bugzilla-Product: gcc X-Bugzilla-Component: other X-Bugzilla-Version: 14.0 X-Bugzilla-Keywords: X-Bugzilla-Severity: normal X-Bugzilla-Who: slyfox at gcc dot gnu.org X-Bugzilla-Status: UNCONFIRMED X-Bugzilla-Resolution: X-Bugzilla-Priority: P3 X-Bugzilla-Assigned-To: unassigned at gcc dot gnu.org X-Bugzilla-Target-Milestone: --- X-Bugzilla-Flags: X-Bugzilla-Changed-Fields: Message-ID: In-Reply-To: References: Content-Type: text/plain; charset="UTF-8" Content-Transfer-Encoding: quoted-printable X-Bugzilla-URL: http://gcc.gnu.org/bugzilla/ Auto-Submitted: auto-generated MIME-Version: 1.0 List-Id: https://gcc.gnu.org/bugzilla/show_bug.cgi?id=3D109898 --- Comment #3 from Sergei Trofimovich --- (In reply to Jonathan Wakely from comment #2) > (In reply to Sergei Trofimovich from comment #0) > > --- gcc-12.2.0/gcc/Makefile.in 2022-08-19 10:09:52.280658631 +0200 > > +++ gcc-12.2.0-new/gcc/Makefile.in 2023-05-04 14:35:44.401420184 +0200 > > @@ -3781,6 +3781,11 @@ > > fi; \ > > fi > >=20=20 > > +# We don't care about the order in which the info files are built, but > > +# install-info doesn't support multiple parallel invocations writing to > > +# the same `dir-file`, so we have to disable parallelism for that reas= on: > > +.NOTPARALLEL: install-info >=20 > Prerequisites of .NOTPARALLEL are ignored, so doesn't this un-parallelize > building the entire gcc sub-dir? When I tested on small example '.NOTPARALLEL: target' serialized exactly prerequisites of 'target' and nothing more. 'info make' seems to confirm the behaviour: """ '.NOTPARALLEL' If '.NOTPARALLEL' is mentioned as a target with no prerequisites, all targets in this invocation of 'make' will be run serially, even if the '-j' option is given. Any recursively invoked 'make' command will still run recipes in parallel (unless its makefile also contains this target). If '.NOTPARALLEL' has targets as prerequisites, then all the prerequisites of those targets will be run serially. This implicitly adds a '.WAIT' between each prerequisite of the listed targets. *Note Disabling Parallel Execution: Parallel Disable. """ Here is the test that confirms it: $ cat Makefile all: a b a: 1 2 echo a 1: sleep 1 2: sleep 1 b: 3 4 echo b 3: sleep 1 4: sleep 1 .NOTPARALLEL: a $ make -j | LANG=3DC ts May 18 20:34:23 sleep 1 May 18 20:34:23 sleep 1 May 18 20:34:23 sleep 1 May 18 20:34:24 sleep 1 May 18 20:34:24 echo b May 18 20:34:24 b May 18 20:34:25 echo a May 18 20:34:25 a Note how it takes 'b' 1 second to finish (due to parallelism) while 'a' tak= es 2 seconds (targets are sequential).=