This repository has been archived by the owner. It is now read-only.

Macvim doesn't link to brewed Python (AGAIN!) on Mvrcks 10.9.1 #26496

Closed
oryband opened this Issue Feb 7, 2014 · 22 comments

Comments

Projects
None yet
8 participants
@oryband

oryband commented Feb 7, 2014

Well, apparently, #17908, #20075, #20392 strike again. Or maybe it's a "The return of" these issues.

Short version is: Macvim again doesn't link to brewed Python.

I'm using a vim plugin called YouCompleteMe which uses vim's Python and some compiled stuff. Because Macvim doesn't compile against hb's Python, the plugin crashes. See Valloric/YouCompleteMe#8.

This recurring issue is the fault of Macvim developers. The community (including myself) have reported this upstream in several tickets, but they were left ignored.

Previously the fix was made on Homebrew's side, mainly by @samueljohn. However, something or someone revived this bug. Please fix this - I have to use system's Python until then, since Macvim is unusable with this (very useful) plugin.

$ brew --config
HOMEBREW_VERSION: 0.9.5
ORIGIN: https://github.com/Homebrew/homebrew.git
HEAD: 7f0240f49ba76c1b08aac297d4949d2c12ffa091
HOMEBREW_PREFIX: /usr/local
HOMEBREW_CELLAR: /usr/local/Cellar
CPU: dual-core 64-bit penryn
OS X: 10.9.1-x86_64
Xcode: 5.0.2
CLT: 5.0.1.0.1.1382131676
Clang: 5.0 build 500
X11: 2.7.5 => /opt/X11
System Ruby: 1.8.7-358
Perl: /usr/bin/perl
Python: /usr/local/bin/python => /usr/local/Cellar/python/2.7.6/Frameworks/Python.framework/Versions/2.7/bin/python2.7
Ruby: /usr/local/var/rbenv/shims/ruby
@MikeMcQuaid

This comment has been minimized.

Show comment Hide comment
@MikeMcQuaid

MikeMcQuaid Feb 7, 2014

Owner

Is the Homebrew Python first in your PATH?

Owner

MikeMcQuaid commented Feb 7, 2014

Is the Homebrew Python first in your PATH?

@MikeMcQuaid

This comment has been minimized.

Show comment Hide comment
@MikeMcQuaid

MikeMcQuaid Feb 7, 2014

Owner

I'll try and reproduce and fix this this weekend.

Owner

MikeMcQuaid commented Feb 7, 2014

I'll try and reproduce and fix this this weekend.

@oryband

This comment has been minimized.

Show comment Hide comment
@oryband

oryband Feb 7, 2014

@MikeMcQuaid Of course.

oryband commented Feb 7, 2014

@MikeMcQuaid Of course.

@chdiza

This comment has been minimized.

Show comment Hide comment
@chdiza

chdiza Feb 7, 2014

Contributor

