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.

classification
Title: setup.py/configure
Type: behavior Stage:
Components: Build, macOS Versions: Python 3.2
process
Status: closed Resolution: fixed
Dependencies: Superseder:
Assigned To: ronaldoussoren Nosy List: ned.deily, r.david.murray, ronaldoussoren, sdaoden
Priority: normal Keywords: patch

Created on 2011-01-28 14:26 by sdaoden, last changed 2022-04-11 14:57 by admin. This issue is now closed.

Files
File name Uploaded Description Edit
setup.3.patch sdaoden, 2011-01-29 10:45
Messages (10)
msg127304 - (view) Author: Steffen Daode Nurpmeso (sdaoden) Date: 2011-01-28 14:26
I always hated GNU Autoconf and M4.
After cloning branches/py3k today i needed two and a half hour to build and compile a Python which includes the readline module.
I'll attach a primitive setup.py patch which should better not make it into a release version ...

Some more notes on the compilation:
Snow Leopard here has SDK's 10.5 and 10.6.
I did not understand what was going on, configure does everything to explain me it is using (nonexistent) 10.4.
The configure script is
    checking for OSX 10.5 SDK or later... yes
but that doesn't seem to matter.  I gave up on hacking (the anyway generated) configure (around line 5532), no matter what i do, i still get
    CONFIGURE_MACOSX_DEPLOYMENT_TARGET='10.4'
Damn!
Ooh, Ooh, how nice are plain Makefiles and small-team projects.
msg127308 - (view) Author: R. David Murray (r.david.murray) * (Python committer) Date: 2011-01-28 14:57
The OSX build process is...hairy.  Windows likewise (because you have to use MS tools).  Elsewhere, it is pretty straightforward :)

The 10.4 deployment target is the one we want.  You can build for a 10.4 deployment target even if you are using a later SDK (IIUC).  More that that I don't know, but I'm adding our Mac experts to the nosy list in case there is something here that's useful, and so they can correct me if I'm wrong :)

There should probably be more notes about this in the Mac/README.
msg127312 - (view) Author: Steffen Daode Nurpmeso (sdaoden) Date: 2011-01-28 15:09
Ok, thanks.  Mac/README is not for me, though, i'm only a simple Ex-FreeBSD user which buyed good hardware with the wrong operating system.  All these mysterious frameworks and AvailabilityMacros.h really make you weird  ;-)  There are indeed frameworks (AU - speak this as if it hurts!) which tell you something in an event handler and after that returns they will have forgotten it.  Etc.  Nope, i'm doing the UNIX thing.

But it's worse now, because after i've only using
    ./configure --prefix=$HOME/usr --with-suffix=no
(without --pydebug, that was an error of mine) i can't compile it no more at all, because of:
   Failed to build these modules:
   _multiprocessing
