beeware / Python-Apple-support

A meta-package for building a version of Python that can be embedded into a macOS, iOS, tvOS or watchOS project.
MIT License
1.1k stars 159 forks source link

Unable to run Makefile correctly on macOS x86 #144

Closed riccardodivirgilio closed 2 years ago

riccardodivirgilio commented 2 years ago

Describe the bug I'm trying to run make over python3.10 using my intel MacBook. https://github.com/beeware/Python-Apple-support/tree/3.10

After running make in the same folder, the stdout ends with this:

# Configure target Python
cd build/macOS/Python-3.10.0-macOS && MACOSX_DEPLOYMENT_TARGET=10.8 ./configure --prefix=/Users/rdv/Downloads/Python-Apple-support-3.10/build/macOS/Python-3.10.0-macOS/dist --without-doc-strings --enable-ipv6 --without-ensurepip --enable-universalsdk --with-universal-archs=universal2 
checking build system type... x86_64-apple-darwin21.4.0
checking host system type... x86_64-apple-darwin21.4.0
checking for python3.10... no
checking for python3... python3
checking for --enable-universalsdk... /
checking for --with-universal-archs... universal2
checking MACHDEP... "darwin"
checking for gcc... gcc
checking whether the C compiler works... yes
checking for C compiler default output file name... a.out
checking for suffix of executables... 
checking whether we are cross compiling... no
checking for suffix of object files... o
checking whether we are using the GNU C compiler... yes
checking whether gcc accepts -g... yes
checking for gcc option to accept ISO C89... none needed
checking how to run the C preprocessor... gcc -E
checking for grep that handles long lines and -e... /usr/bin/grep
checking for a sed that does not truncate output... /usr/bin/sed
checking for --with-cxx-main=<compiler>... no
checking for g++... no
configure:

  By default, distutils will build C++ extension modules with "g++".
  If this is not intended, then set CXX on the configure command line.

checking for the platform triplet based on compiler characteristics... darwin
configure: error: internal configure error for the platform triplet, please file a bug report
make: *** [build/macOS/Python-3.10.0-macOS/Makefile] Error 1

The output says to open a bug report. Any insight why this is happening?

Environment: MacBook Pro (16-inch, 2019), 2,3 GHz 8-Core Intel Core i9, 32 GB 2667 MHz DDR4, Intel UHD Graphics 630 1536 MB macOS Monterey 12.3.1 (21E258)

freakboy3742 commented 2 years ago

I've seen this error myself; The underlying problem is that Xcode 13.3 made a change that destroyed the ability to compile Python. This has been fixed in the Python sources, but it means we need to make a parallel change in the build scripts for this support package.

The additional complication is that we also have a high priority need to fix #131 and #133, and the fixes for all three bugs are somewhat intertwined (I saw this bug in the process of fixing #131 and #133, which is why I didn't report it separately).

The good news is that I am working of a fix, and I hope to have something in the next few days. The bad news is that it will also require some structural changes to your Xcode project; fixing #133 requires also addressing #120.

riccardodivirgilio commented 2 years ago

To be fair this is only happening on my intel development machine. I have been running the same script on an ARM Mac mini and it works fine but it was using macOS 12.0.1 (with probably an older Xcode).

Currently I am not planning to use python in an Xcode project, I'm just trying to produce a python distribution that can be embedded in a client machine. I think it would be useful in general to be able to simply download python in a folder and start running scripts and start webservers/interfaces directly on a client machine, like you can currently do with the Windows Embeddable Package, without the need to use Xcode for it.

https://www.python.org/downloads/windows/

Thank you so much for the help, and feel free to close this issue if you think it's already tracked elsewhere.