Skip to content

Commit

Permalink
treewide: internally avoid deprecated machine file uses of "pkgconfig"
Browse files Browse the repository at this point in the history
We support this in a machine file:

```
[binaries]
pkgconfig = 'pkg-config'
pkg-config = 'pkg-config'
```

and you can use either one, because internally we look up both. If you
only set *one* of them, this plays awkwardly with setting $PKG_CONFIG,
since we don't know which one you set in the machine file and the
*other* one will be initialized from the environment instead.

In commit 22df45a we changed program
lookup of config-tool style dependencies to use the regular tool names
and only fall back on the strange internal names. This affected the
pkg-config class too.

The result is that instead of preferring `pkgconfig =` followed by
$PKG_CONFIG followed by `pkg-config =`, we inverted the lookup order.
This is a good idea anyway, because now it behaves consistently with
`find_program('pkg-config')`.

Unfortunately, we documented the wrong name in a bunch of places, and
also used the wrong name in various testsuite bits, which meant that if
you set $PKG_CONFIG and then ran the testsuite, it would fail.

Correct these references, because they are buggy.
  • Loading branch information
eli-schwartz committed Aug 1, 2023
1 parent f5ecafc commit 9da567b
Show file tree
Hide file tree
Showing 10 changed files with 13 additions and 13 deletions.
2 changes: 1 addition & 1 deletion cross/armclang-linux.txt
Original file line number Diff line number Diff line change
Expand Up @@ -22,7 +22,7 @@ c = ['/opt/arm/developmentstudio-2019.0/sw/ARMCompiler6.12/bin/armclang', '--tar
#cpp = '/usr/bin/arm-linux-gnueabihf-g++'
ar = '/opt/arm/developmentstudio-2019.0/sw/ARMCompiler6.12/bin/armar'
#strip = '/usr/arm-linux-gnueabihf/bin/strip'
#pkgconfig = '/usr/bin/arm-linux-gnueabihf-pkg-config'
#pkg-config = '/usr/bin/arm-linux-gnueabihf-pkg-config'

[host_machine]
system = 'baremetal'
Expand Down
2 changes: 1 addition & 1 deletion cross/linux-mingw-w64-32bit.txt
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,7 @@ cpp = '/usr/bin/i686-w64-mingw32-g++'
objc = '/usr/bin/i686-w64-mingw32-gcc'
ar = '/usr/bin/i686-w64-mingw32-ar'
strip = '/usr/bin/i686-w64-mingw32-strip'
pkgconfig = '/usr/bin/i686-w64-mingw32-pkg-config'
pkg-config = '/usr/bin/i686-w64-mingw32-pkg-config'
windres = '/usr/bin/i686-w64-mingw32-windres'
exe_wrapper = 'wine'
ld = '/usr/bin/i686-w64-mingw32-ld'
Expand Down
2 changes: 1 addition & 1 deletion cross/linux-mingw-w64-64bit.txt
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,7 @@ cpp = '/usr/bin/x86_64-w64-mingw32-g++'
objc = '/usr/bin/x86_64-w64-mingw32-gcc'
ar = '/usr/bin/x86_64-w64-mingw32-ar'
strip = '/usr/bin/x86_64-w64-mingw32-strip'
pkgconfig = '/usr/bin/x86_64-w64-mingw32-pkg-config'
pkg-config = '/usr/bin/x86_64-w64-mingw32-pkg-config'
windres = '/usr/bin/x86_64-w64-mingw32-windres'
exe_wrapper = 'wine'
cmake = '/usr/bin/cmake'
Expand Down
2 changes: 1 addition & 1 deletion cross/none.txt
Original file line number Diff line number Diff line change
Expand Up @@ -15,5 +15,5 @@ fc = ['false']
objc = ['false']
objcpp = ['false']
ar = ['false']
pkgconfig = ['false']
pkg-config = ['false']
cmake = ['false']
2 changes: 1 addition & 1 deletion cross/ubuntu-armhf.txt
Original file line number Diff line number Diff line change
Expand Up @@ -6,7 +6,7 @@ cpp = ['/usr/bin/arm-linux-gnueabihf-g++']
rust = ['rustc', '--target', 'arm-unknown-linux-gnueabihf', '-C', 'linker=/usr/bin/arm-linux-gnueabihf-gcc-7']
ar = '/usr/arm-linux-gnueabihf/bin/ar'
strip = '/usr/arm-linux-gnueabihf/bin/strip'
pkgconfig = '/usr/bin/arm-linux-gnueabihf-pkg-config'
pkg-config = '/usr/bin/arm-linux-gnueabihf-pkg-config'
ld = '/usr/bin/arm-linux/gnueabihf-ld'

[built-in options]
Expand Down
6 changes: 3 additions & 3 deletions docs/markdown/Machine-files.md
Original file line number Diff line number Diff line change
Expand Up @@ -90,7 +90,7 @@ arch = 'aarch64-linux-gnu'
c = arch + '-gcc'
cpp = arch + '-g++'
strip = arch + '-strip'
pkgconfig = arch + '-pkg-config'
pkg-config = arch + '-pkg-config'
...
```

Expand Down Expand Up @@ -165,7 +165,7 @@ c_ld = 'gold'
cpp_ld = 'gold'
ar = '/usr/i586-mingw32msvc/bin/ar'
strip = '/usr/i586-mingw32msvc/bin/strip'
pkgconfig = '/usr/bin/i586-mingw32msvc-pkg-config'
pkg-config = '/usr/bin/i586-mingw32msvc-pkg-config'
```

An incomplete list of internally used programs that can be overridden
Expand All @@ -179,7 +179,7 @@ here is:
- libwmf-config
- llvm-config
- pcap-config
- pkgconfig
- pkg-config
- sdl2-config
- wx-config (or wx-3.0-config or wx-config-gtk)

Expand Down
2 changes: 1 addition & 1 deletion mesonbuild/scripts/env2mfile.py
Original file line number Diff line number Diff line change
Expand Up @@ -213,7 +213,7 @@ def detect_cross_debianlike(options: T.Any) -> MachineInfo:
except ValueError:
pass
try:
infos.binaries['pkgconfig'] = locate_path("%s-pkg-config" % host_arch)
infos.binaries['pkg-config'] = locate_path("%s-pkg-config" % host_arch)
except ValueError:
pass # pkg-config is optional
try:
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -6,7 +6,7 @@ cpp = '/usr/bin/arm-linux-gnueabihf-g++'
rust = ['rustc', '--target', 'arm-unknown-linux-gnueabihf', '-C', 'linker=/usr/bin/arm-linux-gnueabihf-gcc-7']
ar = '/usr/arm-linux-gnueabihf/bin/ar'
strip = '/usr/arm-linux-gnueabihf/bin/strip'
pkgconfig = '/usr/bin/arm-linux-gnueabihf-pkg-config'
pkg-config = '/usr/bin/arm-linux-gnueabihf-pkg-config'

[properties]
root = '/usr/arm-linux-gnueabihf'
Expand Down
2 changes: 1 addition & 1 deletion test cases/unit/36 exe_wrapper behaviour/broken-cross.txt
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,7 @@ c = '/usr/bin/x86_64-w64-mingw32-gcc'
cpp = '/usr/bin/x86_64-w64-mingw32-g++'
ar = '/usr/bin/x86_64-w64-mingw32-ar'
strip = '/usr/bin/x86_64-w64-mingw32-strip'
pkgconfig = '/usr/bin/x86_64-w64-mingw32-pkg-config'
pkg-config = '/usr/bin/x86_64-w64-mingw32-pkg-config'
windres = '/usr/bin/x86_64-w64-mingw32-windres'
exe_wrapper = 'broken'

Expand Down
4 changes: 2 additions & 2 deletions unittests/allplatformstests.py
Original file line number Diff line number Diff line change
Expand Up @@ -2722,7 +2722,7 @@ def test_native_dep_pkgconfig(self):
with tempfile.NamedTemporaryFile(mode='w', delete=False, encoding='utf-8') as crossfile:
crossfile.write(textwrap.dedent(
'''[binaries]
pkgconfig = '{}'
pkg-config = '{}'
[properties]
Expand All @@ -2749,7 +2749,7 @@ def test_pkg_config_libdir(self):
with tempfile.NamedTemporaryFile(mode='w', delete=False, encoding='utf-8') as crossfile:
crossfile.write(textwrap.dedent(
'''[binaries]
pkgconfig = 'pkg-config'
pkg-config = 'pkg-config'
[properties]
pkg_config_libdir = ['{}']
Expand Down

0 comments on commit 9da567b

Please sign in to comment.