pycall.rb
pycall.rb copied to clipboard
Fix compile error on MSVC 2019
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 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
Also, I want to add a mew CI job for testing on MSVC. I will add some commits to this pull-request.
Sounds good to me. Interesting that CI has MSVC ruby builds, that's helpful to know.
@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?
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 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.
No problem, and thanks for looking at this. Let me know if you need any help.