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 LDFLAGS regexp is wrong
Type: Stage:
Components: Build Versions: Python 2.5
process
Status: closed Resolution: out of date
Dependencies: Superseder:
Assigned To: Nosy List: Chipaca, cgaspar, facundobatista
Priority: high Keywords: easy

Created on 2007-03-07 08:45 by cgaspar, last changed 2022-04-11 14:56 by admin. This issue is now closed.

Messages (5)
msg31458 - (view) Author: Carson Gaspar (cgaspar) Date: 2007-03-07 08:45
Python 2.5

setup.py mangles LDFLAGS and CPPFLAGS via:

env_val = re.sub(r'(^|\s+)-(-|(?!%s))' % arg_name[1], '', env_val)

This causes '-L/path/to/foo -R/path/to/bar' to become '-L/path/to/fooR/path/to/bar', which obviously doesn't work. The fix is simple - eat non-whitespace after the unrecognized option:

env_val = re.sub(r'(^|\s+)-(-|(?!%s))\S+' % arg_name[1], '', env_val)

msg31459 - (view) Author: Carson Gaspar (cgaspar) Date: 2007-03-07 08:48
Or I could get the regexp correct and eat _option_ non-whitespace...

env_val = re.sub(r'(^|\s+)-(-|(?!%s))\S*' % arg_name[1], '', env_val)
msg60177 - (view) Author: John Rowland Lenton (Chipaca) * Date: 2008-01-19 14:46
This was fixed in r57389 by georg.brandl by changing the replacement
string '' to ' ' (turning the option into a non-option).

Steps to reproduce this on Ubuntu Feisty, before that revision, were:
$ mkdir banana
$ sudo mv /usr/include/sqlite3.h banana/
$ make clean && ./configure && make
[...]
 Failed to find the necessary bits to build these modules:
_sqlite3          bsddb185          sunaudiodev    
[...]
$ make clean && CPPFLAGS=-Ibanana ./configure && make
Failed to find the necessary bits to build these modules:
bsddb185          sunaudiodev                      
$ make clean && CPPFLAGS=-Ibanana\ -Rmango ./configure && make
 Failed to find the necessary bits to build these modules:
_sqlite3          bsddb185          sunaudiodev
msg60184 - (view) Author: Facundo Batista (facundobatista) * (Python committer) Date: 2008-01-19 15:32
Yes, not it works ok!

Thanks John for the testing example, and Carson for the report.
msg60185 - (view) Author: Facundo Batista (facundobatista) * (Python committer) Date: 2008-01-19 15:34
Bloody fingers. I meant that *now" it works ok.
History
Date User Action Args
2022-04-11 14:56:23adminsetgithub: 44676
2008-01-19 15:34:10facundobatistasetmessages: + msg60185
2008-01-19 15:32:24facundobatistasetstatus: open -> closed
resolution: out of date
messages: + msg60184
nosy: + facundobatista
2008-01-19 14:46:04Chipacasetnosy: + Chipaca
messages: + msg60177
2008-01-12 00:57:34akuchlingsetkeywords: + easy
2007-03-07 08:45:06cgasparcreate