diff options
| author | Dylan Baker <dylan@pnwbakers.com> | 2025-02-26 09:39:24 -0800 |
|---|---|---|
| committer | Eli Schwartz <eschwartz93@gmail.com> | 2025-02-27 15:27:42 -0500 |
| commit | 8ebc8c1878852f914172b99135d2960429402204 (patch) | |
| tree | c0794bca2ba00cf5d78b902eebe6f60460bf55c8 | |
| parent | 5d648a112fe8ee3bfb637d9db133c05ef3b184b8 (diff) | |
| download | meson-8ebc8c1878852f914172b99135d2960429402204.tar.gz | |
modules/rust: use 'nightly' as the bindgen version if the compiler is nightly
This adds tracking for both nightly and beta to the rust compiler.
| -rw-r--r-- | mesonbuild/compilers/rust.py | 2 | ||||
| -rw-r--r-- | mesonbuild/modules/rust.py | 5 |
2 files changed, 6 insertions, 1 deletions
diff --git a/mesonbuild/compilers/rust.py b/mesonbuild/compilers/rust.py index 3acc30e54..475b7a402 100644 --- a/mesonbuild/compilers/rust.py +++ b/mesonbuild/compilers/rust.py @@ -100,6 +100,8 @@ class RustCompiler(Compiler): if 'link' in self.linker.id: self.base_options.add(OptionKey('b_vscrt')) self.native_static_libs: T.List[str] = [] + self.is_beta = '-beta' in full_version + self.is_nightly = '-nightly' in full_version def needs_static_linker(self) -> bool: return False diff --git a/mesonbuild/modules/rust.py b/mesonbuild/modules/rust.py index 0891243eb..c455ea227 100644 --- a/mesonbuild/modules/rust.py +++ b/mesonbuild/modules/rust.py @@ -24,6 +24,7 @@ from ..programs import ExternalProgram if T.TYPE_CHECKING: from . import ModuleState from ..build import IncludeDirs, LibTypes + from ..compilers.rust import RustCompiler from ..dependencies import Dependency, ExternalLibrary from ..interpreter import Interpreter from ..interpreter import kwargs as _kwargs @@ -58,12 +59,14 @@ class RustModule(ExtensionModule): """A module that holds helper functions for rust.""" INFO = ModuleInfo('rust', '0.57.0', stabilized='1.0.0') + _bindgen_rust_target: T.Optional[str] def __init__(self, interpreter: Interpreter) -> None: super().__init__(interpreter) self._bindgen_bin: T.Optional[T.Union[ExternalProgram, Executable, OverrideProgram]] = None if 'rust' in interpreter.compilers.host: - self._bindgen_rust_target: T.Optional[str] = interpreter.compilers.host['rust'].version + rustc = T.cast('RustCompiler', interpreter.compilers.host['rust']) + self._bindgen_rust_target = 'nightly' if rustc.is_nightly else rustc.version else: self._bindgen_rust_target = None self._bindgen_set_std = False |
