classification
Title: distutils should respect the LIBS configure env var
Type: behavior Stage: patch review
Components: Distutils Versions: Python 3.5
process
Status: open Resolution:
Dependencies: Superseder:
Assigned To: eric.araujo Nosy List: Arfrever, alexis, collinwinter, eric.araujo, jyasskin, rpetrov, tarek
Priority: normal Keywords: needs review, patch

Created on 2009-03-26 19:16 by collinwinter, last changed 2014-03-13 20:10 by eric.araujo.

Files
File name Uploaded Description Edit
distutils_libs.patch collinwinter, 2009-03-26 19:16 review
Messages (14)
msg84199 - (view) Author: Collin Winter (collinwinter) * (Python committer) Date: 2009-03-26 19:16
If you pass LIBS to ./configure (as in "LIBS=-lgcov ./configure"),
distutils ignores this when building extension modules, which breaks
when using certain gcc options which require certain libraries (I'm
thinking of -fprofile-generate). The attached patch remedies this.
msg84213 - (view) Author: Roumen Petrov (rpetrov) * Date: 2009-03-26 20:34
issue 5060 address this
msg84214 - (view) Author: Collin Winter (collinwinter) * (Python committer) Date: 2009-03-26 20:39
The patch attached to issue 5060 seems very tightly focused on a problem
with gcc FDO. This is a more general patch that solves the problem of
distutils ignoring LIBS.
msg84215 - (view) Author: Roumen Petrov (rpetrov) * Date: 2009-03-26 20:49
The LIBS contain all module dependent libraries, libpython is linked
with LIBS, modules are linked with libpython.
May be I miss something but I could not found why distutils has to use
LIBS to link a module.
msg87128 - (view) Author: Tarek Ziadé (tarek) * (Python committer) Date: 2009-05-04 14:07
> May be I miss something but I could not found why distutils 
> has to use LIBS to link a module.

It doesn't right now, but depending on the extension you want to build,
you might want to configure it and make sure it is passed to the compiler.

About the patch:

is there a particular reason why you have changed the call to
'set_library' into calls to 'add_library' in build_ext in your patch ?
msg87143 - (view) Author: Collin Winter (collinwinter) * (Python committer) Date: 2009-05-04 17:47
2009/5/4  <"Tarek Ziadé <report@bugs.python.org>"@psf.upfronthosting.co.za>:
> About the patch:
>
> is there a particular reason why you have changed the call to
> 'set_library' into calls to 'add_library' in build_ext in your patch ?

Yes. It seems like the proper thing to do is to merge the global LIBS
and the module-specific libraries (via add_library()), rather than
having one override the other (set_library()).
msg138448 - (view) Author: Éric Araujo (eric.araujo) * (Python committer) Date: 2011-06-16 15:13
Reclassifying as a feature request for the packaging module.  The distutils docs don’t say using LIBS is supported and there aren’t many people asking for it on this bug report.
msg138460 - (view) Author: Collin Winter (collinwinter) * (Python committer) Date: 2011-06-16 16:29
This wasn't so much a feature request as a request for review. I had already implemented the necessary changes and provided a patch.

We found this change necessary when working on Unladen Swallow.
msg138528 - (view) Author: Éric Araujo (eric.araujo) * (Python committer) Date: 2011-06-17 17:34
> This wasn't so much a feature request as a request for review.
From a tracker process viewpoint, any report is a bug, a feature request or a doc bug.  A bug can be defined as a discrepancy between the doc and the code.  Given that I found no mention of LIBS support in distutils, I tentatively took the conservative way and judged this a new feature.  However..

> We found this change necessary when working on Unladen Swallow.
This may change the situation.  Why was it necessary?  Would other projects need it?  Is it a standard in other build tools that’s an obvious oversight in distutils?
msg138535 - (view) Author: Collin Winter (collinwinter) * (Python committer) Date: 2011-06-17 17:47
I have provided justification in the original patch submission. Without this patch, we were unable to cleanly apply gcc's feedback-directed optimization system to Python. FDO yields significant performance improvements.
msg138916 - (view) Author: Éric Araujo (eric.araujo) * (Python committer) Date: 2011-06-24 11:35
I’m afraid performance improvements are not bug fixes, which are the only possible changes in distutils now.  This change is however appreciated for packaging.
msg138958 - (view) Author: Collin Winter (collinwinter) * (Python committer) Date: 2011-06-24 16:18
I have no interest in forward-porting the patch, closing accordingly. At least there will be a record of this patch for anyone interested in getting a free 10% performance boost for their Python 2.x or 3.[012] systems.
msg139112 - (view) Author: Éric Araujo (eric.araujo) * (Python committer) Date: 2011-06-25 20:02
The distutils feature freeze doesn’t let us accept this patch, but there is definite value for packaging, so I will port it.  Thanks for the original patch!
msg139119 - (view) Author: Roumen Petrov (rpetrov) * Date: 2011-06-25 20:59
Collin, I'm sure that you could use LDFLAGS instead LIBS to boost python. If I remember well this require set_executables to be commented in setup.py.
History
Date User Action Args
2014-03-13 20:10:34eric.araujosettitle: packaging should respect the LIBS configure env var -> distutils should respect the LIBS configure env var
components: + Distutils, - Distutils2
versions: + Python 3.5, - Python 3.3
2011-06-25 20:59:39rpetrovsetmessages: + msg139119
2011-06-25 20:20:01Arfreversetnosy: + Arfrever
2011-06-25 20:02:22eric.araujosetstatus: closed -> open
resolution: wont fix ->
messages: + msg139112

title: distutils ignores the LIBS configure env var -> packaging should respect the LIBS configure env var
2011-06-24 16:18:35collinwintersetstatus: open -> closed
assignee: tarek -> eric.araujo
resolution: wont fix
messages: + msg138958
2011-06-24 11:35:32eric.araujosetmessages: + msg138916
2011-06-17 17:47:05collinwintersetmessages: + msg138535
2011-06-17 17:34:21eric.araujosetmessages: + msg138528
2011-06-16 16:29:50collinwintersetmessages: + msg138460
2011-06-16 15:13:58eric.araujosetversions: + Python 3.3, - Python 3.1, Python 2.7, Python 3.2
nosy: + eric.araujo, alexis

messages: + msg138448

components: + Distutils2, - Distutils
2010-07-21 02:42:34BreamoreBoysetkeywords: patch, patch, needs review
versions: + Python 3.2
2009-05-04 17:47:13collinwintersetmessages: + msg87143
2009-05-04 14:07:56tareksetkeywords: patch, patch, needs review

messages: + msg87128
versions: + Python 3.1
2009-03-26 20:49:56rpetrovsetmessages: + msg84215
2009-03-26 20:39:35collinwintersetkeywords: patch, patch, needs review

messages: + msg84214
2009-03-26 20:34:26rpetrovsetnosy: + rpetrov
messages: + msg84213
2009-03-26 19:16:51collinwintercreate