Subject: Re: bug#79257: 31.0.50; flymake's ruby-backend test fails with ruby 3.4.5

From: john muhl <[email-masked]>
Date: Tue, 26 Aug 2025 19:24:33 -0500

Dmitry Gutov <[email-masked]> writes:

> On 26/08/2025 17:08, john muhl wrote:
>> That output is from running ruby directly from the command line
>> not from ruby-flymake-simple. I had different ruby versions
>> installed to compare output and it was easier to do that from
>> outside Emacs and using the full path to the executable rather
>> than fiddling with PATH or messing with symlinks.
>>    $ cat test/lisp/progmodes/flymake-resources/test.rb | ruby -w -c
>>    -:3: warning: statement not reached
>>    ruby: -:5: syntax errors found (SyntaxError)
>>    $ cat test/lisp/progmodes/flymake-resources/test.rb |
>> /usr/bin/ruby -w -c
>>    -:3: warning: statement not reached
>>    /usr/bin/ruby: -:5: syntax errors found (SyntaxError)
>> r-f-s always does “ruby -w -c” like the first example so it
>> doesn’t get an absolute path in the output.
>
> Great! Thanks, I've shortened it.

(Oops. My test runners were offline and I mistook their silence
for success). I ran the tests on Fedora 42 and they’re still
broke. There I find:

  $ which ruby
  /usr/sbin/ruby

  $ cat /usr/sbin/ruby
  #!/usr/bin/bash
  declare -A INTERPRETER_LIST
  INTERPRETER_LIST=([_jruby_]=/usr/bin/jruby [_mri_]=/usr/bin/ruby-mri)
  ... many more lines

Which as you can see both turns “ruby” into an absolute path and
one that doesn’t actually end with “ruby” so the buffer r-f-s sees
is like this:

  -:3: warning: statement not reached
  /usr/bin/ruby-mri: -:5: syntax errors found (SyntaxError)
    3 |   print "not reached"
    4 |   something
    5 |   oops
      |       ^ unexpected end-of-input, assuming it is closing the parent top level context
    6 | 
      | ^ expected an `end` to close the `def` statement

I guess the INTERPRETER_LIST thing means there is even some way to
turn “ruby” into “/usr/bin/jruby” in the r-f-s buffer.