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.
pull/13147/head
Eli Schwartz 9 months ago
parent 80b9b125f4
commit a2ac3bc453
No known key found for this signature in database
GPG Key ID: CEB167EFB5722BD6
  1. 4
      docs/markdown/snippets/find_library_name.md
  2. 2
      mesonbuild/interpreter/interpreterobjects.py

@ -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.

@ -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:

Loading…
Cancel
Save