Macvim doesn't build against Homebrew python

classic Classic list List threaded Threaded
6 messages Options
Reply | Threaded
Open this post in threaded view
|

Macvim doesn't build against Homebrew python

Ory Band
Numerous bugs and issues have been opened in the past few months, because Macvim fails to build against Homebrew Python. For now Homebrew devs are forced to use a hack to get around this problem, but the solution should be very simple on Macvim's side.

The source of the bug is that Macvim seems to link to Python on build by `-framework Python` instead of `python-config --ldflags`.

Here is Homebrew's Macvim formula for the exact hack-fix, note the Python paragraph at the end: https://github.com/Homebrew/homebrew/blob/master/Library/Formula/macvim.rb#L74

Besides that, please see this issues for more information, they discuss this specific problem:

https://github.com/Homebrew/homebrew/issues/17908
https://github.com/Homebrew/homebrew/issues/26496
https://github.com/Homebrew/homebrew/issues/20075
https://github.com/Homebrew/homebrew/issues/26496

Besides that, several issues have been opened on Macvim's Google Code page:

https://code.google.com/p/macvim/issues/detail?id=458
https://code.google.com/p/macvim/issues/detail?id=451
https://code.google.com/p/macvim/issues/detail?id=450

And another thread in this Google Group has also been opened, asking for a fix: https://groups.google.com/forum/#!searchin/vim_mac/homebrew/vim_mac/Pdb_XNYhPjw/jkZ6C9fXIWEJ

Please fix this, its causing a headache to a lot Macvim & Python users!


--
--
You received this message from the "vim_mac" maillist.
Do not top-post! Type your reply below the text you are replying to.
For more information, visit http://www.vim.org/maillist.php

---
You received this message because you are subscribed to the Google Groups "vim_mac" group.
To unsubscribe from this group and stop receiving emails from it, send an email to [hidden email].
For more options, visit https://groups.google.com/groups/opt_out.
Reply | Threaded
Open this post in threaded view
|

Re: Macvim doesn't build against Homebrew python

Rainer Müller-3
On 2014-02-08 20:38, Ory Band wrote:
> Numerous bugs and issues have been opened in the past few months, because Macvim fails to build against Homebrew Python. For now Homebrew devs are forced to use a hack to get around this problem, but the solution should be very simple on Macvim's side.
>
> The source of the bug is that Macvim seems to link to Python on build by `-framework Python` instead of `python-config --ldflags`.

In MacPorts I have been working around this with patches to the configure script. I only took the python versions provided by MacPorts into account, so I was able to remove some cruft for old versions of python.

https://trac.macports.org/browser/trunk/dports/editors/MacVim/files/patch-python.diff?rev=111451
https://trac.macports.org/browser/trunk/dports/editors/MacVim/files/patch-python3.diff?rev=111451

Be aware that these are untested with any other python distribution or with the Python.framework versions provided by OS X releases.

> Here is Homebrew's Macvim formula for the exact hack-fix, note the Python paragraph at the end: https://github.com/Homebrew/homebrew/blob/master/Library/Formula/macvim.rb#L74

Without having too much knowledge about Homebrew, this looks quite error-prone. You search PATH for any python-config, which will have an unknown version. But in the next line you hardcode version 2.7.

By the way, the Python detection is the same code in vanilla vim. Why don't you have this change in your formula for vim as well?

Rainer

--
--
You received this message from the "vim_mac" maillist.
Do not top-post! Type your reply below the text you are replying to.
For more information, visit http://www.vim.org/maillist.php

---
You received this message because you are subscribed to the Google Groups "vim_mac" group.
To unsubscribe from this group and stop receiving emails from it, send an email to [hidden email].
For more options, visit https://groups.google.com/groups/opt_out.
Reply | Threaded
Open this post in threaded view
|

Re: Macvim doesn't build against Homebrew python

Ory Band
On Sunday, February 9, 2014 4:09:49 AM UTC+2, Rainer Müller wrote:
> By the way, the Python detection is the same code in vanilla vim. Why don't you have this change in your formula for vim as well?

From what Homebrew devs have said, original Vim picks up the Homebrew Python correctly. Can't find the quote.

BTW, I've just found a message from Bjorn regarding this issue: https://github.com/Homebrew/homebrew/issues/20075#issuecomment-19050146

--
--
You received this message from the "vim_mac" maillist.
Do not top-post! Type your reply below the text you are replying to.
For more information, visit http://www.vim.org/maillist.php

