conan-io / conan-center-index

Recipes for the ConanCenter repository
https://conan.io/center
MIT License
920 stars 1.66k forks source link

msys2 msys2/cci.latest: pkg-config binary missing #24073

Open faizalatcirclecvi opened 1 month ago

faizalatcirclecvi commented 1 month ago

Description

pkg-config binary is missing from the latest revision of the package. Any recipe that is depends on msys2/cci.latest for build requirements fails to build if the autotools configure relies on pkg-config binary for dependent libraries.

Current workaround is to add additional step in the consumer recipe to re-install base-devel package so that the missing pkg-config is installed.

tools.run_in_windows_bash(self,"pacman -S base-devel --noconfirm")

This looks like an msys2 issue.

Package and Environment Details

Conan profile

[settings] arch=x86_64 build_type=Release compiler=msvc compiler.cppstd=17 compiler.runtime=dynamic compiler.runtime_type=Release compiler.version=192 os=Windows

Steps to reproduce

Step 1: Install latest msys2 package

conan install --requires msys2/cci.latest@#567331f1604f3c584f04feade960f06e -pr:h tools16-x86_64 -pr:b tools16-x86_64

conan list msys2/cci.latest#*:*
Local Cache
  msys2
    msys2/cci.latest
      revisions
        5a31efa2bde593541fd5ac3bcc50c01c (2023-11-13 10:26:30 UTC)
          packages
            956a88975bda9dfcc485e2861d71e74bd7e2b9a5
              info
                settings
                  arch: x86_64
                  os: Windows
                options
                  exclude_files: */link.exe
                  packages: base-devel,binutils,gcc

Step 2: Open msys2 session by navigating to package path

conan cache path msys2/cci.latest:956a88975bda9dfcc485e2861d71e74bd7e2b9a5
C:\Users\faizal.haji\.conan2\p\msys27f2f094a41efb\p
cd C:\Users\faizal.haji\.conan2\p\msys27f2f094a41efb\p
msys2.exe

Step 3: In msys2 session:

faizal.haji@CIRCLE-FaizalDT MSYS /bin
$ pkg-config
-bash: pkg-config: command not found

faizal.haji@CIRCLE-FaizalDT MSYS /bin

$ pacman -S base-devel --noconfirm
warning: base-devel-2022.12-2 is up to date -- reinstalling
resolving dependencies...
looking for conflicting packages...

Packages (2) pkgconf-1.9.4-1  base-devel-2022.12-2

Total Installed Size:  0.29 MiB

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

faizal.haji@CIRCLE-FaizalDT MSYS /bin
$ pkg-config --version
1.9.4

Logs

Click to expand log ``` faizal.haji@CIRCLE-FaizalDT MSYS /bin $ pkg-config -bash: pkg-config: command not found faizal.haji@CIRCLE-FaizalDT MSYS /bin $ pacman -S base-devel --noconfirm warning: base-devel-2022.12-2 is up to date -- reinstalling resolving dependencies... looking for conflicting packages... Packages (2) pkgconf-1.9.4-1 base-devel-2022.12-2 Total Installed Size: 0.29 MiB :: Proceed with installation? [Y/n] (2/2) checking keys in keyring [###################################################] 100% (2/2) checking package integrity [###################################################] 100% (2/2) loading package files [###################################################] 100% (2/2) checking for file conflicts [###################################################] 100% (2/2) checking available disk space [###################################################] 100% :: Processing package changes... (1/2) installing pkgconf [###################################################] 100% (2/2) reinstalling base-devel [###################################################] 100% faizal.haji@CIRCLE-FaizalDT MSYS /bin $ pkg-config --version 1.9.4 ```
SpaceIm commented 1 month ago

You shouldn't assume in your recipe that pkg-config (nor autotools) is installed with msys2. You can add pkgconf recipe in build requirements of your recipe.

faizalatcirclecvi commented 1 month ago

You shouldn't assume in your recipe that pkg-config (nor autotools) is installed with msys2. You can add pkgconf recipe in build requirements of your recipe.

Yes, that makes sense. How does pkgconf build requirement add pkg-config to the msys2 environment since it is a separate package?

Update: Using pkgconf as a build requirement solves the problem and makes sense as the recommended approach. This issue can be closed. Thanks for the hint.