GNU bug report logs - #79257
31.0.50; flymake's ruby-backend test fails with ruby 3.4.5

Previous Next

Package: emacs;

Reported by: john muhl <jm <at> pub.pink>

Date: Sat, 16 Aug 2025 20:18:01 UTC

Severity: normal

Found in version 31.0.50

Done: Dmitry Gutov <dmitry <at> gutov.dev>

Full log


Message #46 received at 79257 <at> debbugs.gnu.org (full text, mbox):

From: john muhl <jm <at> pub.pink>
To: Dmitry Gutov <dmitry <at> gutov.dev>
Cc: 79257 <at> debbugs.gnu.org
Subject: Re: bug#79257: 31.0.50; flymake's ruby-backend test fails with ruby
 3.4.5
Date: Wed, 27 Aug 2025 08:42:23 -0500
Dmitry Gutov <dmitry <at> gutov.dev> writes:

> On 27/08/2025 03:24, john muhl wrote:
>> (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.
>
> All right, so Fedora expands the file name (probably substituting a 
> specific interpreter from the "alternatives" system).
>
> Maybe we should try to be clever, relaxing the match but stopping it 
> from going too far, like this:
>
> diff --git a/lisp/progmodes/ruby-mode.el b/lisp/progmodes/ruby-mode.el
> index 0a6ead870a7..459f8f338f7 100644
> --- a/lisp/progmodes/ruby-mode.el
> +++ b/lisp/progmodes/ruby-mode.el
> @@ -2516,7 +2516,7 @@ ruby-flymake-simple
>        (goto-char (point-min))
>        (cl-loop
>         while (search-forward-regexp
> -             "^\\(?:ruby: \\)?\\(?:.*\\.rb\\|-\\):\\([0-9]+\\): \\(.*\\)$"
> +             "^\\(?:[^:|]+: \\)?\\(?:.*\\.rb\\|-\\):\\([0-9]+\\): 
> \\(.*\\)$"
>                nil t)
>         for msg = (match-string 2)
>         for (beg . end) = (flymake-diag-region

Thanks. That works here for Ruby 3.4.x on Alpine, Fedora and Void.




This bug report was last modified 15 days ago.

Previous Next


GNU bug tracking system
Copyright (C) 1999 Darren O. Benham, 1997,2003 nCipher Corporation Ltd, 1994-97 Ian Jackson.