pycall.rb icon indicating copy to clipboard operation
pycall.rb copied to clipboard

Fix compile error on MSVC 2019

Open cfis opened this issue 5 years ago • 7 comments

MSVC does not support initializing the rb_data_type_t structure from a pointer. Error is:

ruby_wrapper.c(359): error C2099: initializer is not a constant ruby_wrapper.c(359): error C4047: 'initializing': 'void *' differs in levels of indirection from 'int'

Fixed by moving code to pycall_init_ruby_wrapper.

cfis avatar May 16 '20 06:05 cfis

@cfis Thank you for fixing this issue!

I want to apply this change only to the case of MSVC, so I'll merge this after adding some small fixes similar to the following trick:

https://github.com/ruby/ruby/pull/3024/files#diff-779cc912d1b415b1412b73ce56c7b649R56-R65

mrkn avatar May 25 '20 02:05 mrkn

Also, I want to add a mew CI job for testing on MSVC. I will add some commits to this pull-request.

mrkn avatar May 25 '20 02:05 mrkn

Sounds good to me. Interesting that CI has MSVC ruby builds, that's helpful to know.

cfis avatar May 26 '20 00:05 cfis

@cfis I have trouble that we don't have MSVC-built Ruby for running CI. Before preparing MSVC-built Ruby, I want to confirm the reason why you want to use pycall.rb on MSVC-built Ruby. Could you please explain it? Isn't mingw-version Ruby satisfy your requirements?

mrkn avatar May 26 '20 03:05 mrkn

I use both mingw and mswin versions - but usually mingw ruby. However, I use the mswin version of ruby for creating/debugging extensions on Windows. Visual Studio has some really nice debugging facilities, and also let me step through Ruby itself and Python. For example, I use mswin ruby for my work on ruby-prof, libxml-ruby, etc.

Hope that helps.

cfis avatar May 26 '20 03:05 cfis

@cfis Thank you for your feedback. I understood your situation.

I'd like to let pycall.rb support of MSVC-built Ruby. For the purpose, I need to change our ruby/setup-ruby action so that we can install MSVC-built Ruby binary on the virtual environment.

Please give me some days to the preparation.

mrkn avatar May 26 '20 04:05 mrkn

No problem, and thanks for looking at this. Let me know if you need any help.

cfis avatar May 26 '20 08:05 cfis