Skip to content

Commit

Permalink
Support native console in linux aarch64 for JRuby
Browse files Browse the repository at this point in the history
I am running JRuby on a Linux aarch64.

I can see the `io/console/ffi/stty_console` is being loaded based on the warning message:
"io/console on JRuby shells out to stty for most operations"

If I manually require `io/console/ffi/native_console` it fails due to the
platform guard at the top of the file.

However, if I remove that guard it, it loads and works fine in my brief testing.

In ruby#40, @headius confirmed there is no reason not to allow aarch64, so
adding it in this PR. Closes ruby#40.
  • Loading branch information
PChambino committed Mar 9, 2023
1 parent 8eabe32 commit 21af713
Showing 1 changed file with 3 additions and 1 deletion.
4 changes: 3 additions & 1 deletion lib/io/console/ffi/linux_console.rb
Original file line number Diff line number Diff line change
@@ -1,6 +1,8 @@
require 'ffi'

raise LoadError.new("native console only supported on i386, x86_64 and powerpc64") unless FFI::Platform::ARCH =~ /i386|x86_64|powerpc64/
unless FFI::Platform::ARCH =~ /i386|x86_64|powerpc64|aarch64/
raise LoadError.new("native console only supported on i386, x86_64, powerpc64 and aarch64")
end

module IO::LibC
extend FFI::Library
Expand Down

0 comments on commit 21af713

Please sign in to comment.