From nobody Sat Apr 18 03:24:57 2026 Received: from mail-ed1-f44.google.com (mail-ed1-f44.google.com [209.85.208.44]) (using TLSv1.2 with cipher ECDHE-RSA-AES128-GCM-SHA256 (128/128 bits)) (No client certificate requested) by smtp.subspace.kernel.org (Postfix) with ESMTPS id A8D923559D5 for ; Wed, 11 Feb 2026 09:58:21 +0000 (UTC) Authentication-Results: smtp.subspace.kernel.org; arc=none smtp.client-ip=209.85.208.44 ARC-Seal: i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1770803903; cv=none; b=MMmKv+U+KOQrT+2e69F2FuCRXxy645+0LQBFQGChxk5lPQoHPxuQ6ePBAID66xzmF3moB7YKTVumttKaTL+J/tVXxc0PMBDpj1wW/xY2mqALOHTKLcGVpYkrwPIKP7Dpp7lQ1g+LHn8CoTnAFJzBYRf0VH805MZvgq7zg8P3YSg= ARC-Message-Signature: i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1770803903; c=relaxed/simple; bh=/jY88c8DfenVP33BGf4ZmBKcEhRGxzA1gRHO1efpgkQ=; h=From:To:Cc:Subject:Date:Message-ID:MIME-Version; b=hErX9Tv99J80ukoedmEZQpzgZomtODa9vdNKlrsj0zCuK6FqQelnYb5qvoREYCx8VZEVL/+lqJXa9bG0YIw/q0O1O1GpwaSw729UzTPjwUzr3McoNDIcNq+aJShm9Q2FBMSQs80BK+Zj9S0dEsOGwxazJAJRKZardlJ44PQ7Jd0= ARC-Authentication-Results: i=1; smtp.subspace.kernel.org; dmarc=pass (p=none dis=none) header.from=gmail.com; spf=pass smtp.mailfrom=gmail.com; dkim=pass (2048-bit key) header.d=gmail.com header.i=@gmail.com header.b=AL4ytrNB; arc=none smtp.client-ip=209.85.208.44 Authentication-Results: smtp.subspace.kernel.org; dmarc=pass (p=none dis=none) header.from=gmail.com Authentication-Results: smtp.subspace.kernel.org; spf=pass smtp.mailfrom=gmail.com Authentication-Results: smtp.subspace.kernel.org; dkim=pass (2048-bit key) header.d=gmail.com header.i=@gmail.com header.b="AL4ytrNB" Received: by mail-ed1-f44.google.com with SMTP id 4fb4d7f45d1cf-65a196a735eso2624601a12.2 for ; Wed, 11 Feb 2026 01:58:21 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20230601; t=1770803900; x=1771408700; darn=vger.kernel.org; h=content-transfer-encoding:mime-version:message-id:date:subject:cc :to:from:from:to:cc:subject:date:message-id:reply-to; bh=oDkN2CtNrqc+uj+094uU1VeIMVKx6CU8wHpEzkmJ2Gw=; b=AL4ytrNBdKG8sJcHehKTN2i/94sW7Gy4AnSaTjRdUSU2qhB+lg+ArscKO42LTzdNJo pV7y7yj10l+WrPwzZiqtz0wj0dBFYsc0PXX17gHLIZ/twDCoFNHc8FdIMevRdICTapf2 UM6WN5wxbjdBfB9MDuBU+DPC2u7rt6pw/81bWRv2hEngZjxkxmwxyu1ZQyKA4ZbGSuu/ Nx0h8LD9xRG/8NscdigtgaO7kqkrGypGp9oe5dkxlhq2SyaKdQhnZ07vhDWd3JJQZh2W lJ6tCBf+LTbjjMotEJ+63aL+POLEJHfhVjYMDiB6Yla9F3LLxQxyeWp5GIKh7aa04q50 6s8A== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20230601; t=1770803900; x=1771408700; h=content-transfer-encoding:mime-version:message-id:date:subject:cc :to:from:x-gm-gg:x-gm-message-state:from:to:cc:subject:date :message-id:reply-to; bh=oDkN2CtNrqc+uj+094uU1VeIMVKx6CU8wHpEzkmJ2Gw=; b=P0rPKtpMZkn86EKhomePsh9tNNcvmNApozPp6ZpDhJ4n+Z/8nhjj3xx8XDWpii9OWn BJVuq/KXuzoWGRUzG+O/sl9kpN5gDoEhiIvsqjpfZjglAyJwfwP7/peBbQJzHh4coWby jfpSwlaMBTipdfA3q/cgAXkQmgnO0Wu+Ci+lEmog7Du4kFFj1AwwfOuILvrzfc9m1JXE expzZyu8ov/uhOczBuhir0Omy2hsehcFEmBpuv6Az4VlueRu9NN3kcBw/f1+h+8di5fT sYUGxaLIhgl9rw5FtOgH/+aWvDyqpcMSn0KVnCeG6LRqa3iigc6WunfwbgtEWetHTKN9 tsXA== X-Forwarded-Encrypted: i=1; AJvYcCVgvqfHnVxwrOyZs7XEuDLbOoFkiMRw+MC9KN56KRMBLtAT7flaxP6EEWCqFPKYoUaPUVExjBZWUqLcSVI=@vger.kernel.org X-Gm-Message-State: AOJu0YwVPnNaQ6SkaUspcBTWJJpILik3UZWDN8aQNki2VLjiYph6Wvzb imeBQismWmihjIChBPKjHMIwgPVrUvzO9t1QKK+ExCgB2c/sfTDmOf+6 X-Gm-Gg: AZuq6aIzABnDe8EMCuslAemkAw075C2TcDxlL0YxFR7d60ZeWdGBysEgmulKSCHw/ZR 25H+jP2QH7XQZS9baB4JJyVf65tAAn6mYo1xzbDdwI1TaT+LdSiD4DHgpU8x8RthZPYKFbj2Xa/ 2BMIyhlMdfjrCU/t81ICk7Ir6JNRMpOBkoDNmHA2h+dgENP8XpaUvXmp8SRob0dRius6fN35JbI 1zmd74FDvWp8AOf4plHKLVWCYksXwlKAFUVgOTP58lXskfvb6U/aUiLGWJ+niCnzSMK+/lNCsOa bzktHWAE8GqPlu1TFls/EacAHRs0jl3+asI2y6NKc9n8fizdGz/zBFSVi72IQI/62q3y22mkcWA tde+S+QDUNst439duLIia0JztsEUaupRZYQTYshVjG6O8dcBjUBUh8tllJrg3RYIWeuXCQe1+N4 PS6Xblip+9R2JrU6GkgLx9S/1lMOTateMzCiuAmUeBg7N1n7A0eE+7F6tL1hhP6GEl8iV2jS2GO IS/pr/MuhHIEygiXNJ03Mvll8i6ONE= X-Received: by 2002:a17:907:1c1a:b0:b8d:cbb5:c068 with SMTP id a640c23a62f3a-b8f6aed4feemr144170966b.58.1770803899007; Wed, 11 Feb 2026 01:58:19 -0800 (PST) Received: from ddolgov-thinkpadt14sgen1.local (dslb-002-207-075-089.002.207.pools.vodafone-ip.de. [2.207.75.89]) by smtp.gmail.com with ESMTPSA id a640c23a62f3a-b8f6e9e98ecsm43829466b.30.2026.02.11.01.58.17 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Wed, 11 Feb 2026 01:58:18 -0800 (PST) From: Dmitrii Dolgov <9erthalion6@gmail.com> To: linux-perf-users@vger.kernel.org, Arnaldo Carvalho de Melo Cc: Namhyung Kim , Ian Rogers , Miguel Ojeda , Linux Kernel Mailing List , Dmitrii Dolgov <9erthalion6@gmail.com> Subject: [PATCH v1] tools build: Fix feature test for rust compiler Date: Wed, 11 Feb 2026 10:58:01 +0100 Message-ID: <20260211095807.132855-1-9erthalion6@gmail.com> X-Mailer: git-send-email 2.52.0 Precedence: bulk X-Mailing-List: linux-kernel@vger.kernel.org List-Id: List-Subscribe: List-Unsubscribe: MIME-Version: 1.0 Content-Transfer-Encoding: quoted-printable Content-Type: text/plain; charset="utf-8" Currently a dummy rust code is compiled to detect if the rust feature could be enabled. It turns out that in this case rust emits a dependency file without any external references: /perf/feature/test-rust.d: test-rust.rs /perf/feature/test-rust.bin: test-rust.rs test-rust.rs: This can lead to a situation, when rustc was removed after a successful bui= ld, but the build process still thinks it's there and the feature is enabled on subsequent runs. Instead simply check the compiler presence to detect the feature, as suggested by Arnaldo Carvalho de Melo. This way no actual test-rust.bin will be created, meaning the feature check will not be cached and always performed. That's exactly what we want, and the overhead of doing this every time is minimal. Tested with multiple rounds of install/remove of the rust package. Signed-off-by: Dmitrii Dolgov <9erthalion6@gmail.com> --- tools/build/feature/Makefile | 10 ++++++---- tools/build/feature/test-rust.rs | 4 ---- 2 files changed, 6 insertions(+), 8 deletions(-) delete mode 100644 tools/build/feature/test-rust.rs diff --git a/tools/build/feature/Makefile b/tools/build/feature/Makefile index e959caa7f1c..698e89da015 100644 --- a/tools/build/feature/Makefile +++ b/tools/build/feature/Makefile @@ -113,9 +113,6 @@ __BUILD =3D $(CC) $(CFLAGS) -MD -Wall -Werror -o $@ $(p= atsubst %.bin,%.c,$(@F)) $( __BUILDXX =3D $(CXX) $(CXXFLAGS) -MD -Wall -Werror -o $@ $(patsubst %.bin,= %.cpp,$(@F)) $(LDFLAGS) BUILDXX =3D $(__BUILDXX) > $(@:.bin=3D.make.output) 2>&1 =20 -__BUILDRS =3D $(RUSTC) $(RUSTC_FLAGS) --emit=3Ddep-info=3D$(patsubst %.bin= ,%.d,$(@F)),link -o $@ $(patsubst %.bin,%.rs,$(@F)) - BUILDRS =3D $(__BUILDRS) > $(@:.bin=3D.make.output) 2>&1 - ############################### =20 $(OUTPUT)test-all.bin: @@ -393,8 +390,13 @@ $(OUTPUT)test-bpftool-skeletons.bin: $(SYSTEM_BPFTOOL) version | grep '^features:.*skeletons' \ > $(@:.bin=3D.make.output) 2>&1 =20 +# Testing Rust is special: we don't compile anything, it's enough to check= the +# compiler presence. Compiling a test code for this purposes is problemati= c, +# because Rust will emit a depedency file without any external references, +# meaning that if rustc will be removed the build process will still think= it's +# there. $(OUTPUT)test-rust.bin: - $(BUILDRS) > $(@:.bin=3D.make.output) 2>&1 + $(RUSTC) --version > /dev/null 2>&1 =20 ############################### =20 diff --git a/tools/build/feature/test-rust.rs b/tools/build/feature/test-ru= st.rs deleted file mode 100644 index f2fc91cc4f6..00000000000 --- a/tools/build/feature/test-rust.rs +++ /dev/null @@ -1,4 +0,0 @@ -// SPDX-License-Identifier: GPL-2.0 -fn main() { - println!("hi") -} base-commit: 5d1ab659fb93eed85d6d8b2937013360157032f4 --=20 2.52.0