FYI, the MacVim dev (it's one guy) is much more likely to do something about this if the issue is raised on the vim_mac mailing list (you can get there from www.vim.org). I'm not 100% sure he pays much attention to the google issues page.

Problems like this, i.e., non-system pythons that aren't in the standard location for non-system pythons (i.e., /library/frameworks/python.framework), have been raised there in the past, but I can't recall if any of them are homebrew-related. I vaguely recalling the dev saying that fixing one of those is non-rivial, but I could be wrong about that.

Contributor

chdiza commented Feb 7, 2014

FYI, the MacVim dev (it's one guy) is much more likely to do something about this if the issue is raised on the vim_mac mailing list (you can get there from www.vim.org). I'm not 100% sure he pays much attention to the google issues page.

Problems like this, i.e., non-system pythons that aren't in the standard location for non-system pythons (i.e., /library/frameworks/python.framework), have been raised there in the past, but I can't recall if any of them are homebrew-related. I vaguely recalling the dev saying that fixing one of those is non-rivial, but I could be wrong about that.

@socketwiz

This comment has been minimized.

Show comment Hide comment
@socketwiz

socketwiz Feb 9, 2014

I'm seeing the issue as well :(

I ran the following:

brew update
brew uninstall python macvim
brew install python
brew install --override-system-vim macvim

Then I rebuilt YouCompleteMe. And when I run mvim:

Vim: Caught deadly signal ABRT
Vim: Finished.

However the following command will fix it as detailed here: https://bugs.launchpad.net/ultisnips/+bug/1156584

cd /Applications/MacVim.app/Contents/MacOS
install_name_tool -change /System/Library/Frameworks/Python.framework/Versions/2.7/Python /usr/local/Cellar/python/2.7.6/Frameworks/Python.framework/Versions/2.7/Python Vim

Ideally though the build process would just pickup the proper python.

I'm seeing the issue as well :(

I ran the following:

brew update
brew uninstall python macvim
brew install python
brew install --override-system-vim macvim

Then I rebuilt YouCompleteMe. And when I run mvim:

Vim: Caught deadly signal ABRT
Vim: Finished.

However the following command will fix it as detailed here: https://bugs.launchpad.net/ultisnips/+bug/1156584

cd /Applications/MacVim.app/Contents/MacOS
install_name_tool -change /System/Library/Frameworks/Python.framework/Versions/2.7/Python /usr/local/Cellar/python/2.7.6/Frameworks/Python.framework/Versions/2.7/Python Vim

Ideally though the build process would just pickup the proper python.

@oryband

This comment has been minimized.

Show comment Hide comment
@oryband

oryband Feb 9, 2014

@chdiza FYI I have reported this upstream to vim_mac group, per your suggestion.

To all Homebrew devs: Perhaps you should take part in that discussion (via the link in this message) to help Macvim's developers fix this.

oryband commented Feb 9, 2014

@chdiza FYI I have reported this upstream to vim_mac group, per your suggestion.

To all Homebrew devs: Perhaps you should take part in that discussion (via the link in this message) to help Macvim's developers fix this.

@adamv

This comment has been minimized.

Show comment Hide comment
@adamv

adamv Feb 9, 2014

Contributor

To all Homebrew devs

I'm not sure if any of us use Macvim; probably users of this software that install it through Homebrew should get involved.

Contributor

adamv commented Feb 9, 2014

To all Homebrew devs

I'm not sure if any of us use Macvim; probably users of this software that install it through Homebrew should get involved.

@MikeMcQuaid

This comment has been minimized.

Show comment Hide comment
@MikeMcQuaid

MikeMcQuaid Feb 9, 2014

Owner

This is almost certainly due to some of the changes in 47b8516.

If someone makes a patch re-adding these (and using an alternative to the python. bits) then that'll almost certainly fix it. I'll try and do so at some point but people may be able to beat me to it as its a busy week.

Owner

MikeMcQuaid commented Feb 9, 2014

This is almost certainly due to some of the changes in 47b8516.

If someone makes a patch re-adding these (and using an alternative to the python. bits) then that'll almost certainly fix it. I'll try and do so at some point but people may be able to beat me to it as its a busy week.

@MikeMcQuaid

This comment has been minimized.

Show comment Hide comment
@MikeMcQuaid

MikeMcQuaid Feb 10, 2014

Owner

A few questions for the people here:

  • Please provide me with a command I can run to verify whether it is using the correctly Python
  • Try --with-python --with-python3 if this isn't working for you and let me know if that works
  • Answer this question: why are you not using the precompiled MacVim binaries? I'm just trying to understand this.

I tried to fix this this weekend and I can't seem to manage to do so. As @adamv has said: I don't think any of us maintainers (@jacknagel?) use MacVim: if you want this fixed you'll need to help us out more if not write PRs yourselves.

Owner

MikeMcQuaid commented Feb 10, 2014

A few questions for the people here:

  • Please provide me with a command I can run to verify whether it is using the correctly Python
  • Try --with-python --with-python3 if this isn't working for you and let me know if that works
  • Answer this question: why are you not using the precompiled MacVim binaries? I'm just trying to understand this.

I tried to fix this this weekend and I can't seem to manage to do so. As @adamv has said: I don't think any of us maintainers (@jacknagel?) use MacVim: if you want this fixed you'll need to help us out more if not write PRs yourselves.

@oryband

This comment has been minimized.

Show comment Hide comment
@oryband

oryband Feb 10, 2014

@MikeMcQuaid

  • Open vim, go into insert mode (press colon :) and type python import sys; print(sys.version). It should print something like:
2.7.5 (default, Aug 25 2013, 00:04:04)
[GCC 4.2.1 Compatible Apple LLVM 5.0 (clang-500.0.68)]

This means it's built against system Python.

  • Tried compiling --with-python --with-python3, same results (and crashes). That is, Macvim still compiles against systme Python.
  • I'm not sure what you meant by using precompiled binaries - Do you ask why the formula doesn't just download the binaries without compiling from source? I'm not a Homebrew developer so I'm not sure about the answer, but I guess A precompiled Macvim won't link to brewed Python as well - causing the same crashes.
  • I'll gladly help you out as far as I can (I'm getting to know homebrew patching right now), but It'll take me time as I'm a newbie in this. Besides - According to the commit links you've posted here - You're the culprit who revived this bug! 😉

oryband commented Feb 10, 2014

@MikeMcQuaid

  • Open vim, go into insert mode (press colon :) and type python import sys; print(sys.version). It should print something like:
2.7.5 (default, Aug 25 2013, 00:04:04)
[GCC 4.2.1 Compatible Apple LLVM 5.0 (clang-500.0.68)]

This means it's built against system Python.

  • Tried compiling --with-python --with-python3, same results (and crashes). That is, Macvim still compiles against systme Python.
  • I'm not sure what you meant by using precompiled binaries - Do you ask why the formula doesn't just download the binaries without compiling from source? I'm not a Homebrew developer so I'm not sure about the answer, but I guess A precompiled Macvim won't link to brewed Python as well - causing the same crashes.
  • I'll gladly help you out as far as I can (I'm getting to know homebrew patching right now), but It'll take me time as I'm a newbie in this. Besides - According to the commit links you've posted here - You're the culprit who revived this bug! 😉
