linux/tools
Arnaldo Carvalho de Melo 3f5dfa472e tools build: Fix rust feature detection
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.

On a system lacking a rust compiler:

  Makefile.config:1158: Rust is not found. Test workloads with rust are disabled.

  Auto-detecting system features:
  ...                                   libdw: [ on  ]
  ...                                   glibc: [ on  ]
  ...                                  libelf: [ on  ]
  ...                                 libnuma: [ on  ]
  ...                  numa_num_possible_cpus: [ on  ]
  ...                               libpython: [ on  ]
  ...                             libcapstone: [ on  ]
  ...                               llvm-perf: [ on  ]
  ...                                    zlib: [ on  ]
  ...                                    lzma: [ on  ]
  ...                                     bpf: [ on  ]
  ...                                  libaio: [ on  ]
  ...                                 libzstd: [ on  ]
  ...                              libopenssl: [ on  ]
  ...                                    rust: [ OFF ]

  $ cat /tmp/build/perf-tools-next/feature/test-rust.make.output
  /bin/sh: line 1: rustc: command not found
  $ file /tmp/build/perf-tools-next/feature/test-rust.bin
  /tmp/build/perf-tools-next/feature/test-rust.bin: cannot open `/tmp/build/perf-tools-next/feature/test-rust.bin' (No such file or directory)
  $
  $ perf -vv | grep RUST
                  rust: [ OFF ]  # HAVE_RUST_SUPPORT
  $

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
  $

Fixes: 6a32fa5ccd ("tools build: Add a feature test for rust compiler")
Cc: Dmitrii Dolgov <9erthalion6@gmail.com>
Signed-off-by: Arnaldo Carvalho de Melo <acme@redhat.com>
2026-02-09 11:10:56 -03:00
..
accounting
arch tools headers: Go back to include asm-generic/unistd.h for arm64 2026-01-26 17:06:32 -03:00
bootconfig
bpf bpftool: Fix build warnings due to MS extensions 2025-12-09 23:21:33 -08:00
build tools build: Fix rust feature detection 2026-02-09 11:10:56 -03:00
certs
cgroup
counter
crypto
debugging
dma dma-mapping updates for Linux 6.19: 2025-12-06 09:25:05 -08:00
docs docs: makefile: move rustdoc check to the build wrapper 2025-11-29 08:42:53 -07:00
firewire
firmware
gpio
hv
iio
include tools: Fix bitfield dependency failure 2026-01-28 15:18:44 -03:00
kvm/kvm_stat
laptop
leds
lib libperf build: Always place libperf includes first 2026-02-03 18:01:27 -03:00
memory-model
mm tools/mm/page_owner_sort: fix timestamp comparison for stable sorting 2025-12-23 11:23:14 -08:00
net tools/net/ynl: Makefile's install target now installs ynltool 2026-01-20 17:10:50 -08:00
objtool objtool: Fix libopcodes linking with static libraries 2026-01-21 20:25:14 +01:00
pcmcia
perf tools build: Fix rust feature detection 2026-02-09 11:10:56 -03:00
power platform-drivers-x86 for v6.19-1 2025-12-10 06:38:17 +09:00
rcu
sched
sched_ext tools/sched_ext: update scx_show_state.py for scx_aborting change 2025-12-28 06:11:26 -10:00
scripts perf test workload: Add code_with_type test workload 2026-02-08 19:16:24 -03:00
sound
spi
testing s390 fixes for 6.19-rc7 2026-01-23 14:00:58 -08:00
thermal tools/thermal/thermal-engine: Fix format string bug in thermal-engine 2025-11-25 11:00:28 +01:00
time
tracing rtla updaets for v6.19: 2025-12-05 09:34:01 -08:00
usb
verification
virtio tools/virtio: add device, device_driver stubs 2025-12-24 08:02:56 -05:00
wmi
workqueue
writeback
Makefile tools/dma: move dma_map_benchmark from selftests to tools/dma 2025-10-29 09:41:40 +01:00