Kernel KVM virtualization development
 help / color / mirror / Atom feed
From: Alex Williamson <alex@shazbot.org>
To: David Matlack <dmatlack@google.com>
Cc: kvm@vger.kernel.org, linux-kernel@vger.kernel.org,
	Sean Christopherson <seanjc@google.com>,
	Sashiko <sashiko-bot@kernel.org>,
	alex@shazbot.org
Subject: Re: [PATCH] vfio: selftests: Ensure libvfio output dirs are always created
Date: Fri, 12 Jun 2026 10:56:08 -0600	[thread overview]
Message-ID: <20260612105608.2a51d84d@shazbot.org> (raw)
In-Reply-To: <20260611213945.3714421-1-dmatlack@google.com>

On Thu, 11 Jun 2026 21:39:45 +0000
David Matlack <dmatlack@google.com> wrote:

> Add an explicit dependency between the output object files and the
> output directories that need to be created to hold those files. This
> ensures that the output directories are always created.
> 
> Creating the output directories at parse time (current behavior) doesn't
> support the scenario where someone does "make clean all". The
> directories will be created during parsing, deleted during "clean" and
> then not available for the "all" target.
> 
> Use an order-only prerequisite for the output directories, rather than a
> normal prerequisite, to avoid unnecessary recompilations.
> 
> Fixes: 19faf6fd969c ("vfio: selftests: Add a helper library for VFIO selftests")
> Reported-by: Sashiko <sashiko-bot@kernel.org>
> Closes: https://lore.kernel.org/kvm/20260610010314.DB8861F00893@smtp.kernel.org/
> Signed-off-by: David Matlack <dmatlack@google.com>
> ---
> Cc: Sean Christopherson <seanjc@google.com>
> 
>  tools/testing/selftests/vfio/lib/libvfio.mk | 6 ++++--
>  1 file changed, 4 insertions(+), 2 deletions(-)
> 
> diff --git a/tools/testing/selftests/vfio/lib/libvfio.mk b/tools/testing/selftests/vfio/lib/libvfio.mk
> index b7857319c3f1..2b8d73b7d329 100644
> --- a/tools/testing/selftests/vfio/lib/libvfio.mk
> +++ b/tools/testing/selftests/vfio/lib/libvfio.mk
> @@ -20,11 +20,13 @@ LIBVFIO_OUTPUT := $(OUTPUT)/libvfio
>  LIBVFIO_O := $(patsubst %.c, $(LIBVFIO_OUTPUT)/%.o, $(LIBVFIO_C))
>  
>  LIBVFIO_O_DIRS := $(shell dirname $(LIBVFIO_O) | uniq)
> -$(shell mkdir -p $(LIBVFIO_O_DIRS))
> +
> +$(LIBVFIO_O_DIRS):
> +	mkdir -p $@
>  
>  CFLAGS += -I$(LIBVFIO_SRCDIR)/include
>  
> -$(LIBVFIO_O): $(LIBVFIO_OUTPUT)/%.o : $(LIBVFIO_SRCDIR)/%.c
> +$(LIBVFIO_O): $(LIBVFIO_OUTPUT)/%.o : $(LIBVFIO_SRCDIR)/%.c | $(LIBVFIO_O_DIRS)
>  	$(CC) $(CFLAGS) $(CPPFLAGS) $(TARGET_ARCH) -c $< -o $@
>  
>  EXTRA_CLEAN += $(LIBVFIO_OUTPUT)
> 
> base-commit: a26b499b757cfc8bbff1088bb1b844639e250893

Applied to vfio next branch for v7.2.  Thanks,

Alex

      reply	other threads:[~2026-06-12 16:56 UTC|newest]

Thread overview: 2+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2026-06-11 21:39 [PATCH] vfio: selftests: Ensure libvfio output dirs are always created David Matlack
2026-06-12 16:56 ` Alex Williamson [this message]

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=20260612105608.2a51d84d@shazbot.org \
    --to=alex@shazbot.org \
    --cc=dmatlack@google.com \
    --cc=kvm@vger.kernel.org \
    --cc=linux-kernel@vger.kernel.org \
    --cc=sashiko-bot@kernel.org \
    --cc=seanjc@google.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