all messages for Emacs-related lists mirrored at yhetil.org
 help / color / mirror / code / Atom feed
From: Eli Zaretskii <eliz@gnu.org>
To: "João Távora" <joaotavora@gmail.com>
Cc: contovob@tcd.ie, 61637@debbugs.gnu.org
Subject: bug#61637: 30.0.50; Fix Eglot tests that need HOME=~USER
Date: Sat, 04 Mar 2023 09:46:00 +0200	[thread overview]
Message-ID: <83a60tarif.fsf@gnu.org> (raw)
In-Reply-To: <87bkl972du.fsf@gmail.com> (message from João Távora on Sat, 04 Mar 2023 01:04:45 +0000)

> From: João Távora <joaotavora@gmail.com>
> Cc: "Basil L. Contovounesios" <contovob@tcd.ie>,  61637@debbugs.gnu.org
> Date: Sat, 04 Mar 2023 01:04:45 +0000
> 
> I installed some language servers like clangd, rust-analyzer and pylsp,
> and they need to a valid HOME to be able to function.

Please tell more about this: what exactly do these servers need from
the home directory?

> diff --git a/test/lisp/progmodes/eglot-tests.el b/test/lisp/progmodes/eglot-tests.el
> index 5d5de59a19a..ad994915c52 100644
> --- a/test/lisp/progmodes/eglot-tests.el
> +++ b/test/lisp/progmodes/eglot-tests.el
> @@ -116,9 +116,7 @@ eglot--call-with-fixture
>                     ;; installations for LSP servers like pylsp, making
>                     ;; these tests mostly useless, so we hack around it
>                     ;; here with a great big hack.
> -                   ,(format "HOME=%s"
> -                            (if (file-exists-p home) home
> -                              (format "/home/%s" (getenv "USER")))))
> +                   ,(format "HOME=%s" (or (getenv "EGLOT_REAL_HOME") (getenv "HOME"))))
>                   process-environment))
>                 ;; Prevent "Can't guess python-indent-offset ..." messages.
>                 (python-indent-guess-indent-offset-verbose . nil)
> 
> This is acceptable for Eglot devs like me, but other devs that don't
> know about this variable will still be confused. WDYT?

As I said, I don't like the idea of using the user's real home
directory for test purposes.  We could end up clobbering precious
files there.  We could also have tests fail because some user setting
in the home directory makes the test results unpredictable.

> > Why not do this the other way around: trick Eglot to think the home
> > directory doesn't exist (as I understand it already knows how to
> > handle this)?
> 
> I don't understand what you mean: this is entirely constrained to how
> certain language servers work, so eglot.el itself can't handle it.

In the original report, Basil sais:

> The main problem is that:
> 0. test/Makefile.in sets HOME=/nonexistent
> 1. lisp/emacs-lisp/ert-x.el sets HOME=/tmp :(
> 2. eglot--call-with-fixture tries to detect when HOME is nonexistent,
>    but /tmp exists, so that's left unchanged
> 3. The Rust tools look under HOME=/tmp for which toolchain to use, but
>    the answer is under ~USER, so they give up

I interpreted item 2 as meaning that eglot--call-with-fixture can cope
with the situation where the user's home directory doesn't exist, and
suggested to trick Eglot into thinking it doesn't exist in the cases
in point, as the means of solving the problem.

If my understanding is incorrect, or if what you describe here is a
different problem (thus item 2 is no longer relevant), I'd like to
better understand the details, so we could see if there are better
alternatives than to use the real home directory of the user running
the tests.





  reply	other threads:[~2023-03-04  7:46 UTC|newest]

Thread overview: 24+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2023-02-19 19:10 bug#61637: 30.0.50; Fix Eglot tests that need HOME=~USER Basil L. Contovounesios via Bug reports for GNU Emacs, the Swiss army knife of text editors
2023-02-19 19:38 ` João Távora
2023-02-20  9:22   ` Basil L. Contovounesios via Bug reports for GNU Emacs, the Swiss army knife of text editors
2023-02-20  9:30     ` João Távora
2023-02-20 13:02     ` Eli Zaretskii
2023-03-04  1:04       ` João Távora
2023-03-04  7:46         ` Eli Zaretskii [this message]
2023-03-04 11:48           ` João Távora
2023-03-04 12:46             ` Eli Zaretskii
2023-03-04 13:23               ` João Távora
2023-03-04 15:04                 ` Eli Zaretskii
2023-03-04 17:21                 ` Basil Contovounesios via Bug reports for GNU Emacs, the Swiss army knife of text editors
2023-03-04 19:35                   ` João Távora
2023-03-04 17:28               ` Basil Contovounesios via Bug reports for GNU Emacs, the Swiss army knife of text editors
2023-03-04 19:22                 ` João Távora
2023-04-10 10:09                   ` Basil Contovounesios via Bug reports for GNU Emacs, the Swiss army knife of text editors
2023-03-04 17:20             ` Basil Contovounesios via Bug reports for GNU Emacs, the Swiss army knife of text editors
2023-03-04 17:26           ` Basil Contovounesios via Bug reports for GNU Emacs, the Swiss army knife of text editors
2023-03-04 19:19             ` João Távora
2023-03-04 17:19         ` Basil Contovounesios via Bug reports for GNU Emacs, the Swiss army knife of text editors
2023-03-04 18:09           ` Eli Zaretskii
2023-03-04 19:27             ` João Távora
2023-03-04 19:25           ` João Távora
2023-02-20 13:01 ` Eli Zaretskii

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=83a60tarif.fsf@gnu.org \
    --to=eliz@gnu.org \
    --cc=61637@debbugs.gnu.org \
    --cc=contovob@tcd.ie \
    --cc=joaotavora@gmail.com \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
Code repositories for project(s) associated with this external index

	https://git.savannah.gnu.org/cgit/emacs.git
	https://git.savannah.gnu.org/cgit/emacs/org-mode.git

This is an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.