-
-
Notifications
You must be signed in to change notification settings - Fork 11.3k
MacVim doesn't link to brewed python correctly #17908
Comments
We can't leave an issue open as "documentation", so what should we do here? |
The only major difference between the Vim and MacVim formula that I saw was the Vim formula specifying --prefix to configure. Unfortunately this change doesn't seem to make a difference. For reference, here is the output of MacVim / Vim --version under the 'Linking' section: Vim:
MacVim:
Notice the lack of -F/usr/local/Frameworks for MacVim. |
Given that macvim by its nature has a more complicated build system than vanilla vim, it's not surprising that it might ignore flags that we set... the standard procedure here is to try and reproduce the same problem outside of Homebrew. If it persists then the issue should be taken to macvim. |
Just installed YouCompleteMe with homebrew python/macvim, the workaround described by xgalaxy (thanks!) seems the only way to make this work on OSX at the moment. I'd update the FAQ pointing to this issue instead of #18. I agree with what others have already said, the proper fix would be to use homebrew python instead of the system one in macvim formula. |
This isn't specific to homebrew, though. I ran into the same problem compiling MacVim by hand against a Python framework I'd installed in /Library... the only way I could compile it against that python was the symlinking trick xgalaxy describes. So I'd call this a MacVim issue (but if the MacVim formula can resolve it with a workaround in the meantime, that would be awesome... would have saved me time for sure). |
After a "brew update", I reinstall macvim to see if there is any changes that will fix the issue, but it seems like the changes has made python support disappear completely!! Here is the Linking portion of my Linking: clang -L. -L. -L/usr/local/lib -o Vim -framework Cocoa -framework Carbon -lncurses -liconv -framework Cocoa -fstack-protector -L/usr/local/lib -L/System/Library/Perl/5.12/darwin-thread-multi-2level/CORE -lperl -lm -lutil -lc -F/System/Library/Frameworks -framework Tcl -framework CoreFoundation -framework Ruby Notice no -framework Python at all. |
Your system and your python? ( |
Mountain Lion 10.8.3 HOMEBREW_VERSION: 0.9.4 |
|
perhaps I am wrong. |
Adding --with-python has no effect on the compilation. |
I can't reproduce a failure. I built MacVim.app with system python and with brewed python. Since there were some python changes, perhaps |
Would that remove site-packages and existing libraries I installed? |
Ok, after updating brew and install python 2.7.5, macvim still doesn't seems to link to python Linking: clang -L. -L. -L/usr/local/lib -o Vim -framework Cocoa -framework Carbon -lncurses -liconv -framework Cocoa -fstack-protector -L/usr/local/lib -L/System/Library/Perl/5.12/darwin-thread-multi-2level/CORE -lperl -lm -lutil -lc -F/System/Library/Frameworks -framework Tcl -framework CoreFoundation -framework Ruby |
Can anyone reproduce the link failure here? I can't so its hard for me to debug. |
Starting from a working macvim i've replicated the issue removing/installing it (and following xgalaxy's procedure to swap libraries), the --version output is the same pencilcheck is seeing, no more -framework Python among the clang linking options (it was there before). The weird thing is that everything python-related (youcompleteme, powerline, :python "command") still works with both versions and that python/dyn is included among the available features: Huge version with MacVim GUI. Features included (+) or not (-):
+arabic +autocmd +balloon_eval +browse ++builtin_terms +byte_offset +cindent
+clientserver +clipboard +cmdline_compl +cmdline_hist +cmdline_info +comments
+conceal +cryptv +cscope +cursorbind +cursorshape +dialog_con_gui +diff
+digraphs +dnd -ebcdic +emacs_tags +eval +ex_extra +extra_search +farsi
+file_in_path +find_in_path +float +folding -footer +fork() +fullscreen
-gettext -hangul_input +iconv +insert_expand +jumplist +keymap +langmap
+libcall +linebreak +lispindent +listcmds +localmap -lua +menu +mksession
+modify_fname +mouse +mouseshape +mouse_dec -mouse_gpm -mouse_jsbterm
+mouse_netterm +mouse_sgr -mouse_sysmouse +mouse_urxvt +mouse_xterm +multi_byte
+multi_lang -mzscheme +netbeans_intg +odbeditor +path_extra +perl
+persistent_undo +postscript +printer +profile +python/dyn -python3 +quickfix
+reltime +rightleft +ruby +scrollbind +signs +smartindent -sniff +startuptime
+statusline -sun_workshop +syntax +tag_binary +tag_old_static -tag_any_white
+tcl +terminfo +termresponse +textobjects +title +toolbar +transparency
+user_commands +vertsplit +virtualedit +visual +visualextra +viminfo +vreplace
+wildignore +wildmenu +windows +writebackup -X11 -xfontset +xim -xsmp
-xterm_clipboard -xterm_save I'm not sure if what i'm seeing it's a consequence of a dirty environment or if i'm not testing the python support correctly, but afaik even w/o the linking options everything seems to work as usual. |
I am getting the same output as well, +python is in the options, but python libraries such as YouCompleteMe, and powerline don't work for my version, as it seems like the python is completely gone from MacVim. VIM - Vi IMproved 7.3 (2010 Aug 15, compiled Jun 5 2013 01:18:33) |
In macvim I can do What is true: Homebrew does not add |
Sure, I will add that in my zshrc |
Not there. In |
Still doesn't work... I add it inside the install method. Linking: clang -L. -L. -L/usr/local/lib -o Vim -framework Cocoa -framework Carbon -lncurses -liconv -framework Cocoa -fstack-protector -L/usr/local/lib -L/System/Library/Perl/5.12/darwin-thread-multi-2level/CORE -lperl -lm -lutil -lc -F/System/Library/Frameworks -framework Tcl -framework CoreFoundation -framework Ruby |
Above I see you have python 2.7.3. Can you please |
I already upgraded python to 2.7.5 |
In my configure output from
so it seems like MacVim has found the correct python versions (both even!). How is this for you? |
Running with checking --enable-pythoninterp argument... dynamic It's weird how it also detects the correct python, but it just keep crashing on start for powerline and youcompleteme. On the other hand, the homebrew vim seems to work out of the box, no warnings, and no errors... so weird. |
By stops working, what do you mean? I can start it up. See the gui and type However, I just pushed a change with |
This is only the first error I see when I start up, then the errors for YouCompleteMe and powerline comes in in never ending cycle, thus I can't even go in vim to type :python at all, or even insert a letter. It's weird that running |
Error look something like this once I get into mvim: Error detected while processing function youcompleteme#Enable: |
Ah so it fails for that youcompleteme module and not if you type |
But if you |
Yea, |
It's not only YouCompleteMe, the same with powerline as well when I link homebrew python and launch MacVim. There is no hardcoded path in YouCompleteMe though, at least in autoload/YouCompleteMe.vim. |
Still have no idea how to fix this. It seems like MacVim completely ignores static linking of python |
I've opened an issue on Macvim's development page. |
Thanks for reporting upstream. |
I've run into the same problem while trying to install the HEAD version of vim i.e. |
Vim isn't Macvim, and I guess that's why it worked. But thanks anyways.. :) On 9 ביונ 2013, at 09:42, Tareq A Khandaker [email protected] wrote:
|
I`ve got the same here. Renamed the Current to Current-sys, but my brewed macvim never`s get brewed Python 2.7.5. But with the brewed vim i`ve got the brewed Python. Tried all theses aproach`s. |
Hey all, please NEVER CHANGE STUFF IN MacVim now works with a brewed Python 2.x since ee0d6c0. I tested with the |
Wow, thanks for the patch, it indeed works at least for powerline. |
The patch works for YouCompleteMe as well. At least for me. |
Cool, thanks for the feedback! |
After updating to Xcode5-DP3 I get this error, however, it manifests when launching vanilla vim. I tried uninstalling vim and python and updating and reinstalling to no avail. |
Attention, this bug reappered as of today. Fresh install of python 2.7.6, macvim 7.4 patch 1-52 (+
Note the big bad 2.7.5 there. I guess this somehow relates to #20392 |
@oryband Please |
I had this same problem. Here's my solution.
All my bundles and .vimrc file stayed intact... it works!! |
@kittykatattack The reason it works for you now is because in the meanwhile the bug was fixed. See the issue references above. |
MacVim isn't linking against the brewed python correctly.
Vim formula works fine. Related: #17896
If you edit the MacVim formula like the below snippit, MacVim will use the configuration directory specified but still links against system python, resulting in various issues using python based plugins.
However, if you remove the changes to the formula and instead temporarily symlink system python path to point to brewed python, install MacVim, and then remove the symlink then MacVim links against the proper python.
Fix was suggested here:
http://superuser.com/a/463474
There are several projects that are running into issues with this:
ycm-core/YouCompleteMe#18
powerline/powerline#39
python-mode/python-mode#87
In the cases above, the "solution" has been to first unlink python then install macvim and then relink python. But this isn't a solution at all. Its a bandaid, and a terrible one at that.
I'm not sure why Vim compiles and finds brewed python correctly and why MacVim doesn't. The formula between them appears to be nearly identical. It's likely an upstream issue with MacVim.
Failing anything homebrew can do to fix the issue, at least this will help document it for any body else that comes along in the future and runs into the same problem.
The text was updated successfully, but these errors were encountered: