summaryrefslogtreecommitdiff
path: root/mesonbuild/modules
diff options
context:
space:
mode:
authorDylan Baker <dylan@pnwbakers.com>2025-02-26 09:39:24 -0800
committerEli Schwartz <eschwartz93@gmail.com>2025-02-27 15:27:42 -0500
commit8ebc8c1878852f914172b99135d2960429402204 (patch)
treec0794bca2ba00cf5d78b902eebe6f60460bf55c8 /mesonbuild/modules
parent5d648a112fe8ee3bfb637d9db133c05ef3b184b8 (diff)
downloadmeson-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.
Diffstat (limited to 'mesonbuild/modules')
-rw-r--r--mesonbuild/modules/rust.py5
1 files changed, 4 insertions, 1 deletions
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