Skip to content

Commit

Permalink
find_tool: don't assume the pkgconfig variable is a valid command
Browse files Browse the repository at this point in the history
ExternalProgram currently assumes that if a command is passed it exists
and can be used as is. In case we extract the path from pkgconfig the
path might not exist, on Windows it might be missing the ".exe" suffix.

By passing the variables as a name ExternalProgram will validate that
the command exists at configure time and will fail if not, and it will
try to fixup the command by appending .exe etc.

Fixes #12271
  • Loading branch information
lazka authored and xclaesse committed Sep 30, 2023
1 parent 184927e commit d7b2566
Showing 1 changed file with 1 addition and 1 deletion.
2 changes: 1 addition & 1 deletion mesonbuild/modules/__init__.py
Original file line number Diff line number Diff line change
Expand Up @@ -112,7 +112,7 @@ def find_tool(self, name: str, depname: str, varname: str, required: bool = True
if dep.found() and dep.type_name == 'pkgconfig':
value = dep.get_variable(pkgconfig=varname)
if value:
return ExternalProgram(name, [value])
return ExternalProgram(value)

# Normal program lookup
return self.find_program(name, required=required, wanted=wanted)
Expand Down

0 comments on commit d7b2566

Please sign in to comment.