Building dtrace-enabled python from sources on Mac OS X

One highlight of Mac OS X Tiger is dtrace. Providers for ruby and python are also available, but only with the “system” interpreters (the one included out of the box). If you install python from http://www.python.org, you can’t use dtrace anymore. Since the code to make dtrace enable python is available on the open source corner of Apple, I thought it would be easy to apply it to pristine sources available on python.org.

Unfortunately, for some strange reasons, Apple only provides changes in the form of ed scripts applied through a Makefile; the changes are not feature specific, you just have a bunch of files for each modified file: dtrace, Apple-specific changes are all put together. I managed to extract the dtrace part of this mess, so that I can apply only dtrace related changes. The goal is to have a python as close as possible to the official binary available on python.org. The patch can be found there.

How to use ?

  • Untar the python 2.5.2 tarball
  • Apply the patch
  • Regenerate the configure scripts by running autoconf
  • configure as usual, with the additional option –enable-dtrace  (the configuration is buggy, and will fail if you don’t enable dtrace, unfortunately)
  • build python (make, make install).
It time permits, I will post a .dmg. Needless to say, you run this at your own risk.
About these ads

3 responses to “Building dtrace-enabled python from sources on Mac OS X

  1. Getting this included in upstream distribution would be nice too. Thanks for your work.

  2. cournape

    It would be nice for sure, but I cannot take responsibility for this code; Apple are the one who should do this.

    To be included, it would have to be implemented by someone who knows about dtrace internals, and the patch would have to be cleaned up (it does not work when –enable-dtrace is not set up, for example).

  3. Pingback: A python 2.5.2 binary for Mac OS X with dtrace enabled « Nothing to say

Leave a Reply

Fill in your details below or click an icon to log in:

WordPress.com Logo

You are commenting using your WordPress.com account. Log Out / Change )

Twitter picture

You are commenting using your Twitter account. Log Out / Change )

Facebook photo

You are commenting using your Facebook account. Log Out / Change )

Google+ photo

You are commenting using your Google+ account. Log Out / Change )

Connecting to %s

September 2008
M T W T F S S
« Aug   Oct »
1234567
891011121314
15161718192021
22232425262728
2930  

Enter your email address to subscribe to this blog and receive notifications of new posts by email.

Join 11 other followers

Follow

Get every new post delivered to your Inbox.

%d bloggers like this: