2017-11-25 10:05 GMT+09:00 Ilya Mikhaltsou <[email protected]>: > пятница, 24 ноября 2017 г., 0:13:57 UTC-8 пользователь Kazunobu Kuriyama > написал: > > 2017-11-24 1:38 GMT+09:00 Ilya Mikhaltsou <[email protected]>: > > > > > > четверг, 23 ноября 2017 г., 8:18:26 UTC-8 пользователь Ilya Mikhaltsou > написал: > > > > > среда, 22 ноября 2017 г., 8:26:02 UTC-8 пользователь Kazunobu Kuriyama > написал: > > > > > > 2017-11-23 1:07 GMT+09:00 Ilya Mikhaltsou <[email protected]>: > > > > > > > > > > > > > > > > > > > Just to make sure. Have you tried something like this?: > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > ./configure --enable-rubyinterp --with-ruby-command=/path/to/ > interpreter > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > If so, what did you set it to? > > > > > > > > > > > > > > > > > > > > > > > > No, I haven't. Ruby was available in PATH. > > > > > > > > > > > > > > > > > > > > > > > > When you run configure with --enable-rubyinterp, among a bunch of > lines, you usually have > > > > > > > > > > > > > > > > > > > > > > > > checking for ruby... /usr/bin/ruby > > > > > > > > > > > > > > > > > > But if your target is 2.4.1, then the path should be different from > /usr/bin/ruby and must be the path of the 2.4.1 interpreter. > > > > > > > > > > > > > > > > > > What did you get when you ran configure? Something like > $HOME/.rvm/bin/ruby-2.4.1? (Since I'm not a rvm user, I'm not sure what > the path actually looks like.) > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > -- > > > > > > > > > > > > -- > > > > > > > > > > > > You received this message from the "vim_dev" 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_dev" group. > > > > > > > > > > > > To unsubscribe from this group and stop receiving emails from it, > send an email to [email protected]. > > > > > > > > > > > > For more options, visit https://groups.google.com/d/optout. > > > > > > > > > > In the configure step ruby was identified correctly. It was > /Users/username/.rvm/rubies/ruby-2.4.1/bin/ruby (or something like that). > > > > > > > > And please, let me get something straight here. I appreciate your > concerns for whether this is happening exclusively on my mac or not, but it > should be obvious that the way the search for library path on macOS is > wrong (possibly it works exclusively for native ruby, but I’m working on a > very underpowered mac and have no intention of waiting a couple of hours > again to verify). > > > > > > > > Since the problem is obvious from the patch, I believe the main decision > should be whether there are historical reasons for this being done > explicitly this way and that it is not a bug, or that it has been > incidental that it works on default (or common) configurations despite > being wrong. > > > > > > > > I’ve given you explicitly the output of commands that influence the > comditions involved in deciding where is the ruby library located and > which flags to pass to ld. I don’t think that my configuration could be so > much outworldish as to output wrong strings or be unrepeatable. So by > extension it is fairly logical that it is not the output of those commands > being questioned, but the way this output is processed in the configuration > script. > > > > > > > > As a matter of fact, the preinstalled Ruby of macOS has a shared library > only, namely, libruby-2.0.0.dylib on El Capitan (10.11) and Sierra (10.12), > and libruby-2.3.0 on High Sierra (10.13). There's no libruby-foobar.a > > > > > > It is true that RbConfig returns libruby-2.0.0-static.a and > libruby-2.3.0-static.a, respectively, as the value of LIBRUBY_A, but this > fact doesn't guarantee the existence of the file. Actually, none of the > mentioned macOS versions has it. > > > > > > Also, as written in configure.ac:1882, "Mac OS 10.3 where libruby.a > doesn't exist" > > > > > > IMHO, all those points to this: Having a static Ruby library with macOS > is quite unusual; in fact, macOS's Ruby has long been working without one. > > > > > > FWIW, I downloaded the latest Ruby source (2.4.2), built and installed > like this: > > > > > > $ ./configure --enabled-shared > > $ make > > $ sudo make install > > > > > > Then, I had two different versions of Ruby on my Mac: > > > > > > $ which -a ruby > > /usr/local/bin/ruby > > /usr/bin/ruby/ > > $ /usr/local/bin/ruby --version > > ruby 2.4.2p198 (2017-09-14 revision 59899) [x86_64-darwin15] > > $ /usr/bin/ruby --version > > ruby 2.0.0p648 (2015-12-16 revision 53162) > [universal.x86_64-darwin15] > > > > > > Then, I went to the src directory of my Vim repository to build a > Ruby-enabled Vim: > > > > > > > > $ ./configure --enable-rubyinterp > > .... > > > > checking --enable-rubyinterp argument... yes > > checking --with-ruby-command argument... defaulting to ruby > > checking for ruby... /usr/local/bin/ruby > > checking Ruby version... OK > > checking Ruby rbconfig... RbConfig > > checking Ruby header files... /usr/local/include/ruby-2.4.0 > > ... > > $ make > > > > > > To check which Ruby the newly created vim was linked against, I did > > > > > > $ otool -L vim > > ... > > > > /usr/local/lib/libruby.2.4.2.dylib (compatibility version 2.4.0, > current version 2.4.2) > > ... > > > > > > It looked good. I saved it as ~/.local/bin/vim-ruby-2.4.2. > > > > > > Then I tried having another vim executable linked against system's Ruby: > > > > > > $ make distclean > > $ ./configure --enable-rubyinterp --with-ruby-command=/usr/bin/ruby > > ... > > > > checking --enable-rubyinterp argument... yes > > checking --with-ruby-command argument... /usr/bin/ruby > > checking for /usr/bin/ruby... /usr/bin/ruby > > checking Ruby version... OK > > checking Ruby rbconfig... RbConfig > > checking Ruby header files... /System/Library/Frameworks/ > Ruby.framework/Versions/2.0/usr/include/ruby-2.0.0 > > ... > > $ make > > > > > > To check which Ruby the newly created vim was linked against, I did > > > > > > $ otool -L vim > > ... > > > > /System/Library/Frameworks/Ruby.framework/Versions/2.0/usr/lib/libruby.2.0.0.dylib > (compatibility version 2.0.0, current version 2.0.0) > > ... > > > > > > It looked good. I saved it as ~/.local/bin/vim-ruby-2.0.0. > > > > > > Now, I have > > > > > > $ vim-ruby-2.4.2 +'redir >> /dev/stdout | ruby print RUBY_VERSION' +q > > 2.4.2 > > $ vim-ruby-2.0.0 +'redir >> /dev/stdout | ruby print RUBY_VERSION' +q > > 2.0.0 > > > > > > So...what do you want more than this? > > > > > > In conclusion, the title of this thread, "Vim with ruby enabled on macOS > doesn't find lib during build", definitely contradicts the fact I showed > above. Indeed, your static library stuff is something peculiar enough to > get people to puzzle and wonder what you've been doing with your Mac and > Ruby. Perhaps, because of that, what looked obvious or logical to you > couldn't appear as-such to them as much as you had expected. > > > > > > > > > > > > > > > > > > -- > > > > -- > > > > You received this message from the "vim_dev" 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_dev" group. > > > > To unsubscribe from this group and stop receiving emails from it, send > an email to [email protected]. > > > > For more options, visit https://groups.google.com/d/optout. > > > Sorry, the title is confusing — I should have noted in the title that the > problem happens exclusively to rvm. The configuration script doesn’t look > for library path.
Right. Instead of looking for paths for itself, it queries the RbConfig associated with the interpreter in use about the header and library directories to specify the arguments to the -I and -L options, respectively, and the names of libraries to link in the form of -l<library-name>. It doesn't make in itself any assumption on where or what they are; it fully counts on what RbConfig replies to it. The setup you provided only works due to the fact that ruby library is > located in a default system library location. I'm not sure what you mean by this. Again, the configure script doesn't know anything about "default locations" in itself. Rather, because of that, it works nicely regardless of how or where Ruby was installed; it works for both Mac-specific bundle structured installation in /System/Library/Frameworks/ and ordinary Unix-like installation in /usr/ or /usr/local/. That's what I showed in my previous email, not that "It works fine only if it's not asked too much". > Whereas in rvm this location is different. When using rvm, the > configuration script correctly locates ruby binary, include dir, but does > not locate library directly. The proposed patch fixes this problem by > broadening the condition for making a decision that a static library does > not exist. > Could you show me how the library search failed more specifically? Your patch could be right, but since your understanding of the configure script is somehow different from mine, I can't seem to understand your explanation. > -- > -- > You received this message from the "vim_dev" 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_dev" group. > To unsubscribe from this group and stop receiving emails from it, send an > email to [email protected]. > For more options, visit https://groups.google.com/d/optout. > -- -- You received this message from the "vim_dev" 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_dev" group. To unsubscribe from this group and stop receiving emails from it, send an email to [email protected]. For more options, visit https://groups.google.com/d/optout.
