Skip to content

Commit 3f5dfa4

Browse files
committed
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: 6a32fa5 ("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>
1 parent 3350471 commit 3f5dfa4

2 files changed

Lines changed: 2 additions & 2 deletions

File tree

tools/build/Makefile.feature

Lines changed: 1 addition & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -100,8 +100,7 @@ FEATURE_TESTS_BASIC := \
100100
disassembler-four-args \
101101
disassembler-init-styled \
102102
file-handle \
103-
libopenssl \
104-
rust
103+
libopenssl
105104

106105
# FEATURE_TESTS_BASIC + FEATURE_TESTS_EXTRA is the complete list
107106
# of all feature tests

tools/perf/Makefile.config

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1154,6 +1154,7 @@ ifneq ($(NO_LIBTRACEEVENT),1)
11541154
endif
11551155

11561156
ifndef NO_RUST
1157+
$(call feature_check,rust)
11571158
ifneq ($(feature-rust), 1)
11581159
$(warning Rust is not found. Test workloads with rust are disabled.)
11591160
NO_RUST := 1

0 commit comments

Comments
 (0)