All of lore.kernel.org
 help / color / mirror / Atom feed
From: Patrick Steinhardt <ps@pks.im>
To: Junio C Hamano <gitster@pobox.com>
Cc: Philippe Blain via GitGitGadget <gitgitgadget@gmail.com>,
	git@vger.kernel.org,
	Philippe Blain <levraiphilippeblain@gmail.com>
Subject: Re: [PATCH] Makefile: fix dependency for $(UNIT_TEST_DIR)/clar/clar.o
Date: Tue, 8 Oct 2024 05:58:09 +0200	[thread overview]
Message-ID: <ZwSt0ZrlDaYCzfRX@pks.im> (raw)
In-Reply-To: <xmqqldyz76ui.fsf@gitster.g>

On Mon, Oct 07, 2024 at 05:53:41PM -0700, Junio C Hamano wrote:
> "Philippe Blain via GitGitGadget" <gitgitgadget@gmail.com> writes:
> 
> > From: Philippe Blain <levraiphilippeblain@gmail.com>
> >
> > The clar source file '$(UNIT_TEST_DIR)/clar/clar.c' includes the
> > generated 'clar.suite', but this dependency is not taken into account by
> > our Makefile, so that it is possible for a parallel build to fail if
> > Make tries to build 'clar.o' before 'clar.suite' is generated.
> >
> > Correctly specify the dependency.
> >
> > Signed-off-by: Philippe Blain <levraiphilippeblain@gmail.com>
> > ---
> >     Makefile: fix dependency for $(UNIT_TEST_DIR)/clar/clar.o
> >     
> >     Hi Patrick,
> >     
> >     I tried building v2.47.0 and stumbled onto this small issue. It
> >     reproduces for me from a fresh clone on my old 2009 Mac with make -j -l
> >     2.5, it's a little curious that no one ran into this yet.
> 
> I suspect that nobody tells make to build clar.o (and nothing else).
> 
> Instead, the t/unit-tests/bin/unit-tests target is what is typically
> built, which is part of $(CLAR_TEST_PROG) that has clar.suite as one
> of its dependencies.
> 
>     $ make
>     $ rm -f t/unit-tests/clar.suite t/unit-tests/clar/clar.o
>     $ make -j1 t/unit-tests/bin/unit-tests
>     GEN t/unit-tests/clar.suite
>     CC t/unit-tests/clar/clar.o
>     LINK t/unit-tests/bin/unit-tests
> 
> What is possible to happen from the broken dependencies is when I
> did not remove clar.o in the above experiment.  We may rebuild
> clar.suite and then link clar.o that is outdated without realizing.

Makes sense. In any case, the fix looks good to me, thanks!

Patrick

  reply	other threads:[~2024-10-08  3:58 UTC|newest]

Thread overview: 8+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2024-10-07 17:43 [PATCH] Makefile: fix dependency for $(UNIT_TEST_DIR)/clar/clar.o Philippe Blain via GitGitGadget
2024-10-08  0:53 ` Junio C Hamano
2024-10-08  3:58   ` Patrick Steinhardt [this message]
2024-10-10 12:04     ` Philippe Blain
2024-10-10 18:50       ` Junio C Hamano
2024-10-11 17:29 ` [PATCH v2] " Philippe Blain via GitGitGadget
2024-10-14 11:59   ` Patrick Steinhardt
2024-10-15  0:34     ` Taylor Blau

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=ZwSt0ZrlDaYCzfRX@pks.im \
    --to=ps@pks.im \
    --cc=git@vger.kernel.org \
    --cc=gitgitgadget@gmail.com \
    --cc=gitster@pobox.com \
    --cc=levraiphilippeblain@gmail.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 an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.