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

tty-prompt does not seem to work in ARM64 Mac Monterey jruby-9.3.3.0 #180

Open
AndyObtiva opened this issue Feb 10, 2022 · 0 comments
Open

Comments

@AndyObtiva
Copy link

Are you in the right place?

  • For issues or feature requests file a GitHub issue in this repository
  • For general questions or discussion post in Discussions

Describe the problem

A brief description of the issue/feature.

tty-prompt does not seem to work in ARM64 Mac Monterey under jruby

Steps to reproduce the problem

Your code here to reproduce the issue

Install jruby-9.3.3.0

Run the following gem which depends on tty-prompt:

gem install glimmer-dsl-swt
glimmer-setup

Open a new shell and run:

glimmer

Actual behaviour

What happened? This could be a description, log output, error raised etc...

The tty-prompt simply exits, sometimes returning disorganized output like this:

Glimmer (JRuby Desktop Development GUI Framework) - JRuby Gem: glimmer-dsl-swt v4.22.2.4

                                                                                        Usage: glimmer [--bundler] [--pd] [--quiet] [--debug] [--log-level=VALUE] [[ENV_VAR=VALUE]...] [[-jruby-option]...] (application.rb or task[task_args])

                           Runs Glimmer applications and tasks.

                                                               When applications are specified, they are run using JRuby,
                                                                                                                         automatically preloading the glimmer Ruby gem and SWT jar dependency.

                                                                                                                                                                                              Optionally, extra Glimmer options, JRuby options, and/or environment variables may be passed in.

                                                                          Glimmer options:
                                                                                          - "--bundler=GROUP"   : Activates gems in Bundler default group in Gemfile
                                                                                                                                                                    - "--pd=BOOLEAN"      : Requires puts_debuggerer to enable pd method
                    - "--quiet=BOOLEAN"   : Does not announce file path of Glimmer application being launched
                                                                                                             - "--debug"           : Displays extra debugging information, passes "--debug" to JRuby, and enables debug logging
           - "--log-level=VALUE" : Sets Glimmer's Ruby logger level ("ERROR" / "WARN" / "INFO" / "DEBUG"; default is none)

                                                                                                                          Tasks are run via rake. Some tasks take arguments in square brackets.

                                                                                                                                                                                               Available tasks are below (if you do not see any, please add `require 'glimmer/rake_task'` to Rakefile and rerun or run rake -T):

                                                                                                            Select a Glimmer task to run: (Press ↑/↓ arrow to move, Enter to select and letters to filter)
                                                                                                                                                                                                          ‣ glimmer list:gems:customshape[query]                       # List Glimmer custom shape gems available at rubygems.org (query is optional) [alt: list:gems:cp]
                                                                                                                                                       glimmer list:gems:customshell[query]                       # List Glimmer custom shell gems available at rubygems.org (query is optional) [alt: list:gems:cs]
                                                                                                  glimmer list:gems:customwidget[query]                      # List Glimmer custom widget gems available at rubygems.org (query is optional) [alt: list:gems:cw]
                                              glimmer list:gems:dsl[query]                               # List Glimmer DSL gems available at rubygems.org (query is optional)
                                                                                                                                                                                glimmer package[type]                                      # Package app for distribution (generating config, jar, and native files) (type is optional)
                                                                                                                     glimmer package:clean                                      # Clean by removing "dist" and "packages" directories
                   glimmer package:config                                     # Generate JAR config file
                                                                                                          glimmer package:gem                                        # Generate gem under pkg directory
                                                                                                                                                                                                         glimmer package:gemspec                                    # Generate gemspec
                                                                    glimmer package:jar                                        # Generate JAR file
                                                                                                                                                    glimmer package:lock_jars                                  # Lock JARs
        glimmer package:native[type]                               # Generate Native files
                                                                                            glimmer run[app_path]                                      # Runs Glimmer app or custom shell gem in the current directory, unless app_path is specified, then runs it instead (app_path is optional)
                                                                               glimmer samples                                            # Brings up the Glimmer Meta-Sample app to allow browsing, running, and viewing code of Glimmer samples
                               glimmer scaffold[app_name]                                 # Scaffold Glimmer application directory structure to build a new app
                                                                                                                                                                 glimmer scaffold:customshape[name,namespace]               # Scaffold Glimmer::UI::CustomShape subclass (part of a view) under app/views (namespace is optional) [alt: scaffold:cp]
                                                                                                                                  glimmer scaffold:customshell[name,namespace]               # Scaffold Glimmer::UI::CustomShell subclass (full window view) under app/views (namespace is optional) [alt: scaffold:cs]
                                                                                                     glimmer scaffold:customwidget[name,namespace]              # Scaffold Glimmer::UI::CustomWidget subclass (part of a view) under app/views (namespace is optional) [alt: scaffold:cw]
                                                                       glimmer scaffold:desktopify[app_name,website]              # Desktopify a web app
                                                                                                                                                          glimmer scaffold:gem:customshape[name,namespace]           # Scaffold Glimmer::UI::CustomShape subclass (part of a view) under its own Ruby gem project (namespace is required) [alt: scaffold:gem:cp]
                                                                                                                                              glimmer scaffold:gem:customshell[name,namespace]           # Scaffold Glimmer::UI::CustomShell subclass (full window view) under its own Ruby gem + app project (namespace is required) [alt: scaffold:gem:cs]
                                                                                                                                          glimmer scaffold:gem:customwidget[name,namespace]          # Scaffold Glimmer::UI::CustomWidget subclass (part of a view) under its own Ruby gem project (namespace is required) [alt: scaffold:gem:cw]NameError: undefined local variable or method `path' for #<IO:<STDIN>>
                                                                                                                                                                                                     ttymode_yield at /Users/andymaleh/.rvm/rubies/jruby-9.3.3.0/lib/ruby/stdlib/io/console/ffi/native_console.rb:35
                                                                                                            raw at /Users/andymaleh/.rvm/rubies/jruby-9.3.3.0/lib/ruby/stdlib/io/console/ffi/native_console.rb:56
                                                                                                                                                                                                                             raw at /Users/andymaleh/.rvm/gems/jruby-9.3.3.0/gems/tty-reader-0.9.0/lib/tty/reader/mode.rb:35
                                                                                                               get_char at /Users/andymaleh/.rvm/gems/jruby-9.3.3.0/gems/tty-reader-0.9.0/lib/tty/reader/console.rb:50
        get_codes at /Users/andymaleh/.rvm/gems/jruby-9.3.3.0/gems/tty-reader-0.9.0/lib/tty/reader.rb:210
                                                                                                           read_keypress at /Users/andymaleh/.rvm/gems/jruby-9.3.3.0/gems/tty-reader-0.9.0/lib/tty/reader.rb:186
                                                                                                                                                                                                                    unbufferred at /Users/andymaleh/.rvm/gems/jruby-9.3.3.0/gems/tty-reader-0.9.0/lib/tty/reader.rb:164
                                                                                                     read_keypress at /Users/andymaleh/.rvm/gems/jruby-9.3.3.0/gems/tty-reader-0.9.0/lib/tty/reader.rb:185
                                                                                                                                                                                                            read_keypress at /Users/andymaleh/.rvm/rubies/jruby-9.3.3.0/lib/ruby/stdlib/forwardable.rb:230
                                                                                               render at /Users/andymaleh/.rvm/gems/jruby-9.3.3.0/gems/tty-prompt-0.23.1/lib/tty/prompt/list.rb:454
                                                                                                                                                                                                              call at /Users/andymaleh/.rvm/gems/jruby-9.3.3.0/gems/tty-prompt-0.23.1/lib/tty/prompt/list.rb:245
                                                                                                  subscribe at /Users/andymaleh/.rvm/gems/jruby-9.3.3.0/gems/tty-reader-0.9.0/lib/tty/reader.rb:118
                                                                                                                                                                                                         subscribe at /Users/andymaleh/.rvm/rubies/jruby-9.3.3.0/lib/ruby/stdlib/forwardable.rb:230
                                                                                          call at /Users/andymaleh/.rvm/gems/jruby-9.3.3.0/gems/tty-prompt-0.23.1/lib/tty/prompt/list.rb:244
                                                                                                                                                                                              invoke_select at /Users/andymaleh/.rvm/gems/jruby-9.3.3.0/gems/tty-prompt-0.23.1/lib/tty/prompt.rb:249
                                                                                         select at /Users/andymaleh/.rvm/gems/jruby-9.3.3.0/gems/tty-prompt-0.23.1/lib/tty/prompt.rb:286
                                                                                                                                                                                                    run at /Users/andymaleh/.rvm/gems/jruby-9.3.3.0/gems/rake-tui-0.2.3/lib/rake-tui/ext/rake/tui.rb:86
                                                                                               run at /Users/andymaleh/.rvm/gems/jruby-9.3.3.0/gems/rake-tui-0.2.3/lib/rake-tui/ext/rake/tui.rb:39
                                                                                                                                                                                                    display_tasks at /Users/andymaleh/.rvm/gems/jruby-9.3.3.0/gems/glimmer-dsl-swt-4.22.2.4/lib/glimmer/launcher.rb:207
                                                                                                     display_usage at /Users/andymaleh/.rvm/gems/jruby-9.3.3.0/gems/glimmer-dsl-swt-4.22.2.4/lib/glimmer/launcher.rb:186
             launch at /Users/andymaleh/.rvm/gems/jruby-9.3.3.0/gems/glimmer-dsl-swt-4.22.2.4/lib/glimmer/launcher.rb:167
                                                                                                                                  <main> at /Users/andymaleh/.rvm/gems/jruby-9.3.3.0/gems/glimmer-dsl-swt-4.22.2.4/bin/glimmer:35
                        load at org/jruby/RubyKernel.java:1052
                                                                       <main> at /Users/andymaleh/.rvm/gems/jruby-9.3.3.0/bin/glimmer:25
                                                                                                                                                   eval at org/jruby/RubyKernel.java:1091
                                                                                                                                                                                                  <main> at /Users/andymaleh/.rvm/gems/jruby-9.3.3.0/bin/jruby_executable_hooks:22

