This issue tracker has been migrated to GitHub, and is currently read-only.
For more information, see the GitHub FAQs in the Python's Developer Guide.

Author sandipshah
Recipients ned.deily, ronaldoussoren, sandipshah
Date 2022-01-04.19:51:00
SpamBayes Score -1.0
Marked as misclassified Yes
Message-id <CAGzRd=re92+4VgFEvbBadU56CYwvVpbNPEwpOqnKjFyfj3rpZA@mail.gmail.com>
In-reply-to <1641306605.67.0.948139900507.issue46248@roundup.psfhosted.org>
Content
Hi,

Like I mentioned in the ticket, I am trying to compile libplist,
libimobiledevice , and libimobiledevice-glue-1.0 on my mac.  These are
needed to do any development on a mobile device (specifically for testing /
automation).  I use Python for a lot of developmental work, and hence would
rather stick to the same framework to work on mobile devices too.

https://github.com/libimobiledevice

The project is not to "embed" Python, but to link to it, so that it can be
used for testing the app on the mobile (the tools rely on Cython).

The three tools have their own "autogen.sh" which fails with the error
mentioned in the ticket.

While researching, I had found this solution on stackexchange -
https://stackoverflow.com/questions/6490513/vim-failing-to-compile-with-python-on-os-x

Which led me to this after looking more in the python distribution files:

---
In file
/Library/Frameworks/Python.framework/Versions/3.10/lib/python3.10/sysconfig.py
On line 410 - fn _generate_posix_vars

439-448
# There's a chicken-and-egg situation on OS X with regards to the
# _sysconfigdata module after the changes introduced by #15298:
# get_config_vars() is called by get_platform() as part of the
# `make pybuilddir.txt` target -- which is a precursor to the
# _sysconfigdata.py module being constructed.  Unfortunately,
# get_config_vars() eventually calls _init_posix(), which attempts
# to import _sysconfigdata, which we won't have built yet.  In order
# for _init_posix() to work, if we're on Darwin, just mock up the
# _sysconfigdata module manually and populate it with the build vars.
# This is more than sufficient for ensuring the subsequent call to
---

Let me know if you need any other information.

Thanks,

Sandip

On Tue, Jan 4, 2022 at 6:30 AM Ronald Oussoren <report@bugs.python.org>
wrote:

>
> Ronald Oussoren <ronaldoussoren@mac.com> added the comment:
>
> Part of the problem here is that most keys in the result of
> sysconfig.get_config_vars() are copied as-is from the CPython Makefile and
> pyconfig.h header file.
>
> The keys copied from the Makefile are in a lot of cases not useful for
> users of python because they contain values that are only useful while
> building CPython itself.
>
> Without knowing your use case it is hard to point you to a better
> solution, but as Ned writes in general just follow the instructions from
> the extending and embedding documentation.
>
> ----------
>
> _______________________________________
> Python tracker <report@bugs.python.org>
> <https://bugs.python.org/issue46248>
> _______________________________________
>
History
Date User Action Args
2022-01-04 19:51:00sandipshahsetrecipients: + sandipshah, ronaldoussoren, ned.deily
2022-01-04 19:51:00sandipshahlinkissue46248 messages
2022-01-04 19:51:00sandipshahcreate