|
|
Chromium Code Reviews
DescriptionFix library link option generation on Linux.
On Linux the distutil returns only the name of the python library.
Passing only the library name is not good for a compiler (in this case
it was a simple 'python2.7'), the script should return the correct
compiler option (which should be the '-lpython2.7')
BUG=408979
TEST=ninja -C out/Release libmojo_python_system.so
Committed: https://crrev.com/baa762fca6052320388d85932712f9d9b6eb5f47
Cr-Commit-Position: refs/heads/master@{#292654}
Patch Set 1 #
Total comments: 2
Patch Set 2 : Updated patch #
Total comments: 1
Patch Set 3 : Patch update #2 #
Total comments: 1
Patch Set 4 : patch update #3 #Messages
Total messages: 19 (0 generated)
pgal.u-szeged@partner.samsung.com changed reviewers: + pkl@google.com, qsr@chromium.org
The CL which added this file: https://codereview.chromium.org/377293002/
LGTM with nit https://codereview.chromium.org/521653002/diff/1/third_party/cython/python_fl... File third_party/cython/python_flags.py (right): https://codereview.chromium.org/521653002/diff/1/third_party/cython/python_fl... third_party/cython/python_flags.py:40: libraries = [ '-l%s' % library for library in libraries ] This would apply to darwin too.
https://codereview.chromium.org/521653002/diff/1/third_party/cython/python_fl... File third_party/cython/python_flags.py (right): https://codereview.chromium.org/521653002/diff/1/third_party/cython/python_fl... third_party/cython/python_flags.py:40: libraries = [ '-l%s' % library for library in libraries ] On 2014/08/29 14:24:33, qsr wrote: > This would apply to darwin too. So If I use the same code for darwin it would be ok? That was my first guess, but I didn't wanted to break anything existing.
On 2014/08/29 14:40:57, elecro wrote: > https://codereview.chromium.org/521653002/diff/1/third_party/cython/python_fl... > File third_party/cython/python_flags.py (right): > > https://codereview.chromium.org/521653002/diff/1/third_party/cython/python_fl... > third_party/cython/python_flags.py:40: libraries = [ '-l%s' % library for > library in libraries ] > On 2014/08/29 14:24:33, qsr wrote: > > This would apply to darwin too. > > So If I use the same code for darwin it would be ok? That was my first guess, > but I didn't wanted to break anything existing. Sorry I was not clear. You need to filter libraries for darwin and linux the way you did, then for darwin you need to add the -lpython. BTW, I'm surprised you have an issue, given that the bot do not -> you change is correct, but the thing is I never saw any distutils returning any library on linux.
On 2014/08/29 14:45:46, qsr wrote: > [snip] > Sorry I was not clear. You need to filter libraries for darwin and linux the > way you did, then for darwin you need to add the -lpython. > > BTW, I'm surprised you have an issue, given that the bot do not -> you change > is correct, but the thing is I never saw any distutils returning any library on > linux. I've just tested the get_libraries call on a Mac, which for me did not returned anything. By any chance do you remember what you got on Mac? (On my Linux system what I got is "python2.7")
On 2014/08/29 14:55:00, elecro wrote: > On 2014/08/29 14:45:46, qsr wrote: > > [snip] > > Sorry I was not clear. You need to filter libraries for darwin and linux the > > way you did, then for darwin you need to add the -lpython. > > > > BTW, I'm surprised you have an issue, given that the bot do not -> you change > > is correct, but the thing is I never saw any distutils returning any library > on > > linux. > > I've just tested the get_libraries call on a Mac, which for me did not returned > anything. > By any chance do you remember what you got on Mac? > (On my Linux system what I got is "python2.7") I get nothing, that's why I needed to add python2.7 by hand. (I get nothing on linux too). But if someone gets something (as you seem to do for linux), we need the -l. So we need the same change on darwin.
patch updated
https://codereview.chromium.org/521653002/diff/20001/third_party/cython/pytho... File third_party/cython/python_flags.py (right): https://codereview.chromium.org/521653002/diff/20001/third_party/cython/pytho... third_party/cython/python_flags.py:43: libraries.add('-lpython%s' % sys.version[:3]) This last line should only happen on mac. On linux, I never needed to add the python library myself.
Okay, patch updated again.
https://codereview.chromium.org/521653002/diff/40001/third_party/cython/pytho... File third_party/cython/python_flags.py (right): https://codereview.chromium.org/521653002/diff/40001/third_party/cython/pytho... third_party/cython/python_flags.py:40: libraries = set(['-l%s' % library for library in libraries]) Order of the libraries on a command line may matter. You cannot use a set here.
On 2014/08/29 15:25:34, qsr wrote: > https://codereview.chromium.org/521653002/diff/40001/third_party/cython/pytho... > File third_party/cython/python_flags.py (right): > > https://codereview.chromium.org/521653002/diff/40001/third_party/cython/pytho... > third_party/cython/python_flags.py:40: libraries = set(['-l%s' % library for > library in libraries]) > Order of the libraries on a command line may matter. You cannot use a set here. Ouch... yeah, that's true. Will fix this in a sec :)
lgtm
Thanks.
The CQ bit was checked by pgal.u-szeged@partner.samsung.com
CQ is trying da patch. Follow status at https://chromium-status.appspot.com/cq/pgal.u-szeged@partner.samsung.com/5216...
FYI, CQ is re-trying this CL (attempt #1). The failing builders are: ios_dbg_simulator on tryserver.chromium.mac (http://build.chromium.org/p/tryserver.chromium.mac/builders/ios_dbg_simulator...)
Message was sent while issue was closed.
Committed patchset #4 (id:60001) as 133a7f0a6295a78717d1fdc683641c2a489f9a27
Message was sent while issue was closed.
Patchset 4 (id:??) landed as https://crrev.com/baa762fca6052320388d85932712f9d9b6eb5f47 Cr-Commit-Position: refs/heads/master@{#292654} |
