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

In dependencies requires gobject-introspection but meson dont can find it #2273

Closed
friktor opened this issue Sep 2, 2017 · 25 comments
Closed
Labels
bug dependencies gnome OS:macos Issues specific to Apple Operating Systems like MacOS and iOS

Comments

@friktor
Copy link

friktor commented Sep 2, 2017

Im getting this error line:
gobject-introspection dependency was not found, gir cannot be generated.
But i have gobject-introspection in my pkg-config list.

pkg-config --libs gobject-introspection-1.0
-L/usr/local/Cellar/gobject-introspection/1.52.1_1/lib -L/usr/local/Cellar/glib/2.52.3/lib -L/usr/local/opt/gettext/lib -lgirepository-1.0 -lgobject-2.0 -lglib-2.0 -lintl -Wl,-framework -Wl,CoreFoundation

Target OS build - Mac OS Sierra

@TingPing
Copy link
Member

TingPing commented Sep 2, 2017

It needs the g-i tools not the library, and i imagine the tools are not in PATH.

@nirbheek
Copy link
Member

nirbheek commented Sep 4, 2017

The error message should be fixed to specifically say which tool is missing.

@TingPing
Copy link
Member

TingPing commented Sep 4, 2017

We might even be able to do better in this case. The gobject-introspection-1.0 pkg-config file contains absolute paths to its tools.

@TingPing
Copy link
Member

TingPing commented Sep 4, 2017

Ok so I was wrong about this error being because of missing tools and it is indeed failing to look up the 'gobject-introspection-1.0' pkgconfig.

@friktor
Copy link
Author

friktor commented Sep 4, 2017

@TingPing this bug reproduce only on Mac OS? How i can fix this problem? Or this bug into meson?

@TingPing
Copy link
Member

TingPing commented Sep 4, 2017

Meson just calls pkg-config directly so for some reason it is failing to find it and I would say that is unique to your environment.

@friktor
Copy link
Author

friktor commented Sep 4, 2017

@TingPing but if PkgConfig just call from my env - why meson dont find gobject? Mac it is like Linux... but Mac

@nirbheek nirbheek added dependencies OS:macos Issues specific to Apple Operating Systems like MacOS and iOS and removed documentation help wanted labels Sep 7, 2017
@niedzielski

This comment has been minimized.

@tcitworld

This comment has been minimized.

@gkelly

This comment has been minimized.

@aleks-o

This comment has been minimized.

@ljmf00
Copy link
Contributor

ljmf00 commented Sep 5, 2018

Same issue on macOS Mojave 10.14 Beta:

Dependency gobject-2.0 found: YES 2.54.2
Configuring meson-sample.h using configuration
Determining dependency 'gobject-introspection-1.0' with pkg-config executable '/usr/local/bin/pkg-config'
Called `/usr/local/bin/pkg-config --modversion gobject-introspection-1.0` -> 0
1.54.1
Called `/usr/local/bin/pkg-config --cflags gobject-introspection-1.0` -> 1
 
 
mesongir/meson.build:18:0: ERROR:  gobject-introspection dependency was not found, gir cannot be generated.

image

@davibe
Copy link

davibe commented Sep 11, 2018

same here, is there a osx workaround

@davibe
Copy link

davibe commented Sep 11, 2018

@ljmf00
I have tried to run the same command it complains about (see the exit code -> 1)

dade@choo:~$ pkg-config --cflags gobject-introspection-1.0
Package libffi was not found in the pkg-config search path.
Perhaps you should add the directory containing `libffi.pc'
to the PKG_CONFIG_PATH environment variable
Package 'libffi', required by 'gobject-introspection-1.0', not found
dade@choo:~$ brew search libffi

So i tried

brew reinstall libffi

which reminded me of

libffi is keg-only, which means it was not symlinked into /usr/local,
because some formulae require a newer version of libffi.

For compilers to find libffi you may need to set:
  export LDFLAGS="-L/usr/local/opt/libffi/lib"

For pkg-config to find libffi you may need to set:
  export PKG_CONFIG_PATH="/usr/local/opt/libffi/lib/pkgconfig"

so then i tried to export PKG_CONFIG_PATH="/usr/local/opt/libffi/lib/pkgconfig"

This fixed the issue, at least on my mac

@ljmf00
Copy link
Contributor

ljmf00 commented Sep 11, 2018

@davibe macOS is not my main operation system, I just use it to test releases and code to work on cross platform, so I just figured it out because of #4132 . I can test it on High Sierra too, but whats your macOS version? Because your problem was not that, at all. The thing is pkg-config can find it but meson don't.

@davibe
Copy link

davibe commented Sep 12, 2018

@ljmf00 in my case pkg-config --libs was able to find gobject-introspection-1.0 just fine but --cflags failed with that error, which is the same as not finding it
Infact i got the very same error you have with meson. It could be a different case but i think its worth doublechecking

I am using high sierra 10.13.6

@ManasJayanth
Copy link

@davibe 's suggestion worked for me. Thank you.

@claucece
Copy link

This might help here:

In my case I did the export PKG_CONFIG_PATH="/usr/local/opt/libffi/lib/pkgconfig" as well; but I noticed that it was not finding it when using as a dependency of glib. When I switched the current version of glib (2.60) to an older one (2.56), everything worked correctly in my project (OTRv4 in pidgin).

@nefuddos
Copy link

nefuddos commented Apr 26, 2019

this is the same error with my situation in os: ubuntu 16.04.5
gobject-introspection dependency was not found, gir cannot be generated.

and when i check meson-logs/meson-log.txt. it shows:
Determining dependency 'gobject-introspection-1.0' with pkg-config executable '/usr/bin/pkg-config' Meson encountered an error in file atk/meson.build, line 143, column 8: gobject-introspection dependency was not found, gir cannot be generated

i try to install libgirepository1.0-dev:
sudo apt-get install libgirepository1.0-dev

it works.

@GoPerry
Copy link

GoPerry commented May 21, 2019

Program(s) ['g-ir-scanner'] not found in Ubuntu 18.04
i try to install libgirepository1.0-dev:
sudo apt-get install libgirepository1.0-dev

it works.

@jameswestman
Copy link
Contributor

I tried @davibe's solution of putting libffi in the PKG_CONFIG_PATH on macOS, but it's still not working. It looks like #2400 might be why.

@grimmy
Copy link

grimmy commented Jul 15, 2019

I tried @davibe's solution of putting libffi in the PKG_CONFIG_PATH on macOS, but it's still not working. It looks like #2400 might be why.

I've added some findings to #2400, I'm still looking for a solution, but I found why it's not working, I just don't understand why that value is missing.

@JeyP4
Copy link

JeyP4 commented Dec 2, 2019

Program(s) ['g-ir-scanner'] not found in Ubuntu 18.04
i try to install libgirepository1.0-dev:
sudo apt-get install libgirepository1.0-dev

it works.

Instead better
sudo apt-get install gobject-introspection

@eli-schwartz
Copy link
Member

Current versions of meson do get the tools from pkg-config. There's nothing we can do about missing development dependencies such as libffi.

I'm assuming this is either fixed or not a meson bug, but please feel free to re-open it if you can still reproduce the problem.

@barracuda156
Copy link
Contributor

@eli-schwartz There are still issues with meson being unable to find installed dependencies which pkgconfig does find, and even losing dependencies on the way: specifically, I cannot build libnotify now whatever I try, since even though meson sees Glib2 at configure, it all of a sudden cannot find it when generating gtk docs.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug dependencies gnome OS:macos Issues specific to Apple Operating Systems like MacOS and iOS
Projects
None yet
Development

No branches or pull requests