And now i would *really* appreciate any help i can get.
(Thank all of you right now, i'm offline for next hours...)
msg127314 - (view) Author: Ronald Oussoren (ronaldoussoren) * (Python committer) Date: 2011-01-28 16:28
Use:

configure ...[other args]... MACOSX_DEPLOYMENT_TARGET=10.5

(or 10.6 when you're on a 10.6 system)

This will build using the deployment target you mention, and will automaticly include the readline module using Apple's compatiblity wrapper around libedit.  To use GNU's readline you have to install that first and arrange for that to be on the search path (for example by installing into /usr/local).

BTW. Mac/README is for you, you are on OSX after all and that file explains a lot of the mac-specific issues w.r.t. building.  

Feel free to suggest additions to that file, I'm way to much at home on OSX and with the build process to truly know what a new user on OSX would like to see mentioned in that file.
msg127334 - (view) Author: Steffen Daode Nurpmeso (sdaoden) Date: 2011-01-28 20:06
Thank you, RO, exactly that very line would be great as an add-on for the mentioned file - and (better: but - i'm lazy) it would be even better if that hint would appear somewhere in 'configure --help'!  That would make the apple glow.
(In the meanwhile i've compiled Py3K without --pydebug - possibly the '10.6' -> '10.5' hack did it, or i've forgotten a 'make distclean' in the hurry this afternoon; i will definitely remember 'MACOSX_DEPLOYMENT_TARGET=10.5', though!)

After having the time to look back and think a second time about the patch which helped me out this morning, i've rewritten it in a more generic form.
All lines which i would *definitely* change before a merge have been marked with 'STEFFEN HACK', but i think 'does_library_chainload_library()' may be worth throwing an eye on it.
It's a bit of a hack, but it also encapsulates some difficulties of using different tools on different UNIX platforms.
msg127398 - (view) Author: Steffen Daode Nurpmeso (sdaoden) Date: 2011-01-29 10:45
Let me summarize this thread:
- For darwin/MacOS X there exists an undocumented MACOSX_DEPLOYMENT_TARGET switch, which makes its way all through the build-system and the 'sysconfig' module.  Even though 'configure' auto-detects
    checking for OSX 10.5 SDK or later... yes
  it does not seem to take care about that.
  I thus request a (documented) --with-macosx-target[=10.5] 'configure' switch.
  GNU Autoconf is evil!  I cannot provide a patch for that.
- I've attached a patch (setup.3.patch is now the final version, which adds a 'does_library_chainload_library()' function to setup.py.  This one encapsulates the complexity of using different tools on different UNIX platforms and thus moves that out of the widespreaded code.  Due to this i'll think it should be merged into Py3K.
  However: it still contains lines 'sdaoden hack', which i need to get MacOS X running, and which need the eyes of RO or another MacOS X guru!
- Besides all that i think this issue thread can be closed.
msg127984 - (view) Author: Steffen Daode Nurpmeso (sdaoden) Date: 2011-02-05 12:36
ronaldoussoren: thanks for the MACOSX_DEPLOYMENT_TARGET=10.5 hint!!  I did Py3K yesterday, and it was a matter of 'configure --prefix=x YZ && make && make install' as if it were a real UNIX!

I *really* think there should be a configure command line option for this thing - i would *not* have found that out on my own!

And of course the problem with libedit is it's ignorance for a long-time-grown multi-UNIX multi-term '.inputrc'.
msg131463 - (view) Author: Ronald Oussoren (ronaldoussoren) * (Python committer) Date: 2011-03-19 23:09
I've filed Issue11485 for the SDK issue (the default SDK should be more sane for normal use). 

AFAIK that means it is not necessary to keep this issue open.
msg131653 - (view) Author: Steffen Daode Nurpmeso (sdaoden) Date: 2011-03-21 13:53
On Sat, Mar 19, 2011 at 11:09:27PM +0000, Ronald Oussoren wrote:
> AFAIK that means it is not necessary to keep this issue open.

Yeah, all-automatic is even better than yet another command line
option, i think - great!
(Let's get completely rid of it.)
msg131654 - (view) Author: Steffen Daode Nurpmeso (sdaoden) Date: 2011-03-21 13:59
(P.S.: sorry all of you, have had no contact to roundup
and thus [k=v] Subject: interpretation until 30 minutes ago.)
History
Date User Action Args
2022-04-11 14:57:12adminsetgithub: 55255
2011-03-21 13:59:04sdaodensetresolution: later -> fixed
messages: + msg131654
nosy: ronaldoussoren, ned.deily, r.david.murray, sdaoden
2011-03-21 13:53:49sdaodensetnosy: ronaldoussoren, ned.deily, r.david.murray, sdaoden
messages: + msg131653
title: setup.py/configure [darwin] -> setup.py/configure
2011-03-21 13:50:54sdaodensetstatus: pending -> closed
nosy: ronaldoussoren, ned.deily, r.david.murray, sdaoden
2011-03-19 23:09:24ronaldoussorensetstatus: open -> pending

messages: + msg131463
resolution: later
nosy: ronaldoussoren, ned.deily, r.david.murray, sdaoden
2011-02-05 12:36:34sdaodensetnosy: ronaldoussoren, ned.deily, r.david.murray, sdaoden
messages: + msg127984
2011-01-29 10:47:07sdaodensetfiles: - DIFF
nosy: ronaldoussoren, ned.deily, r.david.murray, sdaoden
2011-01-29 10:47:02sdaodensetfiles: - DIFF
nosy: ronaldoussoren, ned.deily, r.david.murray, sdaoden
2011-01-29 10:45:01sdaodensetfiles: + setup.3.patch
title: darwin/MacOS X setup.py hack -> setup.py/configure [darwin]
nosy: ronaldoussoren, ned.deily, r.david.murray, sdaoden
messages: + msg127398

keywords: + patch
type: behavior
2011-01-28 20:06:34sdaodensetfiles: + DIFF
nosy: ronaldoussoren, ned.deily, r.david.murray, sdaoden
messages: + msg127334
2011-01-28 16:28:45ronaldoussorensetnosy: ronaldoussoren, ned.deily, r.david.murray, sdaoden
messages: + msg127314
2011-01-28 15:09:22sdaodensetnosy: ronaldoussoren, ned.deily, r.david.murray, sdaoden
messages: + msg127312
2011-01-28 14:57:42r.david.murraysetnosy: + ronaldoussoren, r.david.murray, ned.deily
messages: + msg127308

assignee: ronaldoussoren
components: + macOS
2011-01-28 14:26:22sdaodencreate