msys2 / MINGW-packages

Package scripts for MinGW-w64 targets to build under MSYS2.
https://packages.msys2.org
BSD 3-Clause "New" or "Revised" License
2.22k stars 1.19k forks source link

using `pkg-config` instead of `pkgconf` in cmake #11976

Open djdisodo opened 2 years ago

djdisodo commented 2 years ago
$ pacman -S mingw-w64-x86_64-cmake
warning: mingw-w64-x86_64-cmake-3.23.2-2 is up to date -- reinstalling
resolving dependencies...
looking for conflicting packages...
:: mingw-w64-x86_64-pkgconf and mingw-w64-x86_64-pkg-config are in conflict. Remove mingw-w64-x86_64-pkg-config? [Y/n]

i want to use pkg-config instead of pkgconf because pkgconf didn't handle spaces in directory well you can ignore this by pacman -S mingw-w64-x86_64-cmake --assume-installed mingw-w64-x86_64-pkgconf but not ideal

does pacman allow multiple packages to provide on feature? can you allow using pkg-config instead of pkgconf by default?

Biswa96 commented 2 years ago

because pkgconf didn't handle spaces in directory well

Can you provide an example to reproduce the issue? If it is reproducible we should report the issue in upstream pkgconf as well.

djdisodo commented 2 years ago

@Biswa96 image it's been a while i don't have more information i'll add it soon you can see spaces are double escaped in this screenshot

1480c1 commented 2 years ago

can you show the fuse3.pc file that it's pulling from? I wonder if it's seeing the \ used to escape the space, but then escaping the \ thinking it's not used as an escape somewhere in the code?

djdisodo commented 2 years ago
PC@DESKTOP-S799JDR MINGW64 ~
$ export PKG_CONFIG_PATH=/mingw64/lib/pkgconfig:/mingw64/share/pkgconfig:'/c/Program Files (x86)/WinFsp/lib'

PC@DESKTOP-S799JDR MINGW64 ~
$ echo $PKG_CONFIG_PATH
/mingw64/lib/pkgconfig:/mingw64/share/pkgconfig:/c/Program Files (x86)/WinFsp/lib

PC@DESKTOP-S799JDR MINGW64 ~
$ pkg-config fuse3 --libs --cflags
-IC:\\Program\ Files\ (x86)\\WinFsp\\lib/../inc/fuse3 C:\\Program\ Files\ (x86)\\WinFsp\\lib/../bin/winfsp-x64.dll

PC@DESKTOP-S799JDR MINGW64 ~
$ pacman -S mingw-w64-x86_64-pkgconf
resolving dependencies...
looking for conflicting packages...
:: mingw-w64-x86_64-pkgconf and mingw-w64-x86_64-pkg-config are in conflict. Remove mingw-w64-x86_64-pkg-config? [Y/n] Y

Packages (2) mingw-w64-x86_64-pkg-config-0.29.2-3 [removal]  mingw-w64-x86_64-pkgconf-1.8.0-2

Total Installed Size:   0.48 MiB
Net Upgrade Size:      -0.85 MiB

:: Proceed with installation? [Y/n] Y
(1/1) checking keys in keyring                                                                                                                                     [####################################################################################################] 100%
(1/1) checking package integrity                                                                                                                                   [####################################################################################################] 100%
(1/1) loading package files                                                                                                                                        [####################################################################################################] 100%
(1/1) checking for file conflicts                                                                                                                                  [####################################################################################################] 100%
(2/2) checking available disk space                                                                                                                                [####################################################################################################] 100%
:: Processing package changes...
(1/1) removing mingw-w64-x86_64-pkg-config                                                                                                                         [####################################################################################################] 100%
(1/1) installing mingw-w64-x86_64-pkgconf                                                                                                                          [####################################################################################################] 100%

PC@DESKTOP-S799JDR MINGW64 ~
$ pkg-config fuse3 --libs --cflags
-IC:/Program\\ Files\\ (x86)/WinFsp/lib/../inc/fuse3 C:/Program\\ Files\\ (x86)/WinFsp/lib/../bin/winfsp-x64.dll

PC@DESKTOP-S799JDR MINGW64 ~
$ cat '/c/Program Files (x86)/WinFsp/lib/fuse3.pc'
arch=x64
prefix=${pcfiledir}/..
incdir=${prefix}/inc/fuse3
implib=${prefix}/bin/winfsp-${arch}.dll

Name: fuse3
Description: WinFsp FUSE3 compatible API
Version: 3.2
URL: http://www.secfs.net/winfsp/
Libs: "${implib}"
Cflags: -I"${incdir}"

PC@DESKTOP-S799JDR MINGW64 ~
$
djdisodo commented 2 years ago

i don't think allowing to use pkg-config instead of pkgconf makes any problem

Biswa96 commented 2 years ago

There are many features that pkgconf provides but pkg-config does not. See more in README of pkgconf project https://github.com/pkgconf/pkgconf

1480c1 commented 2 years ago

${pcfiledir}

https://bugs.freedesktop.org/show_bug.cgi?id=62018

First time I ever heard of that

https://github.com/pkgconf/pkgconf/blob/b0802cb3d19b5b963ad20eed464a2da6e7d7b0b5/libpkgconf/pkg.c#L236

Found the function that might potentially have the issue