GNU bug report logs - #62741
30.0.50; Eglot jdtls project test: pass on emacs-29, fail on master

Previous Next

Package: emacs;

Reported by: Basil Contovounesios <contovob <at> tcd.ie>

Date: Sun, 9 Apr 2023 17:48:02 UTC

Severity: minor

Found in version 30.0.50

Fixed in version 30.1

Done: Basil Contovounesios <contovob <at> tcd.ie>

Bug is archived. No further changes may be made.

To add a comment to this bug, you must first unarchive it, by sending
a message to control AT debbugs.gnu.org, with unarchive 62741 in the body.
You can then email your comments to 62741 AT debbugs.gnu.org in the normal way.

Toggle the display of automated, internal messages from the tracker.

View this report as an mbox folder, status mbox, maintainer mbox


Report forwarded to joaotavora <at> gmail.com, dmitry <at> gutov.dev, bug-gnu-emacs <at> gnu.org:
bug#62741; Package emacs. (Sun, 09 Apr 2023 17:48:02 GMT) Full text and rfc822 format available.

Acknowledgement sent to Basil Contovounesios <contovob <at> tcd.ie>:
New bug report received and forwarded. Copy sent to joaotavora <at> gmail.com, dmitry <at> gutov.dev, bug-gnu-emacs <at> gnu.org. (Sun, 09 Apr 2023 17:48:02 GMT) Full text and rfc822 format available.

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

From: Basil Contovounesios <contovob <at> tcd.ie>
To: bug-gnu-emacs <at> gnu.org
Subject: 30.0.50; Eglot jdtls project test: pass on emacs-29, fail on master
Date: Sun, 09 Apr 2023 18:46:53 +0100
[Message part 1 (text/plain, inline)]
With the following JDT LS binary release:
https://download.eclipse.org/jdtls/milestones/1.21.0/

