Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

glib: conan v2 support #12221

Closed
wants to merge 6 commits into from
Closed

glib: conan v2 support #12221

wants to merge 6 commits into from

Conversation

SpaceIm
Copy link
Contributor

@SpaceIm SpaceIm commented Aug 14, 2022

closes #12890


  • I've read the guidelines for contributing.
  • I've followed the PEP8 style guides for Python code in the recipes.
  • I've used the latest Conan client version.
  • I've tried at least one configuration locally with the conan-center hook activated.

@ghost
Copy link

ghost commented Aug 14, 2022

I detected other pull requests that are modifying glib/all recipe:

This message is automatically generated by https://github.com/ericLemanissier/conan-center-conflicting-prs so don't hesitate to report issues/improvements there.

@conan-center-bot

This comment has been minimized.

@SpaceIm
Copy link
Contributor Author

SpaceIm commented Aug 15, 2022

In test_package (relying on PkgConfigDeps generator & conan.tools.gnu.PkgConf):

ERROR: glib/2.73.0 (test package): Error in test() method, line 48
	self.run(f"{pkg_config.variables['gdbus_codegen']} -h", env="conanrun")
	ConanException: pkg-config command ['pkg-config', '--print-variables', 'gio-2.0', '--print-errors'] failed with error: Command 'pkg-config --print-variables gio-2.0 --print-errors' returned non-zero exit status 1.
Variable 'libdir' not defined in '/home/conan/w/prod/BuildSingleReference/conan-center-index/recipes/glib/all/test_package/build/generators/gio-2.0.pc'

test_v1_package seems to still work.

I guess it comes from the pkg_config_custom_content appended to gio-2.0 component. This custom content relies on ${libdir}, and maybe it's not something defined by PkgConfigDeps while it was in pkg_config. /cc @czoido

Indeed, example with zlib.pc generated by PkgConfigDeps on macOS:

prefix=/Users/spaceim/.conan/data/zlib/1.2.12/_/_/package/a7fb9a1b45a50aff01ad6102760c848ff2ac80df
libdir1=${prefix}/lib
includedir1=${prefix}/include

Name: zlib
Description: Conan package: zlib
Version: 1.2.12
Libs: -L"${libdir1}" -lz -F /Users/spaceim/.conan/data/zlib/1.2.12/_/_/package/a7fb9a1b45a50aff01ad6102760c848ff2ac80df/Frameworks 
Cflags: -I"${includedir1}" 

So now we have to find a pkg_config_custom_content in package_info() of glib compatible with both pkg_config & PkgConfigDeps.

libdir is not a variable defined in .pc files generated by PkgConfigDeps
@conan-center-bot

This comment has been minimized.

@conan-center-bot

This comment has been minimized.

@SpaceIm
Copy link
Contributor Author

SpaceIm commented Aug 16, 2022

[204/501] Linking target glib/gtester
FAILED: glib/gtester 
cc  -o glib/gtester glib/gtester.p/gtester.c.o -Wl,-dead_strip_dylibs -Wl,-headerpad_max_install_names -Wl,-undefined,error -Wl,-framework,CoreFoundation -Wl,-framework,Carbon -Wl,-framework,Foundation -Wl,-framework,AppKit glib/libglib-2.0.a subprojects/proxy-libintl/libintl.a /Users/jenkins/w/prod/BuildSingleReference@3/.conan/data/pcre/8.45/_/_/package/6b708b31085f36a04cd9dea85c6b67a06a563c31/lib/libpcre.a -F /Users/jenkins/w/prod/BuildSingleReference@3/.conan/data/pcre/8.45/_/_/package/6b708b31085f36a04cd9dea85c6b67a06a563c31/Frameworks /Users/jenkins/w/prod/BuildSingleReference@3/.conan/data/bzip2/1.0.8/_/_/package/75fe66fbfe61230e9fcbb361f13b6b3baa483e0a/lib/libbz2.a /Users/jenkins/w/prod/BuildSingleReference@3/.conan/data/bzip2/1.0.8/_/_/package/75fe66fbfe61230e9fcbb361f13b6b3baa483e0a/Frameworks /Users/jenkins/w/prod/BuildSingleReference@3/.conan/data/zlib/1.2.12/_/_/package/647afeb69d3b0a2d3d316e80b24d38c714cc6900/lib/libz.a -liconv -lm
clang: error: no such file or directory: '/Users/jenkins/w/prod/BuildSingleReference@3/.conan/data/bzip2/1.0.8/_/_/package/75fe66fbfe61230e9fcbb361f13b6b3baa483e0a/Frameworks'

waiting a fix for conan-io/conan#11867

@ghost ghost mentioned this pull request Aug 18, 2022
4 tasks
@SpaceIm SpaceIm closed this Aug 18, 2022
@SpaceIm SpaceIm reopened this Aug 18, 2022
@conan-center-bot

This comment has been minimized.

@SpaceIm
Copy link
Contributor Author

SpaceIm commented Aug 18, 2022

For comparison, 2 logs of the same configuration (macOS apple-clang 12, Release, static):

In current PR, on macOS, intl (libgettext) is built, and it shouldn't. And I think that it links to system iconv instead of libiconv from conan.

@conan-center-bot

This comment has been minimized.

@conan-center-bot
Copy link
Collaborator

Failure in build 8 (7b7e77bd522ae754cb0658aebef2712b482aac89):

  • glib/2.71.3@:
    Didn't run or was cancelled before finishing

  • glib/2.68.3@:
    Didn't run or was cancelled before finishing

  • glib/2.70.4@:
    Didn't run or was cancelled before finishing

  • glib/2.69.3@:
    CI failed to create some packages (All logs)

    Logs for packageID 57e2d4b1f9a9ecfacdab6950910cab10504ec625:
    [settings]
    arch=x86_64
    build_type=Debug
    compiler=apple-clang
    compiler.libcxx=libc++
    compiler.version=12.0
    os=Macos
    [options]
    glib:shared=False
    
    [...]
    [100%] Linking C executable bin/test_package
    CMake Warning:
      Manually-specified variables were not used by the project:
    
        CMAKE_EXPORT_NO_PACKAGE_REGISTRY
        CMAKE_INSTALL_BINDIR
        CMAKE_INSTALL_DATAROOTDIR
        CMAKE_INSTALL_INCLUDEDIR
        CMAKE_INSTALL_LIBDIR
        CMAKE_INSTALL_LIBEXECDIR
        CMAKE_INSTALL_OLDINCLUDEDIR
        CMAKE_INSTALL_SBINDIR
    
    
    /Users/jenkins/w/prod/BuildSingleReference/conan-center-index/recipes/glib/all/test_package/test_package.c:17:5: warning: ignoring return value of function declared with const attribute [-Wunused-value]
        g_module_supported();
        ^~~~~~~~~~~~~~~~~~
    1 warning generated.
    Undefined symbols for architecture x86_64:
      "_g_libintl_bind_textdomain_codeset", referenced from:
          _ensure_gettext_initialized in libglib-2.0.a(ggettext.c.o)
      "_g_libintl_bindtextdomain", referenced from:
          _ensure_gettext_initialized in libglib-2.0.a(ggettext.c.o)
      "_g_libintl_dcgettext", referenced from:
          _g_dcgettext in libglib-2.0.a(ggettext.c.o)
      "_g_libintl_dgettext", referenced from:
          _g_dgettext in libglib-2.0.a(ggettext.c.o)
      "_g_libintl_dngettext", referenced from:
          _g_dngettext in libglib-2.0.a(ggettext.c.o)
      "_g_libintl_gettext", referenced from:
          __g_dgettext_should_translate in libglib-2.0.a(ggettext.c.o)
      "_g_libintl_textdomain", referenced from:
          __g_dgettext_should_translate in libglib-2.0.a(ggettext.c.o)
      "_iconv", referenced from:
          _g_iconv in libglib-2.0.a(gconvert.c.o)
         (maybe you meant: _g_convert_with_iconv, _g_iconv_close , _g_iconv , _g_iconv_open )
      "_iconv_close", referenced from:
          _g_iconv_close in libglib-2.0.a(gconvert.c.o)
         (maybe you meant: _g_iconv_close)
      "_iconv_open", referenced from:
          _try_conversion in libglib-2.0.a(gconvert.c.o)
         (maybe you meant: _g_iconv_open)
    ld: symbol(s) not found for architecture x86_64
    clang: error: linker command failed with exit code 1 (use -v to see invocation)
    make[2]: *** [bin/test_package] Error 1
    make[1]: *** [CMakeFiles/test_package.dir/all] Error 2
    make: *** [all] Error 2
    ERROR: glib/2.69.3 (test package): Error in build() method, line 22
    	cmake.build()
    	ConanException: Error 2 while executing cmake --build '/Users/jenkins/w/prod/BuildSingleReference/conan-center-index/recipes/glib/all/test_v1_package/build/e652c92c0e7aae383558782458fc2019b679639b' '--' '-j4'
    
  • glib/2.72.1@:
    Didn't run or was cancelled before finishing

  • glib/2.73.0@:
    Didn't run or was cancelled before finishing

  • glib/2.73.3@:
    Didn't run or was cancelled before finishing

  • glib/2.73.2@:
    Didn't run or was cancelled before finishing

  • glib/2.73.1@:
    Didn't run or was cancelled before finishing


Note: To save resources, CI tries to finish as soon as an error is found. For this reason you might find that not all the references have been launched or not all the configurations for a given reference. Also, take into account that we cannot guarantee the order of execution as it depends on CI workload and workers availability.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Projects
None yet
Development

Successfully merging this pull request may close these issues.

[package] <glib> Generated pkg-conf file contains invalid content
2 participants