Skip to content
GitLab
Projects Groups Topics Snippets
  • /
  • Help
    • Help
    • Support
    • Community forum
    • Submit feedback
    • Contribute to GitLab
  • Register
  • Sign in
  • gobject-introspection gobject-introspection
  • Project information
    • Project information
    • Activity
    • Labels
    • Members
  • Repository
    • Repository
    • Files
    • Commits
    • Branches
    • Tags
    • Contributor statistics
    • Graph
    • Compare revisions
  • Issues 256
    • Issues 256
    • List
    • Boards
    • Service Desk
    • Milestones
  • Merge requests 48
    • Merge requests 48
  • CI/CD
    • CI/CD
    • Pipelines
    • Jobs
    • Artifacts
    • Schedules
  • Deployments
    • Deployments
    • Environments
    • Releases
  • Packages and registries
    • Packages and registries
    • Container Registry
    • Model experiments
  • Monitor
    • Monitor
    • Incidents
  • Analytics
    • Analytics
    • Value stream
    • CI/CD
    • Repository
  • Activity
  • Graph
  • Create a new issue
  • Jobs
  • Commits
  • Issue Boards
Collapse sidebar
  • GNOMEGNOME
  • gobject-introspectiongobject-introspection
  • Issues
  • #222

Incorrect shared-library value in GIRs built on macOS for libraries that use @rpath in install_name

When GIRs are built on macOS with Meson, the shared-library= entry in the GIR incorrectly prepends @rpath to the library name.

<?xml version="1.0"?>
<!-- This file was automatically generated from C sources - DO NOT EDIT!
To affect the contents of this file, edit the original C definitions,
and/or use gtk-doc annotations.  -->
<repository version="1.2"
            xmlns="http://www.gtk.org/introspection/core/1.0"
            xmlns:c="http://www.gtk.org/introspection/c/1.0"
            xmlns:glib="http://www.gtk.org/introspection/glib/1.0">
  <include name="GObject" version="2.0"/>
  <package name="atk"/>
  <c:include name="atk/atk.h"/>
  <namespace name="Atk"
             version="1.0"
             shared-library="/nix/store/3y2alx23lizpj0pqsz8g9ydfcmw6b3qs-atk-2.28.1/lib/@rpath/libatk-1.0.0.dylib"
             c:identifier-prefixes="Atk"
             c:symbol-prefixes="atk">
...

(Example taken from the Meson bug)

I tracked this down to giscanner/shlibs.py:_resolve_non_libtool():

if platform_system == 'Darwin':
    args.extend(['otool', '-L', binary.args[0]])

otool -L here will return @rpath/libatk-1.0.0.dylib

Then it extracts the library name with this regex: "([^\s]*lib*%s[^A-Za-z0-9_-][^\s\(\)]*)". This will erroneously include the leading @rpath in the result.

This doesn't happen with Autotools because it does not use @rpath in install_name. Meson does.

Edited Aug 14, 2018 by Nirbheek Chauhan
To upload designs, you'll need to enable LFS and have an admin enable hashed storage. More information
Assignee
Assign to
Time tracking