The test eglot-test-eclipse-connect passes on emacs-29:
[emacs-29-check.txt (text/plain, attachment)]
[Message part 3 (text/plain, inline)]
But fails on master:
[emacs-check.txt (text/plain, attachment)]
[Message part 5 (text/plain, inline)]
The following change lets it pass on both branches:
[eglot.diff (text/x-diff, inline)]
diff --git a/test/lisp/progmodes/eglot-tests.el b/test/lisp/progmodes/eglot-tests.el
index 62e04539ebf..041aafabe8e 100644
--- a/test/lisp/progmodes/eglot-tests.el
+++ b/test/lisp/progmodes/eglot-tests.el
@@ -325,8 +325,7 @@ eglot-test-eclipse-connect
   "Connect to eclipse.jdt.ls server."
   (skip-unless (executable-find "jdtls"))
   (eglot--with-fixture
-      '(("project/src/main/java/foo" . (("Main.java" . "")))
-        ("project/.git/" . nil))
+      '(("project/src/main/java/foo" . (("Main.java" . ""))))
     (with-current-buffer
         (eglot--find-file-noselect "project/src/main/java/foo/Main.java")
       (eglot--sniffing (:server-notifications s-notifs)
[Message part 7 (text/plain, inline)]
Which I assume means that project-current picks up .git as a project
root marker, but project-files unexpectedly finds no registered files.

I'm not sure whether this is expected on either the project or eglot
side.  If I squint hard enough it kind of reminds me of bug#62735.

WDYT?

Thanks,

-- 
Basil

In GNU Emacs 29.0.60 (build 1, x86_64-pc-linux-gnu, X toolkit, cairo
 version 1.16.0, Xaw3d scroll bars) of 2023-04-09 built on blc
Repository revision: 57490fff6ecf3cc1de7d8d833d1b6c895330b762
Repository branch: wt/emacs-29
Windowing system distributor 'The X.Org Foundation', version 11.0.12101003
System Description: Ubuntu 22.04.2 LTS

Configured using:
 'configure CC=gcc-12 'CFLAGS=-Og -ggdb3' --prefix=/home/bic/.local
 --with-program-suffix=-29 --with-file-notification=yes --with-x
 --with-x-toolkit=lucid'

Configured features:
ACL CAIRO DBUS FREETYPE GIF GLIB GMP GNUTLS GPM GSETTINGS HARFBUZZ JPEG
JSON LCMS2 LIBOTF LIBSELINUX LIBSYSTEMD LIBXML2 M17N_FLT MODULES NOTIFY
INOTIFY PDUMPER PNG RSVG SECCOMP SOUND SQLITE3 THREADS TIFF
TOOLKIT_SCROLL_BARS TREE_SITTER WEBP X11 XAW3D XDBE XIM XINPUT2 XPM
LUCID ZLIB

Important settings:
  value of $LC_MONETARY: en_IE.UTF-8
  value of $LC_NUMERIC: en_IE.UTF-8
  value of $LC_TIME: en_IE.UTF-8
  value of $LANG: en_GB.UTF-8
  value of $XMODIFIERS: @im=ibus
  locale-coding-system: utf-8-unix

Major mode: Lisp Interaction

Minor modes in effect:
  tooltip-mode: t
  global-eldoc-mode: t
  eldoc-mode: t
  show-paren-mode: t
  electric-indent-mode: t
  mouse-wheel-mode: t
  tool-bar-mode: t
  menu-bar-mode: t
  file-name-shadow-mode: t
  global-font-lock-mode: t
  font-lock-mode: t
  blink-cursor-mode: t
  line-number-mode: t
  indent-tabs-mode: t
  transient-mark-mode: t
  auto-composition-mode: t
  auto-encryption-mode: t
  auto-compression-mode: t

Load-path shadows:
None found.

Features:
(shadow sort mail-extr emacsbug message mailcap yank-media puny dired
dired-loaddefs rfc822 mml mml-sec password-cache epa derived epg rfc6068
epg-config gnus-util text-property-search time-date subr-x mm-decode
mm-bodies mm-encode mail-parse rfc2231 mailabbrev gmm-utils mailheader
cl-loaddefs cl-lib sendmail rfc2047 rfc2045 ietf-drums mm-util
mail-prsvr mail-utils rmc iso-transl tooltip cconv eldoc paren electric
uniquify ediff-hook vc-hooks lisp-float-type elisp-mode mwheel
term/x-win x-win term/common-win x-dnd tool-bar dnd fontset image
regexp-opt fringe tabulated-list replace newcomment text-mode lisp-mode
prog-mode register page tab-bar menu-bar rfn-eshadow isearch easymenu
timer select scroll-bar mouse jit-lock font-lock syntax font-core
term/tty-colors frame minibuffer nadvice seq simple cl-generic
indonesian philippine cham georgian utf-8-lang misc-lang vietnamese
tibetan thai tai-viet lao korean japanese eucjp-ms cp51932 hebrew greek
romanian slovak czech european ethiopic indian cyrillic chinese
composite emoji-zwj charscript charprop case-table epa-hook
jka-cmpr-hook help abbrev obarray oclosure cl-preloaded button loaddefs
theme-loaddefs faces cus-face macroexp files window text-properties
overlay sha1 md5 base64 format env code-pages mule custom widget keymap
hashtable-print-readable backquote threads dbusbind inotify lcms2
dynamic-setting system-font-setting font-render-setting cairo x-toolkit
xinput2 x multi-tty make-network-process emacs)

Memory information:
((conses 16 36570 7455)
 (symbols 48 5149 0)
 (strings 32 13868 1570)
 (string-bytes 1 379298)
 (vectors 16 9299)
 (vector-slots 8 148612 10553)
 (floats 8 23 25)
 (intervals 56 248 0)
 (buffers 984 10))

In GNU Emacs 30.0.50 (build 1, x86_64-pc-linux-gnu, X toolkit, cairo
 version 1.16.0, Xaw3d scroll bars) of 2023-04-09 built on blc
Repository revision: c9e13048bb9b1b5fb156fb128b32030ae2f1003b
Repository branch: master
Windowing system distributor 'The X.Org Foundation', version 11.0.12101003
System Description: Ubuntu 22.04.2 LTS

Configured using:
 'configure CC=gcc-12 'CFLAGS=-Og -ggdb3' --prefix=/home/bic/.local
 --with-file-notification=yes --with-x --with-x-toolkit=lucid'

Configured features:
ACL CAIRO DBUS FREETYPE GIF GLIB GMP GNUTLS GPM GSETTINGS HARFBUZZ JPEG
JSON LCMS2 LIBOTF LIBSELINUX LIBSYSTEMD LIBXML2 M17N_FLT MODULES NOTIFY
INOTIFY PDUMPER PNG RSVG SECCOMP SOUND SQLITE3 THREADS TIFF
TOOLKIT_SCROLL_BARS TREE_SITTER WEBP X11 XAW3D XDBE XIM XINPUT2 XPM
LUCID ZLIB

Important settings:
  value of $LC_MONETARY: en_IE.UTF-8
  value of $LC_NUMERIC: en_IE.UTF-8
  value of $LC_TIME: en_IE.UTF-8
  value of $LANG: en_GB.UTF-8
  value of $XMODIFIERS: @im=ibus
  locale-coding-system: utf-8-unix

Major mode: Lisp Interaction

Minor modes in effect:
  tooltip-mode: t
  global-eldoc-mode: t
  eldoc-mode: t
  show-paren-mode: t
  electric-indent-mode: t
  mouse-wheel-mode: t
  tool-bar-mode: t
  menu-bar-mode: t
  file-name-shadow-mode: t
  global-font-lock-mode: t
  font-lock-mode: t
  blink-cursor-mode: t
  line-number-mode: t
  indent-tabs-mode: t
  transient-mark-mode: t
  auto-composition-mode: t
  auto-encryption-mode: t
  auto-compression-mode: t

Load-path shadows:
None found.

Features:
(shadow sort mail-extr emacsbug message mailcap yank-media puny dired
dired-loaddefs rfc822 mml mml-sec password-cache epa derived epg rfc6068
epg-config gnus-util text-property-search time-date subr-x mm-decode
mm-bodies mm-encode mail-parse rfc2231 mailabbrev gmm-utils mailheader
cl-loaddefs cl-lib sendmail rfc2047 rfc2045 ietf-drums mm-util
mail-prsvr mail-utils rmc iso-transl tooltip cconv eldoc paren electric
uniquify ediff-hook vc-hooks lisp-float-type elisp-mode mwheel
term/x-win x-win term/common-win x-dnd tool-bar dnd fontset image
regexp-opt fringe tabulated-list replace newcomment text-mode lisp-mode
prog-mode register page tab-bar menu-bar rfn-eshadow isearch easymenu
timer select scroll-bar mouse jit-lock font-lock syntax font-core
term/tty-colors frame minibuffer nadvice seq simple cl-generic
indonesian philippine cham georgian utf-8-lang misc-lang vietnamese
tibetan thai tai-viet lao korean japanese eucjp-ms cp51932 hebrew greek
romanian slovak czech european ethiopic indian cyrillic chinese
composite emoji-zwj charscript charprop case-table epa-hook
jka-cmpr-hook help abbrev obarray oclosure cl-preloaded button loaddefs
theme-loaddefs faces cus-face macroexp files window text-properties
overlay sha1 md5 base64 format env code-pages mule custom widget keymap
hashtable-print-readable backquote threads dbusbind inotify lcms2
dynamic-setting system-font-setting font-render-setting cairo x-toolkit
xinput2 x multi-tty make-network-process emacs)

Memory information:
((conses 16 36595 9309)
 (symbols 48 5171 0)
 (strings 32 13872 1628)
 (string-bytes 1 377598)
 (vectors 16 9294)
 (vector-slots 8 148577 11099)
 (floats 8 23 25)
 (intervals 56 244 0)
 (buffers 984 10))

Information forwarded to bug-gnu-emacs <at> gnu.org:
bug#62741; Package emacs. (Sun, 09 Apr 2023 19:12:02 GMT) Full text and rfc822 format available.

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

From: João Távora <joaotavora <at> gmail.com>
To: Basil Contovounesios <contovob <at> tcd.ie>
Cc: Dmitry Gutov <dmitry <at> gutov.dev>, 62741 <at> debbugs.gnu.org
Subject: Re: bug#62741: 30.0.50; Eglot jdtls project test: pass on emacs-29,
 fail on master
Date: Sun, 09 Apr 2023 20:13:05 +0100
Basil Contovounesios <contovob <at> tcd.ie> writes:

> diff --git a/test/lisp/progmodes/eglot-tests.el b/test/lisp/progmodes/eglot-tests.el
> index 62e04539ebf..041aafabe8e 100644
> --- a/test/lisp/progmodes/eglot-tests.el
> +++ b/test/lisp/progmodes/eglot-tests.el
> @@ -325,8 +325,7 @@ eglot-test-eclipse-connect
>    "Connect to eclipse.jdt.ls server."
>    (skip-unless (executable-find "jdtls"))
>    (eglot--with-fixture
> -      '(("project/src/main/java/foo" . (("Main.java" . "")))
> -        ("project/.git/" . nil))
> +      '(("project/src/main/java/foo" . (("Main.java" . ""))))
>      (with-current-buffer
>          (eglot--find-file-noselect "project/src/main/java/foo/Main.java")
>        (eglot--sniffing (:server-notifications s-notifs)
>
>
> Which I assume means that project-current picks up .git as a project
> root marker, but project-files unexpectedly finds no registered files.
>
> I'm not sure whether this is expected on either the project or eglot
> side.  If I squint hard enough it kind of reminds me of bug#62735.

I think the change is fine, please install it, and thanks.  Let's hope
it doesn't break on Emacs 26.3, 27 and 28 

(f you could test, it would be great, if not it's OK.  It'd involve
making a GitHub fork and using the GitHub actions scripts)

A safer, but slightly slower route:

   (should (zerop (shell-command "git init")))

Some tests known to need project-files already do this.

But why does it pass on Emacs 29?? Maybe project-files simply doesn't
error there?

João




Information forwarded to bug-gnu-emacs <at> gnu.org:
bug#62741; Package emacs. (Sun, 09 Apr 2023 23:14:02 GMT) Full text and rfc822 format available.

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

From: Basil Contovounesios <contovob <at> tcd.ie>
To: João Távora <joaotavora <at> gmail.com>
Cc: Dmitry Gutov <dmitry <at> gutov.dev>, 62741 <at> debbugs.gnu.org
Subject: Re: bug#62741: 30.0.50; Eglot jdtls project test: pass on emacs-29,
 fail on master
Date: Mon, 10 Apr 2023 00:13:25 +0100
João Távora [2023-04-09 20:13 +0100] wrote:

> Basil Contovounesios <contovob <at> tcd.ie> writes:
>
>> diff --git a/test/lisp/progmodes/eglot-tests.el b/test/lisp/progmodes/eglot-tests.el
>> index 62e04539ebf..041aafabe8e 100644
>> --- a/test/lisp/progmodes/eglot-tests.el
>> +++ b/test/lisp/progmodes/eglot-tests.el
>> @@ -325,8 +325,7 @@ eglot-test-eclipse-connect
>>    "Connect to eclipse.jdt.ls server."
>>    (skip-unless (executable-find "jdtls"))
>>    (eglot--with-fixture
>> -      '(("project/src/main/java/foo" . (("Main.java" . "")))
>> -        ("project/.git/" . nil))
>> +      '(("project/src/main/java/foo" . (("Main.java" . ""))))
>>      (with-current-buffer
>>          (eglot--find-file-noselect "project/src/main/java/foo/Main.java")
>>        (eglot--sniffing (:server-notifications s-notifs)
>>
>>
>> Which I assume means that project-current picks up .git as a project
>> root marker, but project-files unexpectedly finds no registered files.
>>
>> I'm not sure whether this is expected on either the project or eglot
>> side.  If I squint hard enough it kind of reminds me of bug#62735.
>
> I think the change is fine, please install it, and thanks.

Done:

Avoid Git project in eglot-test-eclipse-connect
6674ac17eb4 2023-04-09 23:32:14 +0100
https://git.sv.gnu.org/cgit/emacs.git/commit/?id=6674ac17eb4


> Let's hope it doesn't break on Emacs 26.3, 27 and 28
>
> (f you could test, it would be great, if not it's OK.  It'd involve
> making a GitHub fork and using the GitHub actions scripts)

Seems to work there too:
https://github.com/basil-conto/eglot/commit/e915db94a6
https://github.com/basil-conto/eglot/actions/runs/4652799056

> A safer, but slightly slower route:
>
>    (should (zerop (shell-command "git init")))
>
> Some tests known to need project-files already do this.

This continues to fail in the same way, both in emacs.git and eglot.git:
https://github.com/basil-conto/eglot/commit/1b2d13eaf6
https://github.com/basil-conto/eglot/actions/runs/4652805286

> But why does it pass on Emacs 29?? Maybe project-files simply doesn't
> error there?

Maybe, but why not?

Thanks,

-- 
Basil




Information forwarded to bug-gnu-emacs <at> gnu.org:
bug#62741; Package emacs. (Mon, 10 Apr 2023 08:16:01 GMT) Full text and rfc822 format available.

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

From: João Távora <joaotavora <at> gmail.com>
To: Basil Contovounesios <contovob <at> tcd.ie>
Cc: Dmitry Gutov <dmitry <at> gutov.dev>, 62741 <at> debbugs.gnu.org
Subject: Re: bug#62741: 30.0.50; Eglot jdtls project test: pass on emacs-29,
 fail on master
Date: Mon, 10 Apr 2023 09:17:29 +0100
Basil Contovounesios <contovob <at> tcd.ie> writes:

> João Távora [2023-04-09 20:13 +0100] wrote:
>
>> Basil Contovounesios <contovob <at> tcd.ie> writes:
>>
>>> diff --git a/test/lisp/progmodes/eglot-tests.el b/test/lisp/progmodes/eglot-tests.el
>>> index 62e04539ebf..041aafabe8e 100644
>>> --- a/test/lisp/progmodes/eglot-tests.el
>>> +++ b/test/lisp/progmodes/eglot-tests.el
>>> @@ -325,8 +325,7 @@ eglot-test-eclipse-connect
>>>    "Connect to eclipse.jdt.ls server."
>>>    (skip-unless (executable-find "jdtls"))
>>>    (eglot--with-fixture
>>> -      '(("project/src/main/java/foo" . (("Main.java" . "")))
>>> -        ("project/.git/" . nil))
>>> +      '(("project/src/main/java/foo" . (("Main.java" . ""))))
>>>      (with-current-buffer
>>>          (eglot--find-file-noselect "project/src/main/java/foo/Main.java")
>>>        (eglot--sniffing (:server-notifications s-notifs)
>>>
>>>
>>> Which I assume means that project-current picks up .git as a project
>>> root marker, but project-files unexpectedly finds no registered files.
>>>
>>> I'm not sure whether this is expected on either the project or eglot
>>> side.  If I squint hard enough it kind of reminds me of bug#62735.
>>
>> I think the change is fine, please install it, and thanks.
>
> Done:
>
> Avoid Git project in eglot-test-eclipse-connect
> 6674ac17eb4 2023-04-09 23:32:14 +0100
> https://git.sv.gnu.org/cgit/emacs.git/commit/?id=6674ac17eb4
>
>> Let's hope it doesn't break on Emacs 26.3, 27 and 28
>>
>> (f you could test, it would be great, if not it's OK.  It'd involve
>> making a GitHub fork and using the GitHub actions scripts)
>
> Seems to work there too:
> https://github.com/basil-conto/eglot/commit/e915db94a6
> https://github.com/basil-conto/eglot/actions/runs/4652799056

Thanks!

>> A safer, but slightly slower route:
>>
>>    (should (zerop (shell-command "git init")))
>>
>> Some tests known to need project-files already do this.
>
> This continues to fail in the same way, both in emacs.git and eglot.git:
> https://github.com/basil-conto/eglot/commit/1b2d13eaf6
> https://github.com/basil-conto/eglot/actions/runs/4652805286

This is very odd then.  Why would project-files fail in the face of
(presumably) a perfectly well-behaved Git repository?

Pasting the backtrace here for Dmitry to have a look.

Test eglot-test-eclipse-connect backtrace:
  string-match("\0" nil 0)
  split-string(nil "\0" t)
  project--vc-list-files("/tmp/eglot--fixturernYTOR/project/" Git nil)
  #f(compiled-function (dir) #<bytecode -0xa5be45661654310>)("/tmp/eglot--fixturernYTOR/project/")
  mapcan(#f(compiled-function (dir) #<bytecode -0xa5be45661654310>) ("/tmp/eglot--fixturernYTOR/project/"))
  #f(compiled-function (project &optional dirs) #<bytecode 0x114f4cd06dfc2088>)((vc Git "/tmp/eglot--fixturernYTOR/project/"))
  apply(#f(compiled-function (project &optional dirs) #<bytecode 0x114f4cd06dfc2088>) (vc Git "/tmp/eglot--fixturernYTOR/project/") nil)
  project-files((vc Git "/tmp/eglot--fixturernYTOR/project/"))

It would seem that the problem here is there are no files versioned yet,
so this expression in project--vc-list-files

   (apply #'vc-git--run-command-string nil "ls-files" args)

Returns nil.  

But I cannot reproduce this locally.

I'll leave it up to you, Basil, to decide whether to close or leave this
bug open.

João




bug marked as fixed in version 30.1, send any further explanations to 62741 <at> debbugs.gnu.org and Basil Contovounesios <contovob <at> tcd.ie> Request was from Basil Contovounesios <contovob <at> tcd.ie> to control <at> debbugs.gnu.org. (Mon, 10 Apr 2023 09:12:02 GMT) Full text and rfc822 format available.

Severity set to 'minor' from 'normal' Request was from Basil Contovounesios <contovob <at> tcd.ie> to control <at> debbugs.gnu.org. (Mon, 10 Apr 2023 09:12:02 GMT) Full text and rfc822 format available.

Information forwarded to bug-gnu-emacs <at> gnu.org:
bug#62741; Package emacs. (Mon, 10 Apr 2023 09:12:03 GMT) Full text and rfc822 format available.

Message #21 received at 62741-done <at> debbugs.gnu.org (full text, mbox):

From: Basil Contovounesios <contovob <at> tcd.ie>
To: João Távora <joaotavora <at> gmail.com>
Cc: Dmitry Gutov <dmitry <at> gutov.dev>, 62741-done <at> debbugs.gnu.org
Subject: Re: bug#62741: 30.0.50; Eglot jdtls project test: pass on emacs-29,
 fail on master
Date: Mon, 10 Apr 2023 10:11:23 +0100
close 62741 30.1
severity 62741 minor
quit

João Távora [2023-04-10 09:17 +0100] wrote:

> Pasting the backtrace here for Dmitry to have a look.
>
> Test eglot-test-eclipse-connect backtrace:
>   string-match("\0" nil 0)
>   split-string(nil "\0" t)
>   project--vc-list-files("/tmp/eglot--fixturernYTOR/project/" Git nil)
>   #f(compiled-function (dir) #<bytecode -0xa5be45661654310>)("/tmp/eglot--fixturernYTOR/project/")
>   mapcan(#f(compiled-function (dir) #<bytecode -0xa5be45661654310>) ("/tmp/eglot--fixturernYTOR/project/"))
>   #f(compiled-function (project &optional dirs) #<bytecode 0x114f4cd06dfc2088>)((vc Git "/tmp/eglot--fixturernYTOR/project/"))
>   apply(#f(compiled-function (project &optional dirs) #<bytecode 0x114f4cd06dfc2088>) (vc Git "/tmp/eglot--fixturernYTOR/project/") nil)
>   project-files((vc Git "/tmp/eglot--fixturernYTOR/project/"))
>
> It would seem that the problem here is there are no files versioned yet,
> so this expression in project--vc-list-files
>
>    (apply #'vc-git--run-command-string nil "ls-files" args)
>
> Returns nil.  
>
> But I cannot reproduce this locally.

It's easy to reproduce the backtrace without Eglot, and it happens both
on master and emacs-29.  From emacs -Q:

  (let ((dir (make-nearby-temp-file "my-" t)))
    (unwind-protect
        (let ((default-directory (file-name-as-directory dir)))
          (make-directory ".git")
          (make-empty-file "file") ; Optional.
          (require 'project)
          (project-files (project-current)))
      (delete-directory dir t)))

  C-x C-e

  Debugger entered--Lisp error: (wrong-type-argument stringp nil)
    string-match("\0" nil 0)
    split-string(nil "\0" t)
    project--vc-list-files("/tmp/my-VHbIUg/" Git nil)
    #f(compiled-function (dir) #<bytecode 0x12e526b1f733674a>)("/tmp/my-VHbIUg/")
    mapcan(#f(compiled-function (dir) #<bytecode 0x12e526b1f733674a>) ("/tmp/my-VHbIUg/"))
    #f(compiled-function (project &optional dirs) #<bytecode 0xea2b226a1860ab9>)((vc Git "/tmp/my-VHbIUg/"))
    apply(#f(compiled-function (project &optional dirs) #<bytecode 0xea2b226a1860ab9>)
          (vc Git "/tmp/my-VHbIUg/") nil)
    project-files((vc Git "/tmp/my-VHbIUg/"))

> I'll leave it up to you, Basil, to decide whether to close or leave this
> bug open.

Closing, since the difference between master and emacs-29 materialised
in the context of Eglot.

If Dmitry thinks project-files is doing something unexpected, we can
open a new ticket if necessary.

Thanks,

-- 
Basil




Information forwarded to bug-gnu-emacs <at> gnu.org:
bug#62741; Package emacs. (Mon, 10 Apr 2023 09:52:02 GMT) Full text and rfc822 format available.

Message #24 received at 62741-done <at> debbugs.gnu.org (full text, mbox):

From: João Távora <joaotavora <at> gmail.com>
To: Basil Contovounesios <contovob <at> tcd.ie>
Cc: Dmitry Gutov <dmitry <at> gutov.dev>, 62741-done <at> debbugs.gnu.org
Subject: Re: bug#62741: 30.0.50; Eglot jdtls project test: pass on emacs-29,
 fail on master
Date: Mon, 10 Apr 2023 10:51:08 +0100
On Mon, Apr 10, 2023 at 10:11 AM Basil Contovounesios <contovob <at> tcd.ie> wrote:
>
> close 62741 30.1
> severity 62741 minor
> quit
>
> João Távora [2023-04-10 09:17 +0100] wrote:
>
> > Pasting the backtrace here for Dmitry to have a look.
> >
> > Test eglot-test-eclipse-connect backtrace:
> >   string-match("\0" nil 0)
> >   split-string(nil "\0" t)
> >   project--vc-list-files("/tmp/eglot--fixturernYTOR/project/" Git nil)
> >   #f(compiled-function (dir) #<bytecode -0xa5be45661654310>)("/tmp/eglot--fixturernYTOR/project/")
> >   mapcan(#f(compiled-function (dir) #<bytecode -0xa5be45661654310>) ("/tmp/eglot--fixturernYTOR/project/"))
> >   #f(compiled-function (project &optional dirs) #<bytecode 0x114f4cd06dfc2088>)((vc Git "/tmp/eglot--fixturernYTOR/project/"))
> >   apply(#f(compiled-function (project &optional dirs) #<bytecode 0x114f4cd06dfc2088>) (vc Git "/tmp/eglot--fixturernYTOR/project/") nil)
> >   project-files((vc Git "/tmp/eglot--fixturernYTOR/project/"))
> >
> > It would seem that the problem here is there are no files versioned yet,
> > so this expression in project--vc-list-files
> >
> >    (apply #'vc-git--run-command-string nil "ls-files" args)
> >
> > Returns nil.
> >
> > But I cannot reproduce this locally.
>
> It's easy to reproduce the backtrace without Eglot, and it happens both
> on master and emacs-29.  From emacs -Q:
>
>   (let ((dir (make-nearby-temp-file "my-" t)))
>     (unwind-protect
>         (let ((default-directory (file-name-as-directory dir)))
>           (make-directory ".git")
>           (make-empty-file "file") ; Optional.
>           (require 'project)
>           (project-files (project-current)))
>       (delete-directory dir t)))
>
>   C-x C-e

This indeed breaks, but it doesn't break if you replace the
'make-directory' with '(shell-command "git init")'.

And yet, when you tried that in Eglot's CI, it seem it _did_
break with the same error.  So I don't know what's going on.

João




Information forwarded to bug-gnu-emacs <at> gnu.org:
bug#62741; Package emacs. (Mon, 10 Apr 2023 11:57:02 GMT) Full text and rfc822 format available.

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

From: Dmitry Gutov <dmitry <at> gutov.dev>
To: João Távora <joaotavora <at> gmail.com>,
 Basil Contovounesios <contovob <at> tcd.ie>
Cc: 62741 <at> debbugs.gnu.org
Subject: Re: bug#62741: 30.0.50; Eglot jdtls project test: pass on emacs-29,
 fail on master
Date: Mon, 10 Apr 2023 14:56:47 +0300
Hi!

On 10/04/2023 11:17, João Távora wrote:
> This is very odd then.  Why would project-files fail in the face of
> (presumably) a perfectly well-behaved Git repository?
> 
> Pasting the backtrace here for Dmitry to have a look.
> 
> Test eglot-test-eclipse-connect backtrace:
>    string-match("\0" nil 0)
>    split-string(nil "\0" t)
>    project--vc-list-files("/tmp/eglot--fixturernYTOR/project/" Git nil)
>    #f(compiled-function (dir) #<bytecode -0xa5be45661654310>)("/tmp/eglot--fixturernYTOR/project/")
>    mapcan(#f(compiled-function (dir) #<bytecode -0xa5be45661654310>) ("/tmp/eglot--fixturernYTOR/project/"))
>    #f(compiled-function (project &optional dirs) #<bytecode 0x114f4cd06dfc2088>)((vc Git "/tmp/eglot--fixturernYTOR/project/"))
>    apply(#f(compiled-function (project &optional dirs) #<bytecode 0x114f4cd06dfc2088>) (vc Git "/tmp/eglot--fixturernYTOR/project/") nil)
>    project-files((vc Git "/tmp/eglot--fixturernYTOR/project/"))
> 
> It would seem that the problem here is there are no files versioned yet,
> so this expression in project--vc-list-files
> 
>     (apply #'vc-git--run-command-string nil "ls-files" args)
> 
> Returns nil.
> 
> But I cannot reproduce this locally.

I haven't been able to reproduce this locally either. If I just use a 
repo after 'git init', the return value of vc-git--run-command-string 
(inside project--vc-list-files) is an empty string, not nil.

Could this be that the repo in the test isn't actually initialized? Or 
maybe there's something different in the test environment. My Git 
version is 2.37.2.




Information forwarded to bug-gnu-emacs <at> gnu.org:
bug#62741; Package emacs. (Mon, 10 Apr 2023 12:01:02 GMT) Full text and rfc822 format available.

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

From: João Távora <joaotavora <at> gmail.com>
To: Dmitry Gutov <dmitry <at> gutov.dev>
Cc: Basil Contovounesios <contovob <at> tcd.ie>, 62741 <at> debbugs.gnu.org
Subject: Re: bug#62741: 30.0.50; Eglot jdtls project test: pass on emacs-29,
 fail on master
Date: Mon, 10 Apr 2023 13:00:32 +0100
On Mon, Apr 10, 2023 at 12:56 PM Dmitry Gutov <dmitry <at> gutov.dev> wrote:
>
> Hi!
>
> On 10/04/2023 11:17, João Távora wrote:
> > This is very odd then.  Why would project-files fail in the face of
> > (presumably) a perfectly well-behaved Git repository?
> >
> > Pasting the backtrace here for Dmitry to have a look.
> >
> > Test eglot-test-eclipse-connect backtrace:
> >    string-match("\0" nil 0)
> >    split-string(nil "\0" t)
> >    project--vc-list-files("/tmp/eglot--fixturernYTOR/project/" Git nil)
> >    #f(compiled-function (dir) #<bytecode -0xa5be45661654310>)("/tmp/eglot--fixturernYTOR/project/")
> >    mapcan(#f(compiled-function (dir) #<bytecode -0xa5be45661654310>) ("/tmp/eglot--fixturernYTOR/project/"))
> >    #f(compiled-function (project &optional dirs) #<bytecode 0x114f4cd06dfc2088>)((vc Git "/tmp/eglot--fixturernYTOR/project/"))
> >    apply(#f(compiled-function (project &optional dirs) #<bytecode 0x114f4cd06dfc2088>) (vc Git "/tmp/eglot--fixturernYTOR/project/") nil)
> >    project-files((vc Git "/tmp/eglot--fixturernYTOR/project/"))
> >
> > It would seem that the problem here is there are no files versioned yet,
> > so this expression in project--vc-list-files
> >
> >     (apply #'vc-git--run-command-string nil "ls-files" args)
> >
> > Returns nil.
> >
> > But I cannot reproduce this locally.
>
> I haven't been able to reproduce this locally either. If I just use a
> repo after 'git init', the return value of vc-git--run-command-string
> (inside project--vc-list-files) is an empty string, not nil.
>
> Could this be that the repo in the test isn't actually initialized? Or
> maybe there's something different in the test environment. My Git
> version is 2.37.2.

In the GitHub CI, Basil used both strategies, iow he invoked
"git init" in a directory that already had an empty ".git"
directory.  Maybe the Git version in GitHub's ubuntu machines
doesn't react to that the same way my Git version does (which is
to not be bothered by the existing directory, and do its work
all the same).

I don't think this is extremely important though.  It'll pop up
eventually if it is a real problem.

João




bug archived. Request was from Debbugs Internal Request <help-debbugs <at> gnu.org> to internal_control <at> debbugs.gnu.org. (Tue, 09 May 2023 11:24:05 GMT) Full text and rfc822 format available.

This bug report was last modified 2 years and 40 days ago.

Previous Next


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