All of lore.kernel.org
 help / color / mirror / Atom feed
From: Arnaldo Carvalho de Melo <acme@kernel.org>
To: Dmitry Dolgov <9erthalion6@gmail.com>
Cc: Adrian Hunter <adrian.hunter@intel.com>,
	Ian Rogers <irogers@google.com>,
	James Clark <james.clark@linaro.org>,
	Jiri Olsa <jolsa@kernel.org>, Namhyung Kim <namhyung@kernel.org>,
	Linux Kernel Mailing List <linux-kernel@vger.kernel.org>,
	linux-perf-users@vger.kernel.org
Subject: Re: [PATCH 1/1] tools build: Fix rust feature detection
Date: Tue, 10 Feb 2026 08:55:27 -0300	[thread overview]
Message-ID: <aYscrw4D4W27zw-k@x1> (raw)
In-Reply-To: <sc2w3tcjcle4zhz72b2jdnyfnhzl6atiecium2dwcmrlvn6syb@n573cdtyldne>

On Tue, Feb 10, 2026 at 11:02:56AM +0100, Dmitry Dolgov wrote:
> > On Mon, Feb 09, 2026 at 02:27:43PM -0300, Arnaldo Carvalho de Melo wrote:
> > Features in FEATURE_TESTS_BASIC will be set as being available if
> > test-all.c builds, so since the rust test isn't included in test-all.c,
> > we can't have 'rust' in there, remove it from FEATURE_TESTS_BASIC and
> > use feature-check so that it tries to build test-rust.bin, doing the
> > actual feature detection.
> 
> My bad, thanks for fixing it.
> 
> > And after installing it:
> > 
> >   ...                                    rust: [ on  ]
> > 
> >   $ cat /tmp/build/perf-tools-next/feature/test-rust.make.output
> >   $ file /tmp/build/perf-tools-next/feature/test-rust.bin
> > /tmp/build/perf-tools-next/feature/test-rust.bin: ELF 64-bit LSB pie executable, x86-64, version 1 (SYSV), dynamically linked, interpreter /lib64/ld-linux-x86-64.so.2, BuildID[sha1]=9c416edf673ee3705b97bae893a99a6fcf1ee258, for GNU/Linux 3.2.0, with debug_info, not stripped
> >   $
> >   $ perf -vv | grep RUST
> >                   rust: [ on  ]  # HAVE_RUST_SUPPORT
> 
> I've noticed few more problem, maybe worth fixing it here as well:
> 
> * test-rust.bin is missing from the list of FILES, and thus is not removed by
> the clean target. This could lead to a false feature detection, since the
> binary stays there.
> 
> * Target to build test-rust.bin does not emit a dependencies file.
> 
> I've tested the following diff after first having rust installed, then removing
> it and building again.


I'll add it with your Signed-off-by, etc, please submit as a complete
patch next time :-)

- Arnaldo
 
> diff --git a/tools/build/feature/Makefile b/tools/build/feature/Makefile
> index 9ae69d85716..28d4ff0841a 100644
> --- a/tools/build/feature/Makefile
> +++ b/tools/build/feature/Makefile
> @@ -73,7 +73,8 @@ FILES=                                          \
>           test-clang-bpf-co-re.bin              \
>           test-file-handle.bin                  \
>           test-libpfm4.bin                      \
> -         test-libopenssl.bin
> +         test-libopenssl.bin                   \
> +         test-rust.bin
> 
>  FILES := $(addprefix $(OUTPUT),$(FILES))
> 
> @@ -112,7 +113,7 @@ __BUILD = $(CC) $(CFLAGS) -MD -Wall -Werror -o $@ $(patsubst %.bin,%.c,$(@F)) $(
>  __BUILDXX = $(CXX) $(CXXFLAGS) -MD -Wall -Werror -o $@ $(patsubst %.bin,%.cpp,$(@F)) $(LDFLAGS)
>    BUILDXX = $(__BUILDXX) > $(@:.bin=.make.output) 2>&1
> 
> -__BUILDRS = $(RUSTC) $(RUSTC_FLAGS) -o $@ $(patsubst %.bin,%.rs,$(@F))
> +__BUILDRS = $(RUSTC) $(RUSTC_FLAGS) --emit=dep-info=$(patsubst %.bin,%.d,$(@F)),link -o $@ $(patsubst %.bin,%.rs,$(@F))
>    BUILDRS = $(__BUILDRS) > $(@:.bin=.make.output) 2>&1
> 
> Reviewed-by: Dmitrii Dolgov <9erthalion6@gmail.com>

  reply	other threads:[~2026-02-10 11:55 UTC|newest]

Thread overview: 7+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2026-02-09 17:27 [PATCH 1/1] tools build: Fix rust feature detection Arnaldo Carvalho de Melo
2026-02-10 10:02 ` Dmitry Dolgov
2026-02-10 11:55   ` Arnaldo Carvalho de Melo [this message]
2026-02-10 12:26   ` Arnaldo Carvalho de Melo
2026-02-10 20:16     ` Dmitry Dolgov
2026-02-10 20:54       ` Arnaldo Carvalho de Melo
2026-02-10 21:07         ` Dmitry Dolgov

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=aYscrw4D4W27zw-k@x1 \
    --to=acme@kernel.org \
    --cc=9erthalion6@gmail.com \
    --cc=adrian.hunter@intel.com \
    --cc=irogers@google.com \
    --cc=james.clark@linaro.org \
    --cc=jolsa@kernel.org \
    --cc=linux-kernel@vger.kernel.org \
    --cc=linux-perf-users@vger.kernel.org \
    --cc=namhyung@kernel.org \
    /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.