Skip to content

Commit

Permalink
pkg-config: do not ever successfully detect Strawberry Perl.
Browse files Browse the repository at this point in the history
This is broken and terrible and thus completely unusable. Don't torture
users by finding pkg-config on Windows, thus permitting the pkg-config
lookup of several dependencies that do not actually work -- which then
fails at build time.

This also breaks CI for the wrapdb, because Strawberry Perl is provided
as part of the base image for the OS (yes, even though it is terribly
broken!!!) and anything that depends on e.g. zlib will "find" zlib
because of this broken disaster, even though it should use the wrapdb
subproject of zlib.

It is assumed no one actually wants to mix Strawberry Perl and meson. In
fact, some projects, such as gst-build, already unconditionally error
out if Strawberry Perl is detected in PATH:

    error('You have Strawberry Perl in PATH which is known to cause build issues with gst-build. Please remove it from PATH or uninstall it.')

Other projects (postgresql) actually do want to build perl extensions,
and link to the perl dlls, but absolutely under no circumstances ever
want to use its pkg-config implementation. ;)

Let's solve this problem by just considering this to not be a valid
pkg-config, let the user find another or not have one at all.

This change "solves"
StrawberryPerl/Perl-Dist-Strawberry#11
  • Loading branch information
eli-schwartz committed Oct 10, 2021
1 parent 9b80874 commit 4b9fa3a
Showing 1 changed file with 4 additions and 1 deletion.
5 changes: 4 additions & 1 deletion mesonbuild/dependencies/pkgconfig.py
Original file line number Diff line number Diff line change
Expand Up @@ -424,6 +424,9 @@ def check_pkgconfig(self, pkgbin: ExternalProgram) -> T.Optional[str]:
if not pkgbin.found():
mlog.log(f'Did not find pkg-config by name {pkgbin.name!r}')
return None
if r'Strawberry\perl\bin' in pkgbin.get_path():
mlog.log('found pkg-config {!r} but it is Strawberry Perl and thus broken. Ignoring...'.format(' '.join(pkgbin.get_command())))
return None
try:
p, out = Popen_safe(pkgbin.get_command() + ['--version'])[0:2]
if p.returncode != 0:
Expand All @@ -433,7 +436,7 @@ def check_pkgconfig(self, pkgbin: ExternalProgram) -> T.Optional[str]:
mlog.warning(f'We thought we found pkg-config {command_as_string!r} but now it\'s not there. How odd!')
return None
except PermissionError:
msg = f'Found pkg-config {command_as_string!r} but didn\'t have permissions to run it.')
msg = f'Found pkg-config {command_as_string!r} but didn\'t have permissions to run it.'
if not self.env.machines.build.is_windows():
msg += '\n\nOn Unix-like systems this is often caused by scripts that are not executable.'
mlog.warning(msg)
Expand Down

0 comments on commit 4b9fa3a

Please sign in to comment.