Vimjas / vim-testbed

Docker image for testing Vim plugins
42 stars 6 forks source link

install_vim: "apk add ruby" for -ruby #23

Closed blueyed closed 7 years ago

blueyed commented 7 years ago

Otherwise at least vim master does not build against it:

checking --enable-rubyinterp argument... yes checking --with-ruby-command argument... defaulting to ruby checking for ruby... no

blueyed commented 7 years ago

Not enough for -tag v7.3.429 -name vim73 -py -ruby -build though:

checking --enable-rubyinterp argument... yes checking --with-ruby-command argument... defaulting to ruby checking for ruby... /usr/bin/ruby checking Ruby version... OK checking Ruby header files... not found; disabling Ruby

https://github.com/vim/vim/blob/be094a157913535d46cc6ac39465ce1ea7dae132/src/configure.in#L1440 fails:

/ # ruby -r mkmf -e 'print Config::CONFIG[["rubyhdrdir"]] || Config::CONFIG[["archdir"]] || $hdrdir'
-e:1:in `<main>': uninitialized constant Config (NameError)
Did you mean?  RbConfig
               CONFIG
/ # ruby -r mkmf -e 'print $hdrdir'
/usr/include/ruby-2.3.0/
tweekmonster commented 7 years ago

I just tried this in the shell and it works for me.

checking --with-ruby-command argument... defaulting to ruby
checking for ruby... /usr/bin/ruby
checking Ruby version... OK
checking Ruby rbconfig... RbConfig
checking Ruby header files... /usr/include/ruby-2.3.0
docker run -it --rm testbed/vim

apk update
apk add curl ruby ruby-dev make ncurses-dev curl gcc libc-dev
curl -SL "https://github.com/vim/vim/archive/v8.0.0442.tar.gz" | tar zx
cd vim-8.0.0442
./configure --enable-multibyte --without-x --enable-gui=no --with-compiledby=vim-testbed --enable-rubyinterp
tweekmonster commented 7 years ago

Oops, I'm wrong. I tried with 7.3.429 and got the same issue.

blueyed commented 7 years ago

Yeah. The only way seems to be patching the Vim source.. not sure if that's worth it. I've noticed it when using it for Vader's tests - where we could just not have Vim 7.3 then, or skip the if_ruby test there.

tweekmonster commented 7 years ago

Here's where it was fixed: https://github.com/vim/vim/commit/8139889a5f458b857f0b3d9d5888ca6951a77f5a

This is the latest change in the 7.3.x versions: https://github.com/vim/vim/commit/3437b911029ac92ae066fa861d886155a4b97064

This seems to work with 7.3.429:

apk add autoconf
cd src
curl -OJL https://raw.githubusercontent.com/vim/vim/3437b911029ac92ae066fa861d886155a4b97064/src/configure.in
autoconf
cd ..
./configure --enable-multibyte --without-x --enable-gui=no --with-compiledby=vim-testbed --enable-rubyinterp

I assume it would be fine for all 7.3.x versions

blueyed commented 7 years ago

@tweekmonster Thanks for the investigation: what do you recommend? Should we patch it like that?

tweekmonster commented 7 years ago

The v7.3.x series is frozen, so I don't see a problem with making an exception.

blueyed commented 7 years ago

JFI: with https://github.com/tweekmonster/vim-testbed/pull/9 this could be added to the tests easily.

tweekmonster commented 7 years ago

JFI?

blueyed commented 7 years ago

Oh, I've meant FYI, sorry.

blueyed commented 7 years ago

Or Just For Information.. :)

tweekmonster commented 7 years ago

I figured. Just messing with you 😜

blueyed commented 7 years ago

So will you provide a patch then? :)

I'd prefer to just close it otherwise for now: it's an issue with the new tests for vader.vim, which can be made to skip the ruby test there.

tweekmonster commented 7 years ago

So will you provide a patch then? :)

It's easy enough, so I don't mind. But, lets revisit after the install script has settled on the -tag flag. I'll close this for now.