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

pty is missing in the standard library #1589

Open
deepj opened this issue Feb 23, 2019 · 8 comments
Open

pty is missing in the standard library #1589

deepj opened this issue Feb 23, 2019 · 8 comments

Comments

@deepj
Copy link

deepj commented Feb 23, 2019

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
Copy link
Collaborator

chrisseaton commented Feb 23, 2019

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

Standard libraries

The following standard libraries are unsupported.

  • continuation
  • dbm
  • gdbm
  • sdbm
  • io/console (partially implemented, could be implemented in the future)
  • io/nonblock (could be implemented in the future)
  • io/wait (partially implemented, could be implemented in the future)
  • pty (could be implemented in the future)
  • ripper (could be implemented in the future)
  • win32
  • win32ole

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
Copy link
Member

eregon commented Aug 21, 2021

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
Copy link
Member

eregon commented Aug 22, 2021

@bjfish Could you try that?

@matthewford
Copy link

also causes an issue with the appsignal apm

@matthewford
Copy link

wicked_pdf gem also use pty

@chrisseaton
Copy link
Collaborator

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
Copy link
Member

eregon commented Nov 18, 2022

JRuby recently used libfixposix to get pty working in jruby/jruby#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
Copy link
Member

eregon commented Mar 17, 2023

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

@eregon eregon removed their assignment Mar 13, 2024
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

No branches or pull requests

5 participants