Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

dependencies: Improve error message when variable is not found #13904

Open
wants to merge 1 commit into
base: master
Choose a base branch
from
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
2 changes: 1 addition & 1 deletion mesonbuild/dependencies/base.py
Original file line number Diff line number Diff line change
Expand Up @@ -347,7 +347,7 @@ def get_variable(self, *, cmake: T.Optional[str] = None, pkgconfig: T.Optional[s
val = self.variables.get(internal, default_value)
if val is not None:
return val
raise DependencyException(f'Could not get an internal variable and no default provided for {self!r}')
raise DependencyException(f'Could not get an internal variable {internal} and no default provided')

def generate_link_whole_dependency(self) -> Dependency:
from ..build import SharedLibrary, CustomTarget, CustomTargetIndex
Expand Down
2 changes: 1 addition & 1 deletion mesonbuild/dependencies/cmake.py
Original file line number Diff line number Diff line change
Expand Up @@ -637,7 +637,7 @@ def get_variable(self, *, cmake: T.Optional[str] = None, pkgconfig: T.Optional[s
return ';'.join(v)
if default_value is not None:
return default_value
raise DependencyException(f'Could not get cmake variable and no default provided for {self!r}')
raise DependencyException(f'Could not get {self.name} cmake variable {cmake} and no default provided')


class CMakeDependencyFactory:
Expand Down
2 changes: 1 addition & 1 deletion mesonbuild/dependencies/configtool.py
Original file line number Diff line number Diff line change
Expand Up @@ -170,4 +170,4 @@ def get_variable(self, *, cmake: T.Optional[str] = None, pkgconfig: T.Optional[s
return variable
if default_value is not None:
return default_value
raise DependencyException(f'Could not get config-tool variable and no default provided for {self!r}')
raise DependencyException(f'Could not get {self.name} variable {configtool} using {self.tool_name} and no default provided')
2 changes: 1 addition & 1 deletion mesonbuild/dependencies/pkgconfig.py
Original file line number Diff line number Diff line change
Expand Up @@ -586,4 +586,4 @@ def get_variable(self, *, cmake: T.Optional[str] = None, pkgconfig: T.Optional[s
pass
if default_value is not None:
return default_value
raise DependencyException(f'Could not get pkg-config variable and no default provided for {self!r}')
raise DependencyException(f'Could not get {self.name} pkg-config variable {pkgconfig} and no default provided')
Loading