From 95dd7499f32742011523ec763be53eefa221f883 Mon Sep 17 00:00:00 2001 From: Dylan Baker Date: Wed, 26 Feb 2025 09:23:12 -0800 Subject: modules/rust: Update bindgen target error checking for bindgen >= 0.71 Which has both changed the error message and relaxed the check. In theory we wouldn't hit this unless you have a very old bindgen and a very new rustc. --- mesonbuild/modules/rust.py | 10 ++++++---- 1 file changed, 6 insertions(+), 4 deletions(-) (limited to 'mesonbuild/modules/rust.py') diff --git a/mesonbuild/modules/rust.py b/mesonbuild/modules/rust.py index 3638964f2..34a3f68d8 100644 --- a/mesonbuild/modules/rust.py +++ b/mesonbuild/modules/rust.py @@ -1,5 +1,5 @@ # SPDX-License-Identifier: Apache-2.0 -# Copyright © 2020-2024 Intel Corporation +# Copyright © 2020-2025 Intel Corporation from __future__ import annotations import itertools @@ -259,9 +259,11 @@ class RustModule(ExtensionModule): _, _, err = mesonlib.Popen_safe( T.cast('T.List[str]', self._bindgen_bin.get_command()) + ['--rust-target', self._bindgen_rust_target]) - # Sometimes this is "invalid Rust target" and sometimes "invalid - # rust target" - if 'Got an invalid' in err: + # < 0.71: Sometimes this is "invalid Rust target" and + # sometimes "invalid # rust target" + # >= 0.71: error: invalid value '...' for '--rust-target ': "..." is not a valid Rust target, accepted values are of the form ... + # It's also much harder to hit this in 0.71 than in previous versions + if 'Got an invalid' in err or 'is not a valid Rust target' in err: self._bindgen_rust_target = None name: str -- cgit v1.2.3