[Patches] [ python-Patches-1569798 ] Fix building the source within exec_prefix

SourceForge.net noreply at sourceforge.net
Tue Oct 3 10:24:36 CEST 2006


Patches item #1569798, was opened at 2006-10-03 10:24
Message generated for change (Tracker Item Submitted) made by Item Submitter
You can respond by visiting: 
https://sourceforge.net/tracker/?func=detail&atid=305470&aid=1569798&group_id=5470

Please note that this message will contain a full copy of the comment thread,
including the initial issue submission, for this request,
not just the latest update.
Category: Build
Group: Python 2.4
Status: Open
Resolution: None
Priority: 5
Submitted By: Matthias Klose (doko)
Assigned to: Nobody/Anonymous (nobody)
Summary: Fix building the source within exec_prefix

Initial Comment:
[forwarded from http://bugs.debian.org/385336]

when built under a subdirectory of exec_prefix, the
build fails building the extensions.

bug submitter writes:

OK, after a debugging session, I found out why.  It
seems to be an
upstream bug in distutils.  See
python2.5-2.5~c1/Lib/distutils/command/build_ext.py
line 188+:

  if string.find(sys.executable, sys.exec_prefix) != -1:
      # building third party extensions
      self.library_dirs.append(os.path.join(sys.prefix,
"lib",
                                            "python" +
  get_python_version(),
                                            "config"))
  else:
      # building python standard extensions
      self.library_dirs.append('.')

This code is executed only in the shared build.  The if
clause is here
to determine whether we're running a correctly
installed python or
whether we're running python from its source tree.  In
our case (since
we're building python itself atm), the condition *must*
evaluate to
false.  However, this exact check looks very clumsy.

On my build system, sys.executable ==
'/usr/src/debian/build/python2.5-2.5~c1/build-shared/python',
sys.exec_prefix == '/usr', i.e. the condition is true
and distutils
thinks it's running on an already installed python
distribution.  The
reason is that I'm building below the 'install prefix'
directory (in
/usr/src/...).

In contrast, on the Debian buildd machines, this is
performed in
/build/buildd/.... which does not trigger the distutils
bug.


----------------------------------------------------------------------

You can respond by visiting: 
https://sourceforge.net/tracker/?func=detail&atid=305470&aid=1569798&group_id=5470


More information about the Patches mailing list