Skip to content
  • Ting-Wei Lan's avatar
    core-deps-latest: Update meson to 0.52.0 and fix library path issues · dbe67904
    Ting-Wei Lan authored
    Meson 0.47 changes the way to handle external dependencies on shared
    libraries significantly. Instead of just putting arguments provided by
    pkg-config on the linker command line, meson tries to convert -L and -l
    arguments into absolute paths to .so files by itself. This should make
    library handling more reliable because an absolute path is less likely
    to go wrong than an ordered list of search paths. However, due to the
    big change, a few regressions is still introduced, causing modules to
    fail to build in a JHBuild environment from time to time.
    
    Ideally regressions should be fixed in a few weeks and made available in
    subsequent releases. Unfortunately, I can't get my patches merged
    upstream in one year, and I have to remember to patch meson manually
    every time JHBuild updates meson. This is annoying because there are
    always modules failing to build because of these known bugs if I forget
    to patch it. Therefore, I think it is time to submit these patches to
    JHBuild, so it can be applied automatically.
    
    The above patches have been added to FreeBSD ports since Meson 0.48.
    The CI runner currently used to test GLib on FreeBSD also uses it.
    Given that they has been used for one year without issues, it should be
    safe to use them to JHBuild as well.
    
    https://github.com/mesonbuild/meson/issues/4270
    https://github.com/mesonbuild/meson/pull/4324
    
    https://github.com/mesonbuild/meson/issues/4271
    https://github.com/mesonbuild/meson/pull/4325
    
    Meson 0.52 introduces a new library path regression. It now tries to add
    -Wl,-rpath-link when pkg-config --static returns more -L arguments than
    the default pkg-config call. The intention is to tell GNU ld.bfd where
    it can find dependencies of shared libraries, but the implementation
    does it in a wrong order and creates more undefined reference errors
    than it fixes in JHBuild environments. Since JHBuild always does native
    builds and LD_LIBRARY_PATH is set, -Wl,-rpath-link arguments pointing to
    installation prefixes are unnecessary in JHBuild environments.
    Therefore, it is safe to work around the issue by reverting the commit
    introducing the feature temporarily.
    
    https://github.com/mesonbuild/meson/pull/5647
    https://github.com/mesonbuild/meson/issues/6027
    https://github.com/mesonbuild/meson/pull/6031
    
    Meson 0.52 also changes the way to handle static libraries. It is known
    to break builds for dconf and gnome-builder. Unfortunately, these two
    projects don't fix them in a week and we are going to update meson
    without fixing them first. We backport a patch to remove duplicates from
    the linker command line to resolve 'argument list too long' error when
    building gnome-builder. This doesn't fix the build failure, but it
    should make it easier to debug the link_whole issue.
    
    https://github.com/mesonbuild/meson/pull/5936
    https://github.com/mesonbuild/meson/pull/6030
    dconf#59
    gnome-builder#1057
    dbe67904