GNOME Bugzilla – Bug 742486
Don't bootstrap python on osx
Last modified: 2021-05-17 16:01:15 UTC
Created attachment 293986 [details] [review] Don't bootstrap python on osx OSX has shipped with python 2.7 for multiple releases now so there is little value in building it.
Review of attachment 293986 [details] [review]: Being able to drop this dependency would be awesome, but we're going to need to try harder. As you mentioned on IRC, doing this requires setting the PKG_CONFIG_PATH to the framework directory. I don't consider that to be acceptable. One idea is that we could add a <framework/> tag to system modules. We would probably want to wrap that in <if condition-set="macos">...</if>. In case this is specified we could look in the system framework directories and expand the PKG_CONFIG_PATH (and maybe also C_INCLUDE_PATH and so on) of any module that directly depends on that system module. We would also use it to tweak the scanning during the sysdeps process. For the libxml issue, I think we want to solve the problem that you're hitting upstream. Packages should simply never try to install anything outside of --prefix, period. We shouldn't have to use ./configure arguments to hack the package into behaving properly.
If you're going to rely on pkg-config to detect the availability of python you're going to have to install a fake python.pc. The framework build of Python doesn't generate one, so you won't find it in either /System/Library nor in the SDK. Better to use python2.7-config, which works on all platforms. Whatever you do, make sure that it works correctly when building against an SDK; the compiler and linker are told about that with the -isysroot flag. FWIW the first version of OSX with Python 2.7 was Lion.
>The framework build of Python doesn't generate one, so you won't find it >in either /System/Library nor in the SDK. On 10.10 at least it does exist in /System/Library/Frameworks/Python.framework/Versions/2.7/lib/pkgconfig for me. >For the libxml issue, I think we want to solve the problem that you're hitting upstream. They clearly knew it was a problem as their hacky work around was add --with-python-install-dir in the last minor release.
Oh also the current module for python fails to build for me on 10.10 with a lot of errors such as: clang -L/Users/tingping/jhbuild/install/lib -u _PyMac_Error -o python.exe \ Modules/python.o \ -L. -lpython2.7 -ldl -framework CoreFoundation building dbm using ndbm Undefined symbols for architecture x86_64: "_PyArg_UnpackTuple", referenced from: _unpack in _struct.o "_PyBool_FromLong", referenced from: _bu_bool in _struct.o _nu_bool in _struct.o
(In reply to comment #3) > >The framework build of Python doesn't generate one, so you won't find it > >in either /System/Library nor in the SDK. > > On 10.10 at least it does exist in > /System/Library/Frameworks/Python.framework/Versions/2.7/lib/pkgconfig for me. > Hmph. So it does, I wonder what I told `find` wrong. I still don't find it in the SDK, which is what you want to build against if you're going to distribute a binary. > >For the libxml issue, I think we want to solve the problem that you're hitting > upstream. > > They clearly knew it was a problem as their hacky work around was add > --with-python-install-dir in the last minor release. The commit message says that that's not what they had in mind, and claims that it will have no effect except when cross-compiling. I've no doubt that you tested it and found otherwise.
-- GitLab Migration Automatic Message -- This bug has been migrated to GNOME's GitLab instance and has been closed from further activity. You can subscribe and participate further through the new bug through this link to our GitLab instance: https://gitlab.gnome.org/GNOME/jhbuild/-/issues/210.