@MikeMcQuaid

This comment has been minimized.

Show comment Hide comment
@MikeMcQuaid

MikeMcQuaid Feb 10, 2014

Owner

@oryband By precompiled binaries I mean why are you using the Homebrew formula instead of e.g. https://code.google.com/p/macvim/downloads/list

Yes, I revived the bug. If you look at the other commits around that you'll see that I had to change literally hundreds of formula to cleanup the Homebrew Python code (which I would have preferred not to do but had to due to reasons I can't publicly disclose).

Owner

MikeMcQuaid commented Feb 10, 2014

@oryband By precompiled binaries I mean why are you using the Homebrew formula instead of e.g. https://code.google.com/p/macvim/downloads/list

Yes, I revived the bug. If you look at the other commits around that you'll see that I had to change literally hundreds of formula to cleanup the Homebrew Python code (which I would have preferred not to do but had to due to reasons I can't publicly disclose).

@oryband

This comment has been minimized.

Show comment Hide comment
@oryband

oryband Feb 10, 2014

@MikeMcQuaid I'm joking, totally understandable.

Answering your question, just d/led the binaries in the link you've given, and am getting the same results. I've also checked the Python version, and as expected it's system Python again :(

What cleanup was necessary for Macvim's formula? I'm trying to get into the formula's code now. Also searching where can this be fixed on Macvim's side.

oryband commented Feb 10, 2014

@MikeMcQuaid I'm joking, totally understandable.

Answering your question, just d/led the binaries in the link you've given, and am getting the same results. I've also checked the Python version, and as expected it's system Python again :(

What cleanup was necessary for Macvim's formula? I'm trying to get into the formula's code now. Also searching where can this be fixed on Macvim's side.

@MikeMcQuaid

This comment has been minimized.

Show comment Hide comment
@MikeMcQuaid

MikeMcQuaid Feb 10, 2014

Owner

We had a python object that needed to be removed. It seems to me that Macvim have no interest in fixing this so I'm wondering, long-term, if it's sensible for us to be fighting against that.