---
You received this message because you are subscribed to the Google Groups "vim_mac" group.
To unsubscribe from this group and stop receiving emails from it, send an email to [hidden email].
For more options, visit https://groups.google.com/groups/opt_out.
Reply | Threaded
Open this post in threaded view
|

Re: Macvim doesn't build against Homebrew python

Ory Band
I've looked at src/configure.in and I think the problem is around here: https://github.com/b4winckler/macvim/blob/master/src/configure.in#L1058

The homebrew devs also used this to temporary fix stuff, might be helpful: https://github.com/Homebrew/homebrew/commit/fd2f302cc36ed6402eec20163ba4626a58bc5709#diff-e5bdde8c57ffa74024ffdadd33b5473fR121

This is a really big file and quite overwhelming. Please help!

--
--
You received this message from the "vim_mac" maillist.
Do not top-post! Type your reply below the text you are replying to.
For more information, visit http://www.vim.org/maillist.php

---
You received this message because you are subscribed to the Google Groups "vim_mac" group.
To unsubscribe from this group and stop receiving emails from it, send an email to [hidden email].
For more options, visit https://groups.google.com/groups/opt_out.
Reply | Threaded
Open this post in threaded view
|

Re: Macvim doesn't build against Homebrew python

Björn Winckler
In reply to this post by Ory Band
On Sun, Feb 9, 2014 at 5:48 PM, Ory Band <[hidden email]> wrote:
> On Sunday, February 9, 2014 4:09:49 AM UTC+2, Rainer Müller wrote:
>> By the way, the Python detection is the same code in vanilla vim. Why don't you have this change in your formula for vim as well?
>
> From what Homebrew devs have said, original Vim picks up the Homebrew Python correctly. Can't find the quote.
>
> BTW, I've just found a message from Bjorn regarding this issue: https://github.com/Homebrew/homebrew/issues/20075#issuecomment-19050146
>

My comment there still stands (reproduced below), sorry but I cannot
help out with this issue.

Björn

"MacVim dev here. This is most likely something that has to be fixed
in MacVim's configure script. Sorry guys, but I only use the system
Python version (and I have a strong aversion to autotools) so somebody
else will have to take a look at this. All I can say is that MacVim
passes -framework Pythonwhich will pick up the system Python version
when linking and this is most likely what needs to change. However, I
want that flag to be used when not building against a custom Python
version. (I'll consider patches sent to the vim_mac Google group.)"

--
--
You received this message from the "vim_mac" maillist.
Do not top-post! Type your reply below the text you are replying to.
For more information, visit http://www.vim.org/maillist.php

---
You received this message because you are subscribed to the Google Groups "vim_mac" group.
To unsubscribe from this group and stop receiving emails from it, send an email to [hidden email].
For more options, visit https://groups.google.com/groups/opt_out.
Reply | Threaded
Open this post in threaded view
|

Re: Macvim doesn't build against Homebrew python

Trevor Pierce
In reply to this post by Ory Band
On Sunday, February 9, 2014 10:48:04 AM UTC-6, Ory Band wrote:

> On Sunday, February 9, 2014 4:09:49 AM UTC+2, Rainer Müller wrote:
>
> > By the way, the Python detection is the same code in vanilla vim. Why don't you have this change in your formula for vim as well?
>
>
>
> From what Homebrew devs have said, original Vim picks up the Homebrew Python correctly. Can't find the quote.
>
>
>
> BTW, I've just found a message from Bjorn regarding this issue: https://github.com/Homebrew/homebrew/issues/20075#issuecomment-19050146

I can vouch that he Homebrew install of Vim properly points to the /usr/local Python, but the current Homebrew Macvim install still points to the System Python build. I have been trying for most of the evening to get Powerline ( https://github.com/Lokaltog/powerline ) installed on Macvim, and it took awhile to isolate where the problem lay.

I spent several mis-guided attempts installing Vim, then installing Macvim using this command:
brew install macvim --env-std --override-system-vim

Which only served to overwrite my proper Vim build with one that pointed to the System Python.

Reading through a number of issue tickets in Github and Stack Overflow, it does look like Macvim is the issue, and a fix that doesn't involve fiddling with the System Python settings hasn't been promoted.

--
--
You received this message from the "vim_mac" maillist.
Do not top-post! Type your reply below the text you are replying to.
For more information, visit http://www.vim.org/maillist.php

---
You received this message because you are subscribed to the Google Groups "vim_mac" group.
To unsubscribe from this group and stop receiving emails from it, send an email to [hidden email].
For more options, visit https://groups.google.com/d/optout.