Expected behaviour

What did you expect to happen?

Under x86_64 Mac Catalina or Linux, it works normally by showing a nice TUI like this:

Glimmer (JRuby Desktop Development GUI Framework) - JRuby Gem: glimmer-dsl-swt v4.22.2.4

Usage: glimmer [--bundler] [--pd] [--quiet] [--debug] [--log-level=VALUE] [[ENV_VAR=VALUE]...] [[-jruby-option]...] (application.rb or task[task_args])

Runs Glimmer applications and tasks.

When applications are specified, they are run using JRuby,
automatically preloading the glimmer Ruby gem and SWT jar dependency.

Optionally, extra Glimmer options, JRuby options, and/or environment variables may be passed in.

Glimmer options:
- "--bundler=GROUP"   : Activates gems in Bundler default group in Gemfile
- "--pd=BOOLEAN"      : Requires puts_debuggerer to enable pd method
- "--quiet=BOOLEAN"   : Does not announce file path of Glimmer application being launched
- "--debug"           : Displays extra debugging information, passes "--debug" to JRuby, and enables debug logging
- "--log-level=VALUE" : Sets Glimmer's Ruby logger level ("ERROR" / "WARN" / "INFO" / "DEBUG"; default is none)

Tasks are run via rake. Some tasks take arguments in square brackets.

