From a2ac3bc453c22c89ed7343f16b2848f81b73cb85 Mon Sep 17 00:00:00 2001 From: Eli Schwartz Date: Thu, 25 Apr 2024 16:19:40 -0400 Subject: [PATCH] find_library: improve the docs and FeatureNew to fully describe the change The docs didn't really explain what the issue was with using it. And it's not actually a "crash" either way. The FeatureNew mentions that "name" is new, but it is standard for these warnings to tell you both the type of object you're operating on and the name of the method that is an issue. This omitted the former, and was very confusing. --- docs/markdown/snippets/find_library_name.md | 4 +++- mesonbuild/interpreter/interpreterobjects.py | 2 +- 2 files changed, 4 insertions(+), 2 deletions(-) diff --git a/docs/markdown/snippets/find_library_name.md b/docs/markdown/snippets/find_library_name.md index ffb18eb85..2ee60b106 100644 --- a/docs/markdown/snippets/find_library_name.md +++ b/docs/markdown/snippets/find_library_name.md @@ -1,3 +1,5 @@ ## dependencies created by compiler.find_library implement the `name()` method -Which would previously result in Meson crashing. +Previously, for a [[dep]] that might be returned by either [[dependency]] or +[[compiler.find_library]], the method might or might not exist with no way +of telling. diff --git a/mesonbuild/interpreter/interpreterobjects.py b/mesonbuild/interpreter/interpreterobjects.py index 0360e4450..8cd9a2be6 100644 --- a/mesonbuild/interpreter/interpreterobjects.py +++ b/mesonbuild/interpreter/interpreterobjects.py @@ -664,7 +664,7 @@ class ExternalLibraryHolder(ObjectHolder[ExternalLibrary]): pdep = self.held_object.get_partial_dependency(**kwargs) return pdep - @FeatureNew('name', '1.5.0') + @FeatureNew('dependency.name', '1.5.0') @noPosargs @noKwargs def name_method(self, args: T.List[TYPE_var], kwargs: TYPE_kwargs) -> str: