public inbox for gcc-patches@gcc.gnu.org
 help / color / mirror / Atom feed
From: Jakub Jelinek <jakub@redhat.com>
To: Richard Biener <richard.guenther@gmail.com>
Cc: Gaius Mulley <gaiusmod2@gmail.com>, gcc-patches@gcc.gnu.org
Subject: Re: [PATCH, Modula2] PR-108142 Many empty directories created in the build directory
Date: Tue, 10 Jan 2023 11:46:17 +0100	[thread overview]
Message-ID: <Y71B+UbMHKZQIOv7@tucnak> (raw)
In-Reply-To: <CAFiYyc2EkQXFmBAXeJgfUPu_fr8GWrAyD=R8=dJzqAztPdiKAg@mail.gmail.com>

On Tue, Jan 10, 2023 at 11:16:28AM +0100, Richard Biener via Gcc-patches wrote:
> > @@ -424,7 +388,7 @@ override PLUGINCFLAGS := $(filter-out -mdynamic-no-pic,$(PLUGINCFLAGS))
> >
> >  plugin/m2rte$(soext): $(srcdir)/m2/plugin/m2rte.cc $(GCC_HEADER_DEPENDENCIES_FOR_M2) \
> >          insn-attr-common.h insn-flags.h $(generated_files)
> > -       test -d plugin || mkdir plugin
> > +       -test -d plugin || $(mkinstalldirs) plugin
> 
> I wonder if that's possibly racy (that's why you use mkinstalldirs?)?

Using $(mkinstalldirs) in the patch is what I've suggested because
previously the patch was using mkdir -p which we almost never use
(I think only some Ada Makefiles).  Above when it is a single directory
mkdir is fine.
	-test -d $(TESTSUITEDIR) || mkdir $(TESTSUITEDIR)
etc. is what is used in gcc/Makefile.in in some spots.
If 2 shells do that test -d plugin || mkdir plugin at the same time,
then yes, both might do mkdir, but that is why we have the - at the start,
the error of doing mkdir twice will be ignored then.

	Jakub


  reply	other threads:[~2023-01-10 10:46 UTC|newest]

Thread overview: 4+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2023-01-10  1:48 Gaius Mulley
2023-01-10 10:16 ` Richard Biener
2023-01-10 10:46   ` Jakub Jelinek [this message]
2023-01-10 16:01     ` Gaius Mulley

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=Y71B+UbMHKZQIOv7@tucnak \
    --to=jakub@redhat.com \
    --cc=gaiusmod2@gmail.com \
    --cc=gcc-patches@gcc.gnu.org \
    --cc=richard.guenther@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 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).