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>
To reply to this bug, email your comments to 79257 AT debbugs.gnu.org.
There is no need to reopen the bug first.
Toggle the display of automated, internal messages from the tracker.
View this report as an mbox folder, status mbox, maintainer mbox
bug-gnu-emacs <at> gnu.org
:bug#79257
; Package emacs
.
(Sat, 16 Aug 2025 20:18:01 GMT) Full text and rfc822 format available.john muhl <jm <at> pub.pink>
:bug-gnu-emacs <at> gnu.org
.
(Sat, 16 Aug 2025 20:18:02 GMT) Full text and rfc822 format available.Message #5 received at submit <at> debbugs.gnu.org (full text, mbox):
From: john muhl <jm <at> pub.pink> To: bug-gnu-emacs <at> gnu.org Subject: 31.0.50; flymake's ruby-backend test fails with ruby 3.4.5 Date: Sat, 16 Aug 2025 15:17:28 -0500
The test passes with Ruby 3.3.8: $ ruby --version ruby 3.3.8 (2025-04-09 revision b200bad6cd) [x86_64-linux-gnu] $ make -C test lisp/progmodes/flymake-tests.log make: Entering directory '/root/emacs/test' GEN lisp/progmodes/flymake-tests.log make: Leaving directory '/root/emacs/test' $ cat test/lisp/progmodes/flymake-tests.log Running 10 tests (2025-08-16 20:14:31+0000, selector `(not (or (tag :unstable) (tag :nativecomp)))') passed 1/10 different-diagnostic-types (1.064348 sec) passed 2/10 dummy-backends (1.001868 sec) passed 3/10 eob-region-and-trailing-newline (0.000263 sec) passed 4/10 foreign-diagnostics (2.039984 sec) passed 5/10 included-c-header-files (2.038547 sec) passed 6/10 perl-backend (1.013309 sec) passed 7/10 recurrent-backend (1.002002 sec) passed 8/10 ruby-backend (1.015112 sec) passed 9/10 warning-predicate-function-gcc (1.017387 sec) passed 10/10 warning-predicate-rx-gcc (1.019503 sec) Ran 10 tests, 10 results as expected, 0 unexpected (2025-08-16 20:14:42+0000, 11.213646 sec) Then fails with 3.4.5: $ ruby --version ruby 3.4.5 (2025-07-16 revision 20cda200d3) +PRISM [x86_64-linux] $ make -C test lisp/progmodes/flymake-tests.log make[1]: Entering directory '/root/emacs/test' GEN lisp/progmodes/flymake-tests.log Running 10 tests (2025-08-16 20:09:51+0000, selector `(not (or (tag :unstable) (tag :nativecomp)))') passed 1/10 different-diagnostic-types (1.066408 sec) passed 2/10 dummy-backends (1.001843 sec) passed 3/10 eob-region-and-trailing-newline (0.000216 sec) passed 4/10 foreign-diagnostics (2.041202 sec) passed 5/10 included-c-header-files (2.038718 sec) passed 6/10 perl-backend (1.014080 sec) passed 7/10 recurrent-backend (1.002050 sec) Test ruby-backend backtrace: signal(ert-test-failed (((should (eq 'flymake-error (face-at-point)) ert-fail(((should (eq 'flymake-error (face-at-point))) :form (eq fly (if (unwind-protect (setq value-41 (apply fn-39 args-40)) (setq form (let (form-description-43) (if (unwind-protect (setq value-41 (apply (let ((value-41 'ert-form-evaluation-aborted-42)) (let (form-descrip (let* ((fn-39 #'eq) (args-40 (condition-case err (list 'flymake-erro #f(lambda () [t] (flymake-goto-next-error) (let* ((fn-34 #'eq) (args funcall(#f(lambda () [t] (flymake-goto-next-error) (let* ((fn-34 #'e (save-excursion (if sev-pred-supplied-p (progn (setq flymake-proc-di (save-current-buffer (set-buffer buffer) (save-excursion (if sev-pre (unwind-protect (save-current-buffer (set-buffer buffer) (save-excur (let* ((file (expand-file-name file flymake-tests-data-directory)) ( (progn (let ((--cl-keys-- --cl-rest--)) (while --cl-keys-- (cond ((m (let* ((sev-pred-supplied-p (plist-member --cl-rest-- ':severity-pre flymake-tests--call-with-fixture(#f(lambda () [t] (flymake-goto-next (let* ((process-environment (cons (format "HOME=%s" tempdir) process (progn (let* ((process-environment (cons (format "HOME=%s" tempdir) (unwind-protect (progn (let* ((process-environment (cons (format "HO (let* ((coding-system-for-write nil) (temp-file (file-name-as-direct #f(lambda () [ruby-mode-hook t] (let* ((fn-29 #'executable-find) (ar #f(compiled-function () #<bytecode 0xf2de8ace0c80c71>)() handler-bind-1(#f(compiled-function () #<bytecode 0xf2de8ace0c80c71> ert--run-test-internal(#s(ert--test-execution-info :test #s(ert-test ert-run-test(#s(ert-test :name ruby-backend :documentation "Test the ert-run-or-rerun-test(#s(ert--stats :selector ... :tests ... :test-m ert-run-tests((not (or (tag :unstable) (tag :nativecomp))) #f(compil ert-run-tests-batch((not (or (tag :unstable) (tag :nativecomp)))) ert-run-tests-batch-and-exit((not (or (tag :unstable) (tag :nativeco eval((ert-run-tests-batch-and-exit '(not (or (tag :unstable) (tag :n command-line-1(("-L" ":." "-l" "ert" "--eval" "(setq treesit-extra-l command-line() normal-top-level() Test ruby-backend condition: (ert-test-failed ((should (eq 'flymake-error (face-at-point))) :form (eq flymake-error flymake-warning) :value nil)) FAILED 8/10 ruby-backend (1.013506 sec) at lisp/progmodes/flymake-tests.el:123 passed 9/10 warning-predicate-function-gcc (1.017136 sec) passed 10/10 warning-predicate-rx-gcc (1.019550 sec) Ran 10 tests, 9 results as expected, 1 unexpected (2025-08-16 20:10:02+0000, 11.275721 sec) 1 unexpected results: FAILED ruby-backend
bug-gnu-emacs <at> gnu.org
:bug#79257
; Package emacs
.
(Sun, 24 Aug 2025 16:36:01 GMT) Full text and rfc822 format available.Message #8 received at 79257 <at> debbugs.gnu.org (full text, mbox):
From: john muhl <jm <at> pub.pink> To: 79257 <at> debbugs.gnu.org Subject: Re: bug#79257: 31.0.50; flymake's ruby-backend test fails with ruby 3.4.5 Date: Sun, 24 Aug 2025 11:35:05 -0500
[Message part 1 (text/plain, inline)]
The cause is a change in the check output of new Ruby versions which include the location of the executable; e.g. # Ruby 3.3.8 -:3: warning: statement not reached -:6: syntax error, unexpected end-of-input, expecting `end' or dummy end # Ruby 3.4.5 -:3: warning: statement not reached /usr/bin/ruby: -:5: syntax errors found (SyntaxError) Here’s a patch that updates the regex to account for it. Tests pass with both Ruby 3.3 and 3.4.
[0001-Fix-ruby-flymake-simple-for-Ruby-3.4-Bug-79257.patch (text/x-patch, attachment)]
[Message part 3 (text/plain, inline)]
john muhl <jm <at> pub.pink> writes: > The test passes with Ruby 3.3.8: > > $ ruby --version > ruby 3.3.8 (2025-04-09 revision b200bad6cd) [x86_64-linux-gnu] > > $ make -C test lisp/progmodes/flymake-tests.log > make: Entering directory '/root/emacs/test' > GEN lisp/progmodes/flymake-tests.log > make: Leaving directory '/root/emacs/test' > > $ cat test/lisp/progmodes/flymake-tests.log > Running 10 tests (2025-08-16 20:14:31+0000, selector `(not (or (tag :unstable) (tag :nativecomp)))') > passed 1/10 different-diagnostic-types (1.064348 sec) > passed 2/10 dummy-backends (1.001868 sec) > passed 3/10 eob-region-and-trailing-newline (0.000263 sec) > passed 4/10 foreign-diagnostics (2.039984 sec) > passed 5/10 included-c-header-files (2.038547 sec) > passed 6/10 perl-backend (1.013309 sec) > passed 7/10 recurrent-backend (1.002002 sec) > passed 8/10 ruby-backend (1.015112 sec) > passed 9/10 warning-predicate-function-gcc (1.017387 sec) > passed 10/10 warning-predicate-rx-gcc (1.019503 sec) > > Ran 10 tests, 10 results as expected, 0 unexpected (2025-08-16 20:14:42+0000, 11.213646 sec) > > Then fails with 3.4.5: > > $ ruby --version > ruby 3.4.5 (2025-07-16 revision 20cda200d3) +PRISM [x86_64-linux] > > $ make -C test lisp/progmodes/flymake-tests.log > make[1]: Entering directory '/root/emacs/test' > GEN lisp/progmodes/flymake-tests.log > Running 10 tests (2025-08-16 20:09:51+0000, selector `(not (or (tag :unstable) (tag :nativecomp)))') > passed 1/10 different-diagnostic-types (1.066408 sec) > passed 2/10 dummy-backends (1.001843 sec) > passed 3/10 eob-region-and-trailing-newline (0.000216 sec) > passed 4/10 foreign-diagnostics (2.041202 sec) > passed 5/10 included-c-header-files (2.038718 sec) > passed 6/10 perl-backend (1.014080 sec) > passed 7/10 recurrent-backend (1.002050 sec) > Test ruby-backend backtrace: > signal(ert-test-failed (((should (eq 'flymake-error (face-at-point)) > ert-fail(((should (eq 'flymake-error (face-at-point))) :form (eq fly > (if (unwind-protect (setq value-41 (apply fn-39 args-40)) (setq form > (let (form-description-43) (if (unwind-protect (setq value-41 (apply > (let ((value-41 'ert-form-evaluation-aborted-42)) (let (form-descrip > (let* ((fn-39 #'eq) (args-40 (condition-case err (list 'flymake-erro > #f(lambda () [t] (flymake-goto-next-error) (let* ((fn-34 #'eq) (args > funcall(#f(lambda () [t] (flymake-goto-next-error) (let* ((fn-34 #'e > (save-excursion (if sev-pred-supplied-p (progn (setq flymake-proc-di > (save-current-buffer (set-buffer buffer) (save-excursion (if sev-pre > (unwind-protect (save-current-buffer (set-buffer buffer) (save-excur > (let* ((file (expand-file-name file flymake-tests-data-directory)) ( > (progn (let ((--cl-keys-- --cl-rest--)) (while --cl-keys-- (cond ((m > (let* ((sev-pred-supplied-p (plist-member --cl-rest-- ':severity-pre > flymake-tests--call-with-fixture(#f(lambda () [t] (flymake-goto-next > (let* ((process-environment (cons (format "HOME=%s" tempdir) process > (progn (let* ((process-environment (cons (format "HOME=%s" tempdir) > (unwind-protect (progn (let* ((process-environment (cons (format "HO > (let* ((coding-system-for-write nil) (temp-file (file-name-as-direct > #f(lambda () [ruby-mode-hook t] (let* ((fn-29 #'executable-find) (ar > #f(compiled-function () #<bytecode 0xf2de8ace0c80c71>)() > handler-bind-1(#f(compiled-function () #<bytecode 0xf2de8ace0c80c71> > ert--run-test-internal(#s(ert--test-execution-info :test #s(ert-test > ert-run-test(#s(ert-test :name ruby-backend :documentation "Test the > ert-run-or-rerun-test(#s(ert--stats :selector ... :tests ... :test-m > ert-run-tests((not (or (tag :unstable) (tag :nativecomp))) #f(compil > ert-run-tests-batch((not (or (tag :unstable) (tag :nativecomp)))) > ert-run-tests-batch-and-exit((not (or (tag :unstable) (tag :nativeco > eval((ert-run-tests-batch-and-exit '(not (or (tag :unstable) (tag :n > command-line-1(("-L" ":." "-l" "ert" "--eval" "(setq treesit-extra-l > command-line() > normal-top-level() > Test ruby-backend condition: > (ert-test-failed > ((should (eq 'flymake-error (face-at-point))) :form > (eq flymake-error flymake-warning) :value nil)) > FAILED 8/10 ruby-backend (1.013506 sec) at lisp/progmodes/flymake-tests.el:123 > passed 9/10 warning-predicate-function-gcc (1.017136 sec) > passed 10/10 warning-predicate-rx-gcc (1.019550 sec) > > Ran 10 tests, 9 results as expected, 1 unexpected (2025-08-16 20:10:02+0000, 11.275721 sec) > > 1 unexpected results: > FAILED ruby-backend
bug-gnu-emacs <at> gnu.org
:bug#79257
; Package emacs
.
(Mon, 25 Aug 2025 19:50:01 GMT) Full text and rfc822 format available.Message #11 received at 79257 <at> debbugs.gnu.org (full text, mbox):
From: Dmitry Gutov <dmitry <at> gutov.dev> To: john muhl <jm <at> pub.pink>, 79257 <at> debbugs.gnu.org Subject: Re: bug#79257: 31.0.50; flymake's ruby-backend test fails with ruby 3.4.5 Date: Mon, 25 Aug 2025 22:49:37 +0300
Hi! On 24/08/2025 19:35, john muhl wrote: > The cause is a change in the check output of new Ruby versions > which include the location of the executable; e.g. > > # Ruby 3.3.8 > -:3: warning: statement not reached > -:6: syntax error, unexpected end-of-input, expecting `end' or dummy end > > # Ruby 3.4.5 > -:3: warning: statement not reached > /usr/bin/ruby: -:5: syntax errors found (SyntaxError) > > Here’s a patch that updates the regex to account for it. Tests > pass with both Ruby 3.3 and 3.4. Thanks, that works, I've pushed the change to master. Curiously, in my testing with ruby 3.4.5 the executable name is not absolute, just 'ruby: '. That still works with your change. I wonder if you've managed to find the specific commit in Ruby that did that (or bugs.ruby-lang.org entry). This change log mentions some other changes in the output, but not this: https://www.ruby-lang.org/en/news/2024/12/25/ruby-3-4-0-released/ > - "^\\(?:.*\\.rb\\|-\\):\\([0-9]+\\): \\(.*\\)$" > + "^\\(?:.*ruby: \\)?\\(?:.*\\.rb\\|-\\):\\([0-9]+\\): \\(.*\\)$" We could also make the first wildcard non-greedy (.*?). Perhaps put an initial slash before it too, for faster matching, but I'm not sure how your variant of the output will look on Windows (perhaps it starts with 'c:/').
bug-gnu-emacs <at> gnu.org
:bug#79257
; Package emacs
.
(Mon, 25 Aug 2025 21:24:02 GMT) Full text and rfc822 format available.Message #14 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: Mon, 25 Aug 2025 16:23:16 -0500
Dmitry Gutov <dmitry <at> gutov.dev> writes: > Hi! > > On 24/08/2025 19:35, john muhl wrote: >> The cause is a change in the check output of new Ruby versions >> which include the location of the executable; e.g. >> # Ruby 3.3.8 >> -:3: warning: statement not reached >> -:6: syntax error, unexpected end-of-input, expecting `end' or dummy end >> # Ruby 3.4.5 >> -:3: warning: statement not reached >> /usr/bin/ruby: -:5: syntax errors found (SyntaxError) >> Here’s a patch that updates the regex to account for it. Tests >> pass with both Ruby 3.3 and 3.4. > > Thanks, that works, I've pushed the change to master. > > Curiously, in my testing with ruby 3.4.5 the executable name is not > absolute, just 'ruby: '. That still works with your change. It seems to output however ruby gets invoked; e.g. $ /usr/bin/ruby -wc o.rb vs. $ ruby -wc o.rb > I wonder if you've managed to find the specific commit in Ruby that > did that (or bugs.ruby-lang.org entry). > This change log mentions some other changes in the output, but not > this: > https://www.ruby-lang.org/en/news/2024/12/25/ruby-3-4-0-released/ No. At first I thought it was something to do with the switch to the prism parser but using --parser=parse.y doesn’t change that part of the output. >> - "^\\(?:.*\\.rb\\|-\\):\\([0-9]+\\): \\(.*\\)$" >> + "^\\(?:.*ruby: \\)?\\(?:.*\\.rb\\|-\\):\\([0-9]+\\): > \\(.*\\)$" > > We could also make the first wildcard non-greedy (.*?). > > Perhaps put an initial slash before it too, for faster matching, but > I'm not sure how your variant of the output will look on Windows > (perhaps it starts with 'c:/'). Unfortunately I have no way to test Windows stuff.
bug-gnu-emacs <at> gnu.org
:bug#79257
; Package emacs
.
(Tue, 26 Aug 2025 02:01:01 GMT) Full text and rfc822 format available.Message #17 received at 79257 <at> debbugs.gnu.org (full text, mbox):
From: Dmitry Gutov <dmitry <at> gutov.dev> To: john muhl <jm <at> pub.pink> 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: Tue, 26 Aug 2025 05:00:11 +0300
On 26/08/2025 00:23, john muhl wrote: >> Curiously, in my testing with ruby 3.4.5 the executable name is not >> absolute, just 'ruby: '. That still works with your change. > > It seems to output however ruby gets invoked; e.g. > > $ /usr/bin/ruby -wc o.rb > vs. > $ ruby -wc o.rb Ah yeah, that happens. It's different when going through rbenv's shim. I can invoke /home/dgutov/.rbenv/shims/ruby in full, the output will just have 'ruby'. >> I wonder if you've managed to find the specific commit in Ruby that >> did that (or bugs.ruby-lang.org entry). >> This change log mentions some other changes in the output, but not >> this: >> https://www.ruby-lang.org/en/news/2024/12/25/ruby-3-4-0-released/ > > No. At first I thought it was something to do with the switch to > the prism parser but using --parser=parse.y doesn’t change that > part of the output. Thanks for trying.
bug-gnu-emacs <at> gnu.org
:bug#79257
; Package emacs
.
(Tue, 26 Aug 2025 02:32:01 GMT) Full text and rfc822 format available.Message #20 received at 79257 <at> debbugs.gnu.org (full text, mbox):
From: Eli Zaretskii <eliz <at> gnu.org> To: john muhl <jm <at> pub.pink> Cc: dmitry <at> gutov.dev, 79257 <at> debbugs.gnu.org Subject: Re: bug#79257: 31.0.50; flymake's ruby-backend test fails with ruby 3.4.5 Date: Tue, 26 Aug 2025 05:31:18 +0300
> Cc: 79257 <at> debbugs.gnu.org > From: john muhl <jm <at> pub.pink> > Date: Mon, 25 Aug 2025 16:23:16 -0500 > > Dmitry Gutov <dmitry <at> gutov.dev> writes: > > > Hi! > > > > On 24/08/2025 19:35, john muhl wrote: > >> The cause is a change in the check output of new Ruby versions > >> which include the location of the executable; e.g. > >> # Ruby 3.3.8 > >> -:3: warning: statement not reached > >> -:6: syntax error, unexpected end-of-input, expecting `end' or dummy end > >> # Ruby 3.4.5 > >> -:3: warning: statement not reached > >> /usr/bin/ruby: -:5: syntax errors found (SyntaxError) > >> Here’s a patch that updates the regex to account for it. Tests > >> pass with both Ruby 3.3 and 3.4. > > > > Thanks, that works, I've pushed the change to master. > > > > Curiously, in my testing with ruby 3.4.5 the executable name is not > > absolute, just 'ruby: '. That still works with your change. > > It seems to output however ruby gets invoked; e.g. > > $ /usr/bin/ruby -wc o.rb > vs. > $ ruby -wc o.rb > > > I wonder if you've managed to find the specific commit in Ruby that > > did that (or bugs.ruby-lang.org entry). > > This change log mentions some other changes in the output, but not > > this: > > https://www.ruby-lang.org/en/news/2024/12/25/ruby-3-4-0-released/ > > No. At first I thought it was something to do with the switch to > the prism parser but using --parser=parse.y doesn’t change that > part of the output. > > >> - "^\\(?:.*\\.rb\\|-\\):\\([0-9]+\\): \\(.*\\)$" > >> + "^\\(?:.*ruby: \\)?\\(?:.*\\.rb\\|-\\):\\([0-9]+\\): > > \\(.*\\)$" > > > > We could also make the first wildcard non-greedy (.*?). > > > > Perhaps put an initial slash before it too, for faster matching, but > > I'm not sure how your variant of the output will look on Windows > > (perhaps it starts with 'c:/'). > > Unfortunately I have no way to test Windows stuff. If an absolute file name is expected there, we should allow it to begin with a drive letter on Windows.
bug-gnu-emacs <at> gnu.org
:bug#79257
; Package emacs
.
(Tue, 26 Aug 2025 03:47:01 GMT) Full text and rfc822 format available.Message #23 received at 79257 <at> debbugs.gnu.org (full text, mbox):
From: john muhl <jm <at> pub.pink> To: Eli Zaretskii <eliz <at> gnu.org> Cc: dmitry <at> gutov.dev, 79257 <at> debbugs.gnu.org Subject: Re: bug#79257: 31.0.50; flymake's ruby-backend test fails with ruby 3.4.5 Date: Mon, 25 Aug 2025 22:46:40 -0500
Eli Zaretskii <eliz <at> gnu.org> writes: >> Cc: 79257 <at> debbugs.gnu.org >> From: john muhl <jm <at> pub.pink> >> Date: Mon, 25 Aug 2025 16:23:16 -0500 >> >> Dmitry Gutov <dmitry <at> gutov.dev> writes: >> >> > Hi! >> > >> > On 24/08/2025 19:35, john muhl wrote: >> >> The cause is a change in the check output of new Ruby versions >> >> which include the location of the executable; e.g. >> >> # Ruby 3.3.8 >> >> -:3: warning: statement not reached >> >> -:6: syntax error, unexpected end-of-input, expecting `end' or dummy end >> >> # Ruby 3.4.5 >> >> -:3: warning: statement not reached >> >> /usr/bin/ruby: -:5: syntax errors found (SyntaxError) >> >> Here’s a patch that updates the regex to account for it. Tests >> >> pass with both Ruby 3.3 and 3.4. >> > >> > Thanks, that works, I've pushed the change to master. >> > >> > Curiously, in my testing with ruby 3.4.5 the executable name is not >> > absolute, just 'ruby: '. That still works with your change. >> >> It seems to output however ruby gets invoked; e.g. >> >> $ /usr/bin/ruby -wc o.rb >> vs. >> $ ruby -wc o.rb >> >> > I wonder if you've managed to find the specific commit in Ruby that >> > did that (or bugs.ruby-lang.org entry). >> > This change log mentions some other changes in the output, but not >> > this: >> > https://www.ruby-lang.org/en/news/2024/12/25/ruby-3-4-0-released/ >> >> No. At first I thought it was something to do with the switch to >> the prism parser but using --parser=parse.y doesn’t change that >> part of the output. >> >> >> - "^\\(?:.*\\.rb\\|-\\):\\([0-9]+\\): \\(.*\\)$" >> >> + "^\\(?:.*ruby: \\)?\\(?:.*\\.rb\\|-\\):\\([0-9]+\\): >> > \\(.*\\)$" >> > >> > We could also make the first wildcard non-greedy (.*?). >> > >> > Perhaps put an initial slash before it too, for faster matching, but >> > I'm not sure how your variant of the output will look on Windows >> > (perhaps it starts with 'c:/'). >> >> Unfortunately I have no way to test Windows stuff. > > If an absolute file name is expected there, we should allow it to > begin with a drive letter on Windows. I don’t think it ever happens that ruby-flymake-simple would get an absolute path in the output. If you look there you’ll see it calls plain “ruby -w -c” (and I don’t see anyway to customize that) so it will just have “ruby: ” in the output. You have to call Ruby with an absolute path to get one in the output. It shouldn’t break anything to drop the first “.*”.
bug-gnu-emacs <at> gnu.org
:bug#79257
; Package emacs
.
(Tue, 26 Aug 2025 12:23:02 GMT) Full text and rfc822 format available.Message #26 received at 79257 <at> debbugs.gnu.org (full text, mbox):
From: Eli Zaretskii <eliz <at> gnu.org> To: john muhl <jm <at> pub.pink> Cc: dmitry <at> gutov.dev, 79257 <at> debbugs.gnu.org Subject: Re: bug#79257: 31.0.50; flymake's ruby-backend test fails with ruby 3.4.5 Date: Tue, 26 Aug 2025 15:22:04 +0300
> From: john muhl <jm <at> pub.pink> > Cc: dmitry <at> gutov.dev, 79257 <at> debbugs.gnu.org > Date: Mon, 25 Aug 2025 22:46:40 -0500 > > Eli Zaretskii <eliz <at> gnu.org> writes: > > >> Cc: 79257 <at> debbugs.gnu.org > >> From: john muhl <jm <at> pub.pink> > >> Date: Mon, 25 Aug 2025 16:23:16 -0500 > >> > >> Dmitry Gutov <dmitry <at> gutov.dev> writes: > >> > >> > Hi! > >> > > >> > On 24/08/2025 19:35, john muhl wrote: > >> >> The cause is a change in the check output of new Ruby versions > >> >> which include the location of the executable; e.g. > >> >> # Ruby 3.3.8 > >> >> -:3: warning: statement not reached > >> >> -:6: syntax error, unexpected end-of-input, expecting `end' or dummy end > >> >> # Ruby 3.4.5 > >> >> -:3: warning: statement not reached > >> >> /usr/bin/ruby: -:5: syntax errors found (SyntaxError) > >> >> Here’s a patch that updates the regex to account for it. Tests > >> >> pass with both Ruby 3.3 and 3.4. > >> > > >> > Thanks, that works, I've pushed the change to master. > >> > > >> > Curiously, in my testing with ruby 3.4.5 the executable name is not > >> > absolute, just 'ruby: '. That still works with your change. > >> > >> It seems to output however ruby gets invoked; e.g. > >> > >> $ /usr/bin/ruby -wc o.rb > >> vs. > >> $ ruby -wc o.rb > >> > >> > I wonder if you've managed to find the specific commit in Ruby that > >> > did that (or bugs.ruby-lang.org entry). > >> > This change log mentions some other changes in the output, but not > >> > this: > >> > https://www.ruby-lang.org/en/news/2024/12/25/ruby-3-4-0-released/ > >> > >> No. At first I thought it was something to do with the switch to > >> the prism parser but using --parser=parse.y doesn’t change that > >> part of the output. > >> > >> >> - "^\\(?:.*\\.rb\\|-\\):\\([0-9]+\\): \\(.*\\)$" > >> >> + "^\\(?:.*ruby: \\)?\\(?:.*\\.rb\\|-\\):\\([0-9]+\\): > >> > \\(.*\\)$" > >> > > >> > We could also make the first wildcard non-greedy (.*?). > >> > > >> > Perhaps put an initial slash before it too, for faster matching, but > >> > I'm not sure how your variant of the output will look on Windows > >> > (perhaps it starts with 'c:/'). > >> > >> Unfortunately I have no way to test Windows stuff. > > > > If an absolute file name is expected there, we should allow it to > > begin with a drive letter on Windows. > > I don’t think it ever happens that ruby-flymake-simple would get > an absolute path in the output. If you look there you’ll see it > calls plain “ruby -w -c” (and I don’t see anyway to customize > that) so it will just have “ruby: ” in the output. You have to > call Ruby with an absolute path to get one in the output. In the example you brought up, I see /usr/bin/ruby: -:5: syntax errors found (SyntaxError) The "/usr/bin/ruby" part is an absolute file name. Apologies if I'm confused.
bug-gnu-emacs <at> gnu.org
:bug#79257
; Package emacs
.
(Tue, 26 Aug 2025 14:09:02 GMT) Full text and rfc822 format available.Message #29 received at 79257 <at> debbugs.gnu.org (full text, mbox):
From: john muhl <jm <at> pub.pink> To: Eli Zaretskii <eliz <at> gnu.org> Cc: dmitry <at> gutov.dev, 79257 <at> debbugs.gnu.org Subject: Re: bug#79257: 31.0.50; flymake's ruby-backend test fails with ruby 3.4.5 Date: Tue, 26 Aug 2025 09:08:17 -0500
Eli Zaretskii <eliz <at> gnu.org> writes: >> From: john muhl <jm <at> pub.pink> >> Cc: dmitry <at> gutov.dev, 79257 <at> debbugs.gnu.org >> Date: Mon, 25 Aug 2025 22:46:40 -0500 >> >> Eli Zaretskii <eliz <at> gnu.org> writes: >> >> >> Cc: 79257 <at> debbugs.gnu.org >> >> From: john muhl <jm <at> pub.pink> >> >> Date: Mon, 25 Aug 2025 16:23:16 -0500 >> >> >> >> Dmitry Gutov <dmitry <at> gutov.dev> writes: >> >> >> >> > Hi! >> >> > >> >> > On 24/08/2025 19:35, john muhl wrote: >> >> >> The cause is a change in the check output of new Ruby versions >> >> >> which include the location of the executable; e.g. >> >> >> # Ruby 3.3.8 >> >> >> -:3: warning: statement not reached >> >> >> -:6: syntax error, unexpected end-of-input, expecting `end' or dummy end >> >> >> # Ruby 3.4.5 >> >> >> -:3: warning: statement not reached >> >> >> /usr/bin/ruby: -:5: syntax errors found (SyntaxError) >> >> >> Here’s a patch that updates the regex to account for it. Tests >> >> >> pass with both Ruby 3.3 and 3.4. >> >> > >> >> > Thanks, that works, I've pushed the change to master. >> >> > >> >> > Curiously, in my testing with ruby 3.4.5 the executable name is not >> >> > absolute, just 'ruby: '. That still works with your change. >> >> >> >> It seems to output however ruby gets invoked; e.g. >> >> >> >> $ /usr/bin/ruby -wc o.rb >> >> vs. >> >> $ ruby -wc o.rb >> >> >> >> > I wonder if you've managed to find the specific commit in Ruby that >> >> > did that (or bugs.ruby-lang.org entry). >> >> > This change log mentions some other changes in the output, but not >> >> > this: >> >> > https://www.ruby-lang.org/en/news/2024/12/25/ruby-3-4-0-released/ >> >> >> >> No. At first I thought it was something to do with the switch to >> >> the prism parser but using --parser=parse.y doesn’t change that >> >> part of the output. >> >> >> >> >> - "^\\(?:.*\\.rb\\|-\\):\\([0-9]+\\): \\(.*\\)$" >> >> >> + "^\\(?:.*ruby: \\)?\\(?:.*\\.rb\\|-\\):\\([0-9]+\\): >> >> > \\(.*\\)$" >> >> > >> >> > We could also make the first wildcard non-greedy (.*?). >> >> > >> >> > Perhaps put an initial slash before it too, for faster matching, but >> >> > I'm not sure how your variant of the output will look on Windows >> >> > (perhaps it starts with 'c:/'). >> >> >> >> Unfortunately I have no way to test Windows stuff. >> > >> > If an absolute file name is expected there, we should allow it to >> > begin with a drive letter on Windows. >> >> I don’t think it ever happens that ruby-flymake-simple would get >> an absolute path in the output. If you look there you’ll see it >> calls plain “ruby -w -c” (and I don’t see anyway to customize >> that) so it will just have “ruby: ” in the output. You have to >> call Ruby with an absolute path to get one in the output. > > In the example you brought up, I see > > /usr/bin/ruby: -:5: syntax errors found (SyntaxError) > > The "/usr/bin/ruby" part is an absolute file name. > > Apologies if I'm confused. 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.
Dmitry Gutov <dmitry <at> gutov.dev>
:john muhl <jm <at> pub.pink>
:Message #34 received at 79257-done <at> debbugs.gnu.org (full text, mbox):
From: Dmitry Gutov <dmitry <at> gutov.dev> To: john muhl <jm <at> pub.pink>, Eli Zaretskii <eliz <at> gnu.org> Cc: 79257-done <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 00:10:58 +0300
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.
bug-gnu-emacs <at> gnu.org
:bug#79257
; Package emacs
.
(Wed, 27 Aug 2025 00:25:01 GMT) Full text and rfc822 format available.Message #37 received at 79257 <at> debbugs.gnu.org (full text, mbox):
From: john muhl <jm <at> pub.pink> To: 79257 <at> debbugs.gnu.org Cc: dmitry <at> gutov.dev Subject: Re: bug#79257: 31.0.50; flymake's ruby-backend test fails with ruby 3.4.5 Date: Tue, 26 Aug 2025 19:24:33 -0500
Dmitry Gutov <dmitry <at> gutov.dev> 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.
bug-gnu-emacs <at> gnu.org
:bug#79257
; Package emacs
.
(Wed, 27 Aug 2025 01:49:02 GMT) Full text and rfc822 format available.Message #40 received at 79257 <at> debbugs.gnu.org (full text, mbox):
From: Dmitry Gutov <dmitry <at> gutov.dev> To: john muhl <jm <at> pub.pink>, 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 04:48:20 +0300
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
bug-gnu-emacs <at> gnu.org
:bug#79257
; Package emacs
.
(Wed, 27 Aug 2025 13:42:02 GMT) Full text and rfc822 format available.Message #43 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:41:00 -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 That works here for Ruby 3.4.x on Alpine, Fedora and Void.
bug-gnu-emacs <at> gnu.org
:bug#79257
; Package emacs
.
(Wed, 27 Aug 2025 13:43:01 GMT) Full text and rfc822 format available.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.
bug-gnu-emacs <at> gnu.org
:bug#79257
; Package emacs
.
(Thu, 28 Aug 2025 00:20:03 GMT) Full text and rfc822 format available.Message #49 received at 79257 <at> debbugs.gnu.org (full text, mbox):
From: Dmitry Gutov <dmitry <at> gutov.dev> To: john muhl <jm <at> pub.pink> 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: Thu, 28 Aug 2025 03:19:32 +0300
On 27/08/2025 16:41, john muhl wrote: > That works here for Ruby 3.4.x on Alpine, Fedora and Void. Pushed that too, thanks for testing.
GNU bug tracking system
Copyright (C) 1999 Darren O. Benham,
1997,2003 nCipher Corporation Ltd,
1994-97 Ian Jackson.