public inbox for linux-perf-users@vger.kernel.org
 help / color / mirror / Atom feed
From: sashiko-bot@kernel.org
To: "Gaurav Sharma" <sgaurav00719@gmail.com>
Cc: linux-perf-users@vger.kernel.org
Subject: Re: [PATCH] libperf: fix parallel build race with header install
Date: Tue, 14 Apr 2026 08:05:06 +0000	[thread overview]
Message-ID: <20260414080506.9CA33C19425@smtp.kernel.org> (raw)
In-Reply-To: <20260414071242.95637-1-mgsharm@amazon.com>

Sashiko AI review found 1 potential issue(s):
- [Medium] The patch breaks standalone compilation of `libperf` for unprivileged users and improperly pollutes the host filesystem for root users.
--

commit 208fe5b88e547b876734f4625a046aecb0847770
Author: Gaurav Sharma <sgaurav00719@gmail.com>

libperf: fix parallel build race with header install

This commit attempts to fix a race condition between the install_headers
and libperf.a targets when building with high parallelism. It does this
by making the libperf compilation target depend on install_headers.

> diff --git a/tools/lib/perf/Makefile b/tools/lib/perf/Makefile
> --- a/tools/lib/perf/Makefile
> +++ b/tools/lib/perf/Makefile
[ ... ]
> @@ -99,7 +99,7 @@ $(LIBAPI)-clean:
>  	$(call QUIET_CLEAN, libapi)
>  	$(Q)$(MAKE) -C $(LIB_DIR) O=$(OUTPUT) clean >/dev/null
>  
> -$(LIBPERF_IN): FORCE
> +$(LIBPERF_IN): install_headers FORCE
>  	$(Q)$(MAKE) $(build)=libperf

Does this break standalone compilation of libperf for unprivileged users?

In a standalone build (e.g., make -C tools/lib/perf), variables like DESTDIR
and prefix default to empty strings. Because of this, it appears that
INSTALL_HDRS_PFX will evaluate to the absolute path /include/perf.

Won't forcing a standard compilation to execute system-level installation
steps abort the build with a 'Permission denied' error for unprivileged
users? For root users, will this unexpectedly write to /include/perf and
pollute the host's root filesystem outside of an explicit make install phase?

Would it be better to serialize the install_headers and compilation targets
in the caller (tools/perf/Makefile.perf) rather than within the library's
local build rules?

Serializing these targets in Makefile.perf would also resolve identical
pre-existing parallel build races in libapi, libbpf, libsubcmd, and
libsymbol which are not covered by this change.

-- 
Sashiko AI review · https://sashiko.dev/#/patchset/20260414071242.95637-1-mgsharm@amazon.com?part=1

  reply	other threads:[~2026-04-14  8:05 UTC|newest]

Thread overview: 3+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2026-04-14  7:12 [PATCH] libperf: fix parallel build race with header install Gaurav Sharma
2026-04-14  8:05 ` sashiko-bot [this message]
2026-04-14 13:13 ` Ian Rogers

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=20260414080506.9CA33C19425@smtp.kernel.org \
    --to=sashiko-bot@kernel.org \
    --cc=linux-perf-users@vger.kernel.org \
    --cc=sashiko@lists.linux.dev \
    --cc=sgaurav00719@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