[ruby-talk:444379] Building Ruby on Windows 10

Hi,

I'm trying to build Ruby 3.2.2 source code on Windows 10 using Visual Studio 2019. I downloaded the source code using link https://cache.ruby-lang.org/pub/ruby/3.2/ruby-3.2.2.tar.gz from Download Ruby.

I'm following the steps mentioned in this (windows - Documentation for Ruby 3.3).

Following is the configuration that I'm executing from the Visual Studio 2019 Native x64 command prompt.
d:\...\ruby3.2.2> win32\configure --prefix=/usr/local --target=x64-mswin64 --disable-install-doc --with-opt-dir=C:\gitviews\opensource\vcpkg\installed\x64-windows\

I get the following error. How do I make sure these packages are of the correct version and compatible with Ruby 3.2.2?

···

-----------------------------------------------------------------------------------
...
compiling rubyw.rc
linking rubyw.exe
*** Following extensions are not compiled:
fiddle:
" Could not be configured. It will not be installed."
" D:/Ruby/ruby-3.2.2.tar/ruby-3.2.2/ext/fiddle/extconf.rb:73: missing libffi. Please install libffi or use --with-libffi-source-dir with libffi source location."
" Check ext/fiddle/mkmf.log for more details."
openssl:
" Could not be configured. It will not be installed."
" D:/Ruby/ruby-3.2.2.tar/ruby-3.2.2/ext/openssl/extconf.rb:101: OpenSSL library could not be found. You might want to use --with-openssl-dir=<dir> option to specify the prefix where OpenSSL is installed."
" Check ext/openssl/mkmf.log for more details."
psych:
" Could not be configured. It will not be installed."
" Check ext/psych/mkmf.log for more details."
readline:
" Could not be configured. It will not be installed."
" D:/Ruby/ruby-3.2.2.tar/ruby-3.2.2/ext/readline/extconf.rb:62: Neither readline nor libedit was found"
" Check ext/readline/mkmf.log for more details."
zlib:
" Could not be configured. It will not be installed."
" Check ext/zlib/mkmf.log for more details."
*** Fix the problems, then remove these directories and try again if you want.
...
-----------------------------------------------------------------------------------

I have already installed the required packages using the following command under C:\gitviews\opensource\vcpkg\
d:\...\ruby3.2.2>vcpkg --triplet x64-windows install openssl libffi libyaml zlib readline
-----------------------------------------------------------------------------------
  ...
   openssl:x64-windows -> 3.1.4#1
    zlib:x64-windows -> 1.3
The following packages will be built and installed:
    readline:x64-windows -> 0#5
  * readline-win32:x64-windows -> 5.0#8
Additional packages (*) will be modified to complete this operation.
Detecting compiler hash for triplet x64-windows...
Restored 0 package(s) from C:\Users\310220077\AppData\Local\vcpkg\archives in 808 us. Use --debug to see more details.
libffi:x64-windows is already installed
libyaml:x64-windows is already installed
openssl:x64-windows is already installed
zlib:x64-windows is already installed
Installing 1/2 readline-win32:x64-windows...
-----------------------------------------------------------------------------------

Regards,
Chandan
______________________________________________
ruby-talk mailing list -- ruby-talk@ml.ruby-lang.org
To unsubscribe send an email to ruby-talk-leave@ml.ruby-lang.org
ruby-talk info -- Info | ruby-talk@ml.ruby-lang.org - ml.ruby-lang.org

Hi Chandan,

I'm trying to build Ruby 3.2.2 source code on Windows 10 using Visual Studio 2019. I downloaded the source code using linkhttps://cache.ruby-lang.org/pub/ruby/3.2/ruby-3.2.2.tar.gz fromhttps://www.ruby-lang.org/en/downloads/.

I'm following the steps mentioned in this (windows - Documentation for Ruby 3.3).

Do you need to build with Visual Studio 2019? I think I had found that it was easier to build using the Devkit that comes with a Ruby installation. The errors imply that they need all the packages to be installed which are likely to be easier on a mingw installation... hopefully someone else has better advice for VS 2019.

Best regards,
Mohit.

···

On 2023-11-22 9:40 pm, knchandan--- via ruby-talk wrote:

Hi Mohit,

Thanks for your reply.

I need to build in VS2019/22 as I have to use the generated library (Ruby
DLL) in my C++ project for Ruby-C++ interop. I am already using Ruby 2.4.5
in this way. I'm trying to upgrade to newer version of Ruby now.

Using mingw version will not be compatible with VS compiler.

Regards,
Chandan

···

On Thu, 23 Nov, 2023, 4:30 pm Mohit Sindhwani, <mo_mail@onghu.com> wrote:

Hi Chandan,

On 2023-11-22 9:40 pm, knchandan--- via ruby-talk wrote:

I'm trying to build Ruby 3.2.2 source code on Windows 10 using Visual Studio 2019. I downloaded the source code using link https://cache.ruby-lang.org/pub/ruby/3.2/ruby-3.2.2.tar.gz from Download Ruby.

I'm following the steps mentioned in this (windows - Documentation for Ruby 3.3).

Do you need to build with Visual Studio 2019? I think I had found that it
was easier to build using the Devkit that comes with a Ruby installation.
The errors imply that they need all the packages to be installed which are
likely to be easier on a mingw installation... hopefully someone else has
better advice for VS 2019.

Best regards,
Mohit.

Hi Chandan,

I understand. We used to use a very old version of Ruby that way for something a long time back. Would love to hear about what you're doing and how :slight_smile:

I need to build in VS2019/22 as I have to use the generated library (Ruby DLL) in my C++ project for Ruby-C++ interop. I am already using Ruby 2.4.5 in this way. I'm trying to upgrade to newer version of Ruby now.

Using mingw version will not be compatible with VS compiler.

Yes, that's correct indeed.

I guess the issue you're having is with this part?

> You need to install required libraries using vcpkg like:
> vcpkg --triplet x64-windows install openssl libffi libyaml zlib

Although it's not a direct match, but I'd recommend that you ask either in the RubyInstaller mailing list or maybe even on the GitHub site for it: oneclick/rubyinstaller2: MSYS2 based RubyInstaller for Windows (github.com) <https://github.com/oneclick/rubyinstaller2&gt; - there are a few people there who may be able to help.

Best regards,
Mohit.

···

On 2023-11-23 7:33 pm, Chandan K N wrote: