Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Add rb_proc_call_with_block to native extension API #3068

Closed
nirvdrum opened this issue May 26, 2023 · 1 comment · Fixed by #3076
Closed

Add rb_proc_call_with_block to native extension API #3068

nirvdrum opened this issue May 26, 2023 · 1 comment · Fixed by #3076
Assignees
Labels

Comments

@nirvdrum
Copy link
Collaborator

The in-development version of msgpack-ruby uses rb_proc_call_with_block. That method isn't yet implemented in TruffleRuby, so the code errors out. Reported by @casperisfine.

Sample exception:

4) MessagePack::Factory#register_type registers custom packer method name
    Failure/Error: data = subject.packer.write(src).to_s
 
    Polyglot::ForeignException:
      External LLVMFunction rb_proc_call_with_block cannot be found.
    #./ext/msgpack/packer.c:109:in `msgpack_packer_try_write_with_ext_type_lookup'
    # ./ext/msgpack/packer.c:154:in `msgpack_packer_write_value'
    # ./ext/msgpack/packer_class.c:139:in `Packer_write'
    # /home/runner/.rubies/truffleruby-23.0.0-preview1/lib/truffle/truffle/cext_ruby.rb:41:in `<unknown>'
    # /home/runner/.rubies/truffleruby-23.0.0-preview1/lib/truffle/truffle/cext_ruby.rb:41:in `MessagePack::Packer#write'
    # ./spec/factory_spec.rb:231:in `block (3 levels) in <top (required)>'

Full log

@nirvdrum nirvdrum added the cexts label May 26, 2023
@casperisfine
Copy link

NB: that's the one I tried to use, but it's a whole family of functions:

VALUE rb_proc_call(VALUE recv, VALUE args);
VALUE rb_proc_call_kw(VALUE recv, VALUE args, int kw_splat);
VALUE rb_proc_call_with_block(VALUE recv, int argc, const VALUE *argv, VALUE proc);
VALUE rb_proc_call_with_block_kw(VALUE recv, int argc, const VALUE *argv, VALUE proc, int kw_splat);

I know little of TruffleRuby, but a quick search suggest VALUE rb_proc_call(VALUE recv, VALUE args) is the only implemented one.

@andrykonchin andrykonchin self-assigned this May 26, 2023
@eregon eregon linked a pull request May 30, 2023 that will close this issue
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Projects
None yet
Development

Successfully merging a pull request may close this issue.

4 participants