diff options
author | Xavier Claessens <xavier.claessens@collabora.com> | 2023-06-12 20:46:33 -0400 |
---|---|---|
committer | Xavier Claessens <xavier.claessens@collabora.com> | 2024-02-26 10:03:51 -0500 |
commit | d075bdb3ca39a077994fa65e7fafb98cdebf5da6 (patch) | |
tree | a33472dd356036ef1e06d75e68c5bc8377aff2ad | |
parent | 8ca59775723930f0646a475c446275809334763e (diff) | |
download | meson-d075bdb3ca39a077994fa65e7fafb98cdebf5da6.zip meson-d075bdb3ca39a077994fa65e7fafb98cdebf5da6.tar.gz meson-d075bdb3ca39a077994fa65e7fafb98cdebf5da6.tar.bz2 |
cargo: Use coredata.stable_version
This avoids generated code print warnings when using features introduced
in current dev cycle.
-rw-r--r-- | mesonbuild/cargo/interpreter.py | 7 |
1 files changed, 3 insertions, 4 deletions
diff --git a/mesonbuild/cargo/interpreter.py b/mesonbuild/cargo/interpreter.py index 66e45ac..c5791ae 100644 --- a/mesonbuild/cargo/interpreter.py +++ b/mesonbuild/cargo/interpreter.py @@ -348,12 +348,11 @@ def _dependency_varname(package_name: str) -> str: return f'{fixup_meson_varname(package_name)}_dep' -def _create_project(cargo: Manifest, build: builder.Builder, env: Environment) -> T.List[mparser.BaseNode]: +def _create_project(cargo: Manifest, build: builder.Builder) -> T.List[mparser.BaseNode]: """Create a function call :param cargo: The Manifest to generate from :param build: The AST builder - :param env: Meson environment :return: a list nodes """ args: T.List[mparser.BaseNode] = [] @@ -366,7 +365,7 @@ def _create_project(cargo: Manifest, build: builder.Builder, env: Environment) - # Always assume that the generated meson is using the latest features # This will warn when when we generate deprecated code, which is helpful # for the upkeep of the module - 'meson_version': build.string(f'>= {env.coredata.version}'), + 'meson_version': build.string(f'>= {coredata.stable_version}'), 'default_options': build.array([build.string(f'rust_std={cargo.package.edition}')]), } if cargo.package.license: @@ -462,7 +461,7 @@ def interpret(subp_name: str, subdir: str, env: Environment) -> mparser.CodeBloc filename = os.path.join(cargo.subdir, cargo.path, 'Cargo.toml') build = builder.Builder(filename) - ast = _create_project(cargo, build, env) + ast = _create_project(cargo, build) ast += [build.assign(build.function('import', [build.string('rust')]), 'rust')] ast += _create_dependencies(cargo, build) |