Owner

MikeMcQuaid commented Feb 10, 2014

We had a python object that needed to be removed. It seems to me that Macvim have no interest in fixing this so I'm wondering, long-term, if it's sensible for us to be fighting against that.

@oryband

This comment has been minimized.

Show comment Hide comment
@oryband

oryband Feb 10, 2014

@b4winckler said he'll consider patches, so maybe it's worth a try. It also sounds the fix should be on Macvim's side.

oryband commented Feb 10, 2014

@b4winckler said he'll consider patches, so maybe it's worth a try. It also sounds the fix should be on Macvim's side.

@MikeMcQuaid

This comment has been minimized.

Show comment Hide comment
@MikeMcQuaid

MikeMcQuaid Feb 10, 2014

Owner

Ok. In that case the best approach to me seems to be for someone to create a buildsystem patch which they include as part of a PR here removing all the hacky Python stuff in here, submit it upstream and hopefully it'll be included in a not-too-distant future release.

Owner

MikeMcQuaid commented Feb 10, 2014

Ok. In that case the best approach to me seems to be for someone to create a buildsystem patch which they include as part of a PR here removing all the hacky Python stuff in here, submit it upstream and hopefully it'll be included in a not-too-distant future release.

@oryband

This comment has been minimized.

Show comment Hide comment
@oryband

oryband Feb 10, 2014

Yeah, I'll try and get into that. Since this is a bit too overwhelming for me for now, we should concentrate on fixing it on Homebrew first - so at least people can use hb's Python in Macvim for the near future.

oryband commented Feb 10, 2014

Yeah, I'll try and get into that. Since this is a bit too overwhelming for me for now, we should concentrate on fixing it on Homebrew first - so at least people can use hb's Python in Macvim for the near future.

@MikeMcQuaid

This comment has been minimized.

Show comment Hide comment
@MikeMcQuaid

MikeMcQuaid Feb 10, 2014

Owner

I seem to have fixed it. Please reopen if not.

Owner

MikeMcQuaid commented Feb 10, 2014

I seem to have fixed it. Please reopen if not.

@oryband

This comment has been minimized.

Show comment Hide comment
@oryband

oryband Feb 11, 2014

Works perfectly. Thanks! :)

oryband commented Feb 11, 2014

Works perfectly. Thanks! :)

@demoslam demoslam referenced this issue in Valloric/YouCompleteMe Feb 12, 2014

Closed

Can't run MacVim after installing YCM #18

spkane added a commit to spkane/homebrew that referenced this issue Mar 3, 2014

ehershey added a commit to ehershey/homebrew that referenced this issue Apr 4, 2014

@MikeMcQuaid

This comment has been minimized.

Show comment Hide comment
@MikeMcQuaid

MikeMcQuaid Apr 10, 2014

Owner

Create a new issue instead of posting more to this thread.

Owner

MikeMcQuaid commented Apr 10, 2014

Create a new issue instead of posting more to this thread.

@noscripter

This comment has been minimized.

Show comment Hide comment
@noscripter

noscripter Jun 13, 2014

when I run mvim from my terminal, I received the following error:

ImportError: No module named site

There's no place to create issue in macvim repo, wonder if it's related to the problem you discussed here and is there any specific solution to this?

when I run mvim from my terminal, I received the following error:

ImportError: No module named site

There's no place to create issue in macvim repo, wonder if it's related to the problem you discussed here and is there any specific solution to this?

@byronyi

This comment has been minimized.

Show comment Hide comment
@byronyi

byronyi Jun 20, 2014

same error as above

byronyi commented Jun 20, 2014

same error as above

@mgarabed

This comment has been minimized.

Show comment Hide comment
@mgarabed

mgarabed Jul 25, 2014

The ImportError problems appear to stem from a recent pull request - I found that commenting out the line solved the issue:
Homebrew#29940 (comment)

The ImportError problems appear to stem from a recent pull request - I found that commenting out the line solved the issue:
Homebrew#29940 (comment)

@xu-cheng xu-cheng locked and limited conversation to collaborators Feb 17, 2016

Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.