From mboxrd@z Thu Jan 1 00:00:00 1970 Path: news.gmane.io!.POSTED.blaine.gmane.org!not-for-mail From: Ship Mints Newsgroups: gmane.emacs.bugs Subject: bug#72701: eglot crash when project-files-relative-names t Date: Sun, 18 Aug 2024 11:43:01 -0400 Message-ID: Mime-Version: 1.0 Content-Type: multipart/alternative; boundary="000000000000c97561061ff70cca" Injection-Info: ciao.gmane.io; posting-host="blaine.gmane.org:116.202.254.214"; logging-data="13731"; mail-complaints-to="usenet@ciao.gmane.io" To: 72701@debbugs.gnu.org Original-X-From: bug-gnu-emacs-bounces+geb-bug-gnu-emacs=m.gmane-mx.org@gnu.org Sun Aug 18 17:46:35 2024 Return-path: Envelope-to: geb-bug-gnu-emacs@m.gmane-mx.org Original-Received: from lists.gnu.org ([209.51.188.17]) by ciao.gmane.io with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.92) (envelope-from ) id 1sfi71-0003S9-4v for geb-bug-gnu-emacs@m.gmane-mx.org; Sun, 18 Aug 2024 17:46:35 +0200 Original-Received: from localhost ([::1] helo=lists1p.gnu.org) by lists.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1sfi6q-0007Om-UB; Sun, 18 Aug 2024 11:46:25 -0400 Original-Received: from eggs.gnu.org ([2001:470:142:3::10]) by lists.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.90_1) (envelope-from ) id 1sfi6o-0007OW-J2 for bug-gnu-emacs@gnu.org; Sun, 18 Aug 2024 11:46:22 -0400 Original-Received: from debbugs.gnu.org ([2001:470:142:5::43]) by eggs.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_128_GCM_SHA256:128) (Exim 4.90_1) (envelope-from ) id 1sfi6o-0008A6-9t for bug-gnu-emacs@gnu.org; Sun, 18 Aug 2024 11:46:22 -0400 DKIM-Signature: v=1; a=rsa-sha256; q=dns/txt; c=relaxed/relaxed; d=debbugs.gnu.org; s=debbugs-gnu-org; h=Date:From:MIME-Version:To:Subject; bh=Ztsa3IUJu9CipLfEkZT/V63pl5TX4hicuK8SNU19kQk=; b=rsZ2oM3rT5a601AZhNnrtrZK/etVLAloLUm0U1dfnJtNjyY86dE2vmVXcY8T5SAsLk9bY9R7qoQfsACpKOK8nPkw2MBvlPnNK5y7MM86hQa6IM045oAFGvxXyGV3yTkPYMcaPb+gK6VYbxtGH42w9eQHGRhXKIOuEtli92fu6eVOzU3qE6f8ReUU99vmhl/QjspLJsl4XwkDzUJrc9skJCdyUs5VAVYmN7dMV/UootU5xNUYXO3y/l3fLtdJeIY1pxzS16UT6mhT+DKXnB2W+SPA0gNp1Kl7sV8p/wHoLWPwMCAqUkm2IQQzh9TUxVg/kp836xjNJZ0NQQJEDTJ4hA==; Original-Received: from Debian-debbugs by debbugs.gnu.org with local (Exim 4.84_2) (envelope-from ) id 1sfi7S-00023z-Lr for bug-gnu-emacs@gnu.org; Sun, 18 Aug 2024 11:47:02 -0400 X-Loop: help-debbugs@gnu.org Resent-From: Ship Mints Original-Sender: "Debbugs-submit" Resent-CC: bug-gnu-emacs@gnu.org Resent-Date: Sun, 18 Aug 2024 15:47:02 +0000 Resent-Message-ID: Resent-Sender: help-debbugs@gnu.org X-GNU-PR-Message: report 72701 X-GNU-PR-Package: emacs X-Debbugs-Original-To: bug-gnu-emacs@gnu.org Original-Received: via spool by submit@debbugs.gnu.org id=B.17239959747859 (code B ref -1); Sun, 18 Aug 2024 15:47:02 +0000 Original-Received: (at submit) by debbugs.gnu.org; 18 Aug 2024 15:46:14 +0000 Original-Received: from localhost ([127.0.0.1]:56519 helo=debbugs.gnu.org) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1sfi6g-00022g-2v for submit@debbugs.gnu.org; Sun, 18 Aug 2024 11:46:14 -0400 Original-Received: from lists.gnu.org ([209.51.188.17]:34860) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1sfi6d-00022Y-EW for submit@debbugs.gnu.org; Sun, 18 Aug 2024 11:46:11 -0400 Original-Received: from eggs.gnu.org ([2001:470:142:3::10]) by lists.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.90_1) (envelope-from ) id 1sfi3r-0006nW-Oq for bug-gnu-emacs@gnu.org; Sun, 18 Aug 2024 11:43:20 -0400 Original-Received: from mail-vs1-xe32.google.com ([2607:f8b0:4864:20::e32]) by eggs.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_128_GCM_SHA256:128) (Exim 4.90_1) (envelope-from ) id 1sfi3l-0007mq-UZ for bug-gnu-emacs@gnu.org; Sun, 18 Aug 2024 11:43:16 -0400 Original-Received: by mail-vs1-xe32.google.com with SMTP id ada2fe7eead31-49297fca3c2so1272392137.1 for ; Sun, 18 Aug 2024 08:43:13 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20230601; t=1723995792; x=1724600592; darn=gnu.org; h=to:subject:message-id:date:from:mime-version:from:to:cc:subject :date:message-id:reply-to; bh=Ztsa3IUJu9CipLfEkZT/V63pl5TX4hicuK8SNU19kQk=; b=HAN71b75F2ZOTnkvT8rwkj1rEkTpTgL9b792p8QmmOMS8uAkp+kYcF9+gTGmxY0uto eo72be3HktPnIXKfKeBVhYrajjv9v9Zn4ueqcfEhWCDx85UzbSrf8YMzvDU2JgRd3kIS LUc2DPBo9TJSAKXXMjNevbDo0N8ehBAP2cS2geGPi1avZwuKcIX2X44pEdGkBp5wBDQ1 vEM+aN1Lty6RBiWqiRvmQaMbyL3/bQWOoh/EhKpNNgZfaLHLjvDjNTUMXhSwMXT1ZbxF lOkhb8/TA3raI0FsqtkCSjgeOpH2YHAdMi1bnEt2LzUucnVAzUMa9zkbbbxQf7scgbre ybuA== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20230601; t=1723995792; x=1724600592; h=to:subject:message-id:date:from:mime-version:x-gm-message-state :from:to:cc:subject:date:message-id:reply-to; bh=Ztsa3IUJu9CipLfEkZT/V63pl5TX4hicuK8SNU19kQk=; b=F+Ywt3wRAZsQ2tVrwP+aK2AQj71GWYg1Dguw5KB1a2TE8G37oBkVQk5Jap+/uv2ept kyq4ezjdYFnnK8gM//1QVo5zjTo0OU1C1A+HQ0BdgMlTmWWXdiatlc0LfslkYQZS1BRu cNh/0U/WckKgG1pqIg3MA1UP27IHS8NMxJPBuXMfFijBQMt0wiBgLRtiwUMlMOzYqeE3 13vTEWpHSK32VaFlupGlyD6TQy8ehodLVdOrG/5UssszqV52ETlZQNAZERkYxQr5ogqn u7Goz0cHXtXR/yZ6cK8h9FzyeMcUrkj3I4z5iDvXuCcFSpmeR6FTM9XNSH0KK1tBhptQ haVg== X-Gm-Message-State: AOJu0YwZYJ+0kGlbumKm0DPQHFFPExRTfll3q5B2IY2KrGhfPtdMY7pJ MQaYrOolG9tmmvU5XcUy8AEMCUL2uJowk0MLicFNs1zoxxjJYgVlc86kH68Nm02eN2ULEZMc8R8 w2abrVaRldiWrjbn6QPp4QsNIiclG33DN X-Google-Smtp-Source: AGHT+IFRzOCDfm88HmVLMzBug0eDhBHPYqqLCe888RtS8MQAkxDaoqt9zDEkZKI/uGFfPQLw36KxP/LIYTd3iyvssM0= X-Received: by 2002:a67:e242:0:b0:498:9c0a:af1a with SMTP id ada2fe7eead31-4989c0abc0fmr3076286137.4.1723995792173; Sun, 18 Aug 2024 08:43:12 -0700 (PDT) Received-SPF: pass client-ip=2607:f8b0:4864:20::e32; envelope-from=shipmints@gmail.com; helo=mail-vs1-xe32.google.com X-Spam_score_int: -20 X-Spam_score: -2.1 X-Spam_bar: -- X-Spam_report: (-2.1 / 5.0 requ) BAYES_00=-1.9, DKIM_SIGNED=0.1, DKIM_VALID=-0.1, DKIM_VALID_AU=-0.1, DKIM_VALID_EF=-0.1, FREEMAIL_FROM=0.001, HTML_MESSAGE=0.001, RCVD_IN_DNSWL_NONE=-0.0001, SPF_HELO_NONE=0.001, SPF_PASS=-0.001, T_SCC_BODY_TEXT_LINE=-0.01 autolearn=ham autolearn_force=no X-Spam_action: no action X-BeenThere: debbugs-submit@debbugs.gnu.org X-Mailman-Version: 2.1.18 Precedence: list X-BeenThere: bug-gnu-emacs@gnu.org List-Id: "Bug reports for GNU Emacs, the Swiss army knife of text editors" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: bug-gnu-emacs-bounces+geb-bug-gnu-emacs=m.gmane-mx.org@gnu.org Original-Sender: bug-gnu-emacs-bounces+geb-bug-gnu-emacs=m.gmane-mx.org@gnu.org Xref: news.gmane.io gmane.emacs.bugs:290331 Archived-At: --000000000000c97561061ff70cca Content-Type: text/plain; charset="UTF-8" project-files-relative-names was introduced a few months ago, so it's no surprise that there are some side effects when set. This affects the handler for workspace/didChangeWatchedFiles. The result is that dirs-to-watch... (dirs-to-watch (delete-dups (mapcar #'file-name-directory (project-files (eglot--project server)))))) ...is nil when project-files-relative-names is t, due to file-name-directory failing to parse the directories it was expecting. This results in file-readable-p failing with a nil dir: (watch-dir (dir) (when-let ((probe (and (file-readable-p dir) One solution which I've tested is simply the defensive: (project-files-relative-names nil) ; add this (dirs-to-watch (delete-dups (mapcar #'file-name-directory (project-files (eglot--project server)))))) -Stephane --000000000000c97561061ff70cca Content-Type: text/html; charset="UTF-8" Content-Transfer-Encoding: quoted-printable
project-files-relative-names was introduced a few months=C2=A0ago, so it= 's no surprise that there are some side effects when set.

This affects the handler= for=C2=A0workspace/didChangeWatchedFiles. The result is that dirs-to-watch= ...

<= /div>
=C2=A0 = =C2=A0 =C2=A0 =C2=A0 =C2=A0(dirs-to-watch
=C2=A0 =C2=A0 =C2=A0 =C2=A0 = =C2=A0 (delete-dups (mapcar #'file-name-directory
=C2=A0 =C2=A0 =C2= =A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 = =C2=A0 =C2=A0 =C2=A0(project-files
=C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 = =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2= =A0 (eglot--project server))))))

...is nil when=C2=A0project-files-relative-names is= t, due to file-name-directory failing to parse the directories it was expe= cting. This results in file-readable-p failing with a nil dir:

=C2=A0 =C2=A0 =C2=A0 =C2= =A0 =C2=A0(watch-dir (dir)
=C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0(whe= n-let ((probe
=C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 = =C2=A0 =C2=A0 =C2=A0 =C2=A0(and (file-readable-p dir)

One solution which I've = tested is simply the defensive:

=C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0(project-files-relativ= e-names nil) ; add this
=C2=A0 =C2=A0 =C2= =A0 =C2=A0 =C2=A0(dirs-to-watch
=C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 (dele= te-dups (mapcar #'file-name-directory
=C2=A0 =C2=A0 =C2=A0 =C2=A0 = =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2= =A0 =C2=A0(project-files
=C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2= =A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 (eglot--= project server))))))

-Stephane
--000000000000c97561061ff70cca--