oracle / truffleruby

A high performance implementation of the Ruby programming language, built on GraalVM.
https://www.graalvm.org/ruby/
Other
3.01k stars 184 forks source link

pty is missing in the standard library #1589

Open deepj opened 5 years ago

deepj commented 5 years ago

See https://ruby-doc.org/stdlib-2.0.0/libdoc/pty/rdoc/PTY.html

To reproduce:

require 'pty'

Error:

LoadError: cannot load such file -- pty
    from ~/.rubies/truffleruby-1.0.0-rc12/lib/mri/rubygems/core_ext/kernel_require.rb:55:in `gem_original_require'
    from ~/.rubies/truffleruby-1.0.0-rc12/lib/mri/rubygems/core_ext/kernel_require.rb:55:in `require'
    from (irb):1
    from ~/.rubies/truffleruby-1.0.0-rc12/bin/irb:29:in `<main>'

This gem is used in querly tests

chrisseaton commented 5 years ago

I'm just working on updating our documentation on standard libraries.

Standard libraries

The following standard libraries are unsupported.

fiddle is not yet implemented - the module and some methods are there but not enough to run anything serious.

We provide our own included implementation of the interface of the ffi gem, like JRuby and Rubinius, but the implemention of this is limited at the moment.

EDIT: See https://github.com/oracle/truffleruby/blob/master/doc/user/compatibility.md#standard-libraries for up-to-date info.

eregon commented 3 years ago

pty is used by the tests of the debug gem: https://github.com/ruby/debug/blob/d0a3372a864d3906ac2a81907b9222dba15883be/test/support/utils.rb#L3

It would be worth trying if importing the pty sources from CRuby works.

eregon commented 3 years ago

@bjfish Could you try that?

matthewford commented 1 year ago

also causes an issue with the appsignal apm

matthewford commented 1 year ago

wicked_pdf gem also use pty

chrisseaton commented 1 year ago

I have a PR partially done to add pty - will take a look at it again. It's also needed to run the debug gem tests.

eregon commented 1 year ago

JRuby recently used libfixposix to get pty working in https://github.com/jruby/jruby/issues/6552, possibly relevant for us, as from reading that issue posix_spawn doesn't have that ability. But we could probably also do it in https://github.com/oracle/truffleruby/blob/master/src/main/c/spawn-helper/spawn-helper.c and that would be simpler/more direct.

eregon commented 1 year ago

As a note, using the pty extension won't work because that relies on fork()