Skip to content
This repository has been archived by the owner on Jul 4, 2023. It is now read-only.

Add --with-brewed-python option to MacVim / Vim #17896

Closed
xgalaxy opened this issue Feb 17, 2013 · 5 comments
Closed

Add --with-brewed-python option to MacVim / Vim #17896

xgalaxy opened this issue Feb 17, 2013 · 5 comments

Comments

@xgalaxy
Copy link

xgalaxy commented Feb 17, 2013

Hello,

I would like an optional flag to be added to Mac Vim / Vim formulas: '--with-brewed-python' that would compile MacVim / Vim against the brew installed version of python. This type of optional flag is consistent with flags from other formula, such as within the python formula itself.

This would avoid the need to make manual alterations to these formulas as in the following example: http://superuser.com/questions/440981/how-can-i-use-the-homebrew-python-version-with-homebrew-macvim-on-snow-leopard

Thanks.

@jacknagel
Copy link
Contributor

vim will build against whatever python is first in $PATH; this is by design, to avoid the need for --with-brewed-* options for different languages.

$ otool -L /usr/local/bin/vim | grep Python
    /usr/local/Frameworks/Python.framework/Versions/2.7/Python (compatibility version 2.7.0, current version 2.7.0)
:python print(sys.version)
2.7.3 (default, Nov  6 2012, 12:48:59)
[GCC 4.2.1 Compatible Apple Clang 3.0 (tags/Apple/clang-211.10.1)]

@xgalaxy
Copy link
Author

xgalaxy commented Feb 17, 2013

Okay great!
I'm sorry I didn't notice this. It's not detailed in brew info for the MacVim formula which python it links against.
The link I provided was the only thing that came up in a search on the issue.

@xgalaxy xgalaxy closed this as completed Feb 17, 2013
@xgalaxy xgalaxy reopened this Feb 17, 2013
@xgalaxy
Copy link
Author

xgalaxy commented Feb 17, 2013

MacVim doesn't appear to follow the same behavior as Vim in this case.
Brewing Python and then rebuild MacVim still yields MacVim using system Python instead of brewed Python.

In shell:

~ which python
/usr/local/bin/python

~ python
Python 2.7.3 (default, Feb 16 2013, 17:09:47) 
[GCC 4.2.1 Compatible Apple LLVM 4.2 (clang-425.0.24)] on darwin
Type "help", "copyright", "credits" or "license" for more information.
>>> 

In MacVim:

:python print(sys.version)
2.7.1 (r271:86832, Jul 31 2011, 19:30:53)
[GCC 4.2.1 (Based on Apple Inc. build 5658) (LLVM build 2335.15.00)]

@xgalaxy
Copy link
Author

xgalaxy commented Feb 17, 2013

Okay.
Well I spent far too long on this. I'm just giving up for now.

WIth a brewed Python installed, MacVim doesn't recognize it and links against system Python.
The Vim formula will link against the brewed Python, but segfaults immediately.

If I do the work around linked in my initial post, MacVim will link against the brewed Python, but also segfaults immediately with 'mismatched Python version'.

I also tried various other work arounds I could find and they all result in segfaults for 'mismatched Python'.

Uninstalling brewed python, both MacVim and Vim install and run fine.

@xgalaxy
Copy link
Author

xgalaxy commented Feb 17, 2013

Okay. So this is all my fault really.
For those paying attention, make sure to recompile any vim plugins that have any C compilation steps that also linked against Python.

@xgalaxy xgalaxy closed this as completed Feb 17, 2013
@Homebrew Homebrew locked and limited conversation to collaborators Feb 16, 2016
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants