diff options
| author | Dylan Baker <dylan@pnwbakers.com> | 2025-02-26 09:23:12 -0800 |
|---|---|---|
| committer | Eli Schwartz <eschwartz93@gmail.com> | 2025-02-27 15:27:42 -0500 |
| commit | 95dd7499f32742011523ec763be53eefa221f883 (patch) | |
| tree | dd341dbe7fcdd25905f078e103ca463475794faa /mesonbuild | |
| parent | de7d8f9e48b7801659c15f03489d1b5a2fbe7d50 (diff) | |
| download | meson-95dd7499f32742011523ec763be53eefa221f883.tar.gz | |
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.
Diffstat (limited to 'mesonbuild')
| -rw-r--r-- | mesonbuild/modules/rust.py | 10 |
1 files changed, 6 insertions, 4 deletions
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 <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 |