Available tasks are below (if you do not see any, please add `require 'glimmer/rake_task'` to Rakefile and rerun or run rake -T):

Select a Glimmer task to run: (Press ↑/↓ arrow to move, Enter to select and letters to filter)
‣ glimmer list:gems:customshape[query]                       # List Glimmer custom shape gems available at rubygems.org (query is optional) [alt: list:gems:cp]
  glimmer list:gems:customshell[query]                       # List Glimmer custom shell gems available at rubygems.org (query is optional) [alt: list:gems:cs]
  glimmer list:gems:customwidget[query]                      # List Glimmer custom widget gems available at rubygems.org (query is optional) [alt: list:gems:cw]
  glimmer list:gems:dsl[query]                               # List Glimmer DSL gems available at rubygems.org (query is optional)
  glimmer package[type]                                      # Package app for distribution (generating config, jar, and native files) (type is optional)
  glimmer package:clean                                      # Clean by removing "dist" and "packages" directories
  glimmer package:config                                     # Generate JAR config file
  glimmer package:gem                                        # Generate gem under pkg directory
  glimmer package:gemspec                                    # Generate gemspec
  glimmer package:jar                                        # Generate JAR file
  glimmer package:lock_jars                                  # Lock JARs
  glimmer package:native[type]                               # Generate Native files
  glimmer run[app_path]                                      # Runs Glimmer app or custom shell gem in the current directory, unless app_path is specified, then runs it instead (app_path is optional)
  glimmer samples                                            # Brings up the Glimmer Meta-Sample app to allow browsing, running, and viewing code of Glimmer samples
  glimmer scaffold[app_name]                                 # Scaffold Glimmer application directory structure to build a new app
  glimmer scaffold:customshape[name,namespace]               # Scaffold Glimmer::UI::CustomShape subclass (part of a view) under app/views (namespace is optional) [alt: scaffold:cp]
  glimmer scaffold:customshell[name,namespace]               # Scaffold Glimmer::UI::CustomShell subclass (full window view) under app/views (namespace is optional) [alt: scaffold:cs]
  glimmer scaffold:customwidget[name,namespace]              # Scaffold Glimmer::UI::CustomWidget subclass (part of a view) under app/views (namespace is optional) [alt: scaffold:cw]
  glimmer scaffold:desktopify[app_name,website]              # Desktopify a web app
  glimmer scaffold:gem:customshape[name,namespace]           # Scaffold Glimmer::UI::CustomShape subclass (part of a view) under its own Ruby gem project (namespace is required) [alt: scaffold:gem:cp]
  glimmer scaffold:gem:customshell[name,namespace]           # Scaffold Glimmer::UI::CustomShell subclass (full window view) under its own Ruby gem + app project (namespace is required) [alt: scaffold:gem:cs]

Describe your environment

  • OS version: Mac Monterey ARM64
  • Ruby version: jruby-9.3.3.0
  • TTY::Prompt version: 0.23.1
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

1 participant