On Thu, 2014-07-17 at 15:10 +0200, Armin Rigo wrote:
Thanks for the explanations! And, just to be complete, may I ask how PyPy finds the other libraries it needs,
Excellent question for a PyPy developer; to be honest, I actually have very little idea :-) I guess it just adds the -l / -L / -I flags (discovered either by checking a pre-defined set of paths, or by running pkg-config) and hopes that all the right libraries are installed and headers are at the correct place, and blows up otherwise. It seems from a cursory grep that the Makefile writing logic is here: pypy/pypy/rpython/translator/platform Specifically, see posix.py and linux.py.
and how in general project X finds library Y that it depends on?
The build systems usually try pkg-config, then a list of pre-defined locations and flags. Then a dummy executable is compiled, linked and run. If it works, everything is great, if not, it complains and/or disables the dependency. Now, this has to do with building, but as we've established, the buildpacks don't actually build anything, but rather unpack pre-compiled binaries. In this case, it's a dynamic linker thing. In brief, it looks for libraries in RPATH / LD_LIBRARY_PATH and standard locations. Does this make sense to you?
I still fail to see why we're discussing libffi specifically here...
Actually, I'm not sure about that either :-) Maybe the machines provided by Heroku already have all other libraries that the binaries of PyPy that you provide via the buildbot are dynamically linked against, and so libffi is the only problematic one... -- Sincerely yours, Yury V. Zaytsev