From nobody Wed Apr 1 22:11:51 2026 Received: from smtp.kernel.org (aws-us-west-2-korg-mail-1.web.codeaurora.org [10.30.226.201]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by smtp.subspace.kernel.org (Postfix) with ESMTPS id AE2523E6DEB; Wed, 1 Apr 2026 11:49:12 +0000 (UTC) Authentication-Results: smtp.subspace.kernel.org; arc=none smtp.client-ip=10.30.226.201 ARC-Seal: i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1775044152; cv=none; b=mbHYpQ2mSfpC2VF7CEVEEP0NO5ctL+yfDNPeyjfSeYIab23wHOqubP+YJvUj66m3MzQlwpT18zMyw9xlPAvvPvKAXcn2vCN5ABpOZZ0ZQfILEM5ILViI0vqdpm5SKyIE2DJikwH1X22k+/p4NwQ+7FJznm9888M6cWc2tgaoQeg= ARC-Message-Signature: i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1775044152; c=relaxed/simple; bh=AX5z3xpzFua6mAQIK+U/8xMTb4ZIuLJsG4n5Y91N4RI=; h=From:To:Cc:Subject:Date:Message-ID:In-Reply-To:References: MIME-Version; b=fs4JGhsJp/841STBDmnK51RUOrhRVrfHlE7t0ZWkAMrYWrR0MKTcetSQu45UImh9OhEu0Dzpwsl/vAwCeNCEmJ2miV8yvR++p4rXn2WlZ7txzOXET8h3/IsqNoCml5MraZhqX0HasI7F4jZHw32HV2hxBhCww+mTnX6IIpbLJRE= ARC-Authentication-Results: i=1; smtp.subspace.kernel.org; dkim=pass (2048-bit key) header.d=kernel.org header.i=@kernel.org header.b=DVz4TB/V; arc=none smtp.client-ip=10.30.226.201 Authentication-Results: smtp.subspace.kernel.org; dkim=pass (2048-bit key) header.d=kernel.org header.i=@kernel.org header.b="DVz4TB/V" Received: by smtp.kernel.org (Postfix) with ESMTPSA id 0F511C4CEF7; Wed, 1 Apr 2026 11:49:00 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=kernel.org; s=k20201202; t=1775044152; bh=AX5z3xpzFua6mAQIK+U/8xMTb4ZIuLJsG4n5Y91N4RI=; h=From:To:Cc:Subject:Date:In-Reply-To:References:From; b=DVz4TB/VU+zyZ2i/W6mzrSFi2feuGR6qmqoAvmg2H+aTnIrx+rI9QbMhxIGO0Fy4d XEUrIjhZb1p4mHwos1ynOfsPYSKde1p0FX+M1Sy2SPqq2wYJ6sjVhPoccfaZVduWbn wrrNGXFWfNEkrtdQ/i2hpujBUGZziz/KixuYY2LjLo97z5Dk4nuqnde2AEIcecPZq7 GaKGi955ChQdu/AiuzZxLwHqBt1S71Q7OAJpI2N3lXFXqySy73PaDukQke2WGFgjjS PONEdcAu9t8e6olmo0f30HBhqmyw+l+pebpQt/3V8sgHdUpeCZ8WS4h4OvaSsKvE0l 4LcqeuoQH8epQ== From: Miguel Ojeda To: Miguel Ojeda , Nathan Chancellor , Nicolas Schier , Danilo Krummrich , Andreas Hindborg , Catalin Marinas , Will Deacon , Paul Walmsley , Palmer Dabbelt , Albert Ou , Alexandre Courbot , David Airlie , Simona Vetter , Brendan Higgins , David Gow , Greg Kroah-Hartman , =?UTF-8?q?Arve=20Hj=C3=B8nnev=C3=A5g?= , Todd Kjos , Christian Brauner , Carlos Llamas , Alice Ryhl , Jonathan Corbet Cc: Boqun Feng , Gary Guo , =?UTF-8?q?Bj=C3=B6rn=20Roy=20Baron?= , Benno Lossin , Trevor Gross , rust-for-linux@vger.kernel.org, linux-kbuild@vger.kernel.org, Lorenzo Stoakes , Vlastimil Babka , "Liam R . Howlett" , Uladzislau Rezki , linux-block@vger.kernel.org, linux-arm-kernel@lists.infradead.org (moderated for non-subscribers), Alexandre Ghiti , linux-riscv@lists.infradead.org, nouveau@lists.freedesktop.org, dri-devel@lists.freedesktop.org, Rae Moar , linux-kselftest@vger.kernel.org, kunit-dev@googlegroups.com, Nick Desaulniers , Bill Wendling , Justin Stitt , llvm@lists.linux.dev, linux-kernel@vger.kernel.org, Shuah Khan , linux-doc@vger.kernel.org Subject: [PATCH 16/33] rust: rust_is_available: remove warning for < 0.69.5 && libclang >= 19.1 Date: Wed, 1 Apr 2026 13:45:23 +0200 Message-ID: <20260401114540.30108-17-ojeda@kernel.org> In-Reply-To: <20260401114540.30108-1-ojeda@kernel.org> References: <20260401114540.30108-1-ojeda@kernel.org> 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" It is not possible anymore to fall into the issue that this warning was alerting about given the `bindgen` version bump. Thus simplify by removing the machinery behind it, including tests. Signed-off-by: Miguel Ojeda --- scripts/rust_is_available.sh | 15 -------- ...ust_is_available_bindgen_libclang_concat.h | 3 -- scripts/rust_is_available_test.py | 34 +------------------ 3 files changed, 1 insertion(+), 51 deletions(-) delete mode 100644 scripts/rust_is_available_bindgen_libclang_concat.h diff --git a/scripts/rust_is_available.sh b/scripts/rust_is_available.sh index 77896e31dab5..cefc456c2503 100755 --- a/scripts/rust_is_available.sh +++ b/scripts/rust_is_available.sh @@ -214,21 +214,6 @@ if [ "$bindgen_libclang_cversion" -lt "$bindgen_libcla= ng_min_cversion" ]; then exit 1 fi =20 -if [ "$bindgen_libclang_cversion" -ge 1900100 ] && - [ "$rust_bindings_generator_cversion" -lt 6905 ]; then - # Distributions may have patched the issue (e.g. Debian did). - if ! "$BINDGEN" $(dirname $0)/rust_is_available_bindgen_libclang_concat.h= | grep -q foofoo; then - echo >&2 "***" - echo >&2 "*** Rust bindings generator '$BINDGEN' < 0.69.5 together with = libclang >=3D 19.1" - echo >&2 "*** may not work due to a bug (https://github.com/rust-lang/ru= st-bindgen/pull/2824)," - echo >&2 "*** unless patched (like Debian's)." - echo >&2 "*** Your bindgen version: $rust_bindings_generator_version" - echo >&2 "*** Your libclang version: $bindgen_libclang_version" - echo >&2 "***" - warning=3D1 - fi -fi - # If the C compiler is Clang, then we can also check whether its version # matches the `libclang` version used by the Rust bindings generator. # diff --git a/scripts/rust_is_available_bindgen_libclang_concat.h b/scripts/= rust_is_available_bindgen_libclang_concat.h deleted file mode 100644 index efc6e98d0f1d..000000000000 --- a/scripts/rust_is_available_bindgen_libclang_concat.h +++ /dev/null @@ -1,3 +0,0 @@ -/* SPDX-License-Identifier: GPL-2.0 */ -#define F(x) int x##x -F(foo); diff --git a/scripts/rust_is_available_test.py b/scripts/rust_is_available_= test.py index b66fa5933844..d6d54b7ea42a 100755 --- a/scripts/rust_is_available_test.py +++ b/scripts/rust_is_available_test.py @@ -54,23 +54,16 @@ else: """) =20 @classmethod - def generate_bindgen(cls, version_stdout, libclang_stderr, libclang_co= ncat_patched=3DFalse): + def generate_bindgen(cls, version_stdout, libclang_stderr): if libclang_stderr is None: libclang_case =3D f"raise SystemExit({cls.bindgen_default_bind= gen_libclang_failure_exit_code})" else: libclang_case =3D f"print({repr(libclang_stderr)}, file=3Dsys.= stderr)" =20 - if libclang_concat_patched: - libclang_concat_case =3D "print('pub static mut foofoo: ::std:= :os::raw::c_int;')" - else: - libclang_concat_case =3D "pass" - return cls.generate_executable(f"""#!/usr/bin/env python3 import sys if "rust_is_available_bindgen_libclang.h" in " ".join(sys.argv): {libclang_case} -elif "rust_is_available_bindgen_libclang_concat.h" in " ".join(sys.argv): - {libclang_concat_case} else: print({repr(version_stdout)}) """) @@ -255,31 +248,6 @@ else: result =3D self.run_script(self.Expected.FAILURE, { "BINDGEN": bin= dgen }) self.assertIn(f"libclang (used by the Rust bindings generator '{bi= ndgen}') is too old.", result.stderr) =20 - def test_bindgen_bad_libclang_concat(self): - for (bindgen_version, libclang_version, expected_not_patched) in ( - ("0.69.4", "18.0.0", self.Expected.SUCCESS), - ("0.69.4", "19.1.0", self.Expected.SUCCESS_WITH_WARNINGS), - ("0.69.4", "19.2.0", self.Expected.SUCCESS_WITH_WARNINGS), - - ("0.69.5", "18.0.0", self.Expected.SUCCESS), - ("0.69.5", "19.1.0", self.Expected.SUCCESS), - ("0.69.5", "19.2.0", self.Expected.SUCCESS), - - ("0.70.0", "18.0.0", self.Expected.SUCCESS), - ("0.70.0", "19.1.0", self.Expected.SUCCESS), - ("0.70.0", "19.2.0", self.Expected.SUCCESS), - ): - with self.subTest(bindgen_version=3Dbindgen_version, libclang_= version=3Dlibclang_version): - cc =3D self.generate_clang(f"clang version {libclang_versi= on}") - libclang_stderr =3D f"scripts/rust_is_available_bindgen_li= bclang.h:2:9: warning: clang version {libclang_version} [-W#pragma-messages= ], err: false" - bindgen =3D self.generate_bindgen(f"bindgen {bindgen_versi= on}", libclang_stderr) - result =3D self.run_script(expected_not_patched, { "BINDGE= N": bindgen, "CC": cc }) - if expected_not_patched =3D=3D self.Expected.SUCCESS_WITH_= WARNINGS: - self.assertIn(f"Rust bindings generator '{bindgen}' < = 0.69.5 together with libclang >=3D 19.1", result.stderr) - - bindgen =3D self.generate_bindgen(f"bindgen {bindgen_versi= on}", libclang_stderr, libclang_concat_patched=3DTrue) - result =3D self.run_script(self.Expected.SUCCESS, { "BINDG= EN": bindgen, "CC": cc }) - def test_clang_matches_bindgen_libclang_different_bindgen(self): bindgen =3D self.generate_bindgen_libclang("scripts/rust_is_availa= ble_bindgen_libclang.h:2:9: warning: clang version 999.0.0 [-W#pragma-messa= ges], err: false") result =3D self.run_script(self.Expected.SUCCESS_WITH_WARNINGS, { = "BINDGEN": bindgen }) --=20 2.53.0