GNU bug report logs -
#61637
30.0.50; Fix Eglot tests that need HOME=~USER
Previous Next
Reported by: "Basil L. Contovounesios" <contovob <at> tcd.ie>
Date: Sun, 19 Feb 2023 19:16:02 UTC
Severity: minor
Tags: patch
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.
Full log
Message #44 received at 61637 <at> debbugs.gnu.org (full text, mbox):
João Távora [2023-03-04 11:48 +0000] wrote:
> In fact, I missed this in Basil's patch, but I think the correct fix is
> actually to fix eglot--call-with-fixture directly
I'm not sure what you mean by 'directly': the patch below
unconditionally sets HOME=~USER for all eglot-tests.el, whereas the
patch in the OP was more conservative in doing this for only those tests
which are found to need it, thus mitigating to an extent the risk that
Eli is (understandably) concerned about.
> diff --git a/test/lisp/progmodes/eglot-tests.el b/test/lisp/progmodes/eglot-tests.el
> index 5d5de59a19a..5f5adc8e5b3 100644
> --- a/test/lisp/progmodes/eglot-tests.el
> +++ b/test/lisp/progmodes/eglot-tests.el
> @@ -103,22 +103,21 @@ eglot--call-with-fixture
> (set (car spec) (cadr spec)))
> ((stringp (car spec)) (push spec file-specs))))
> (unwind-protect
> - (let* ((home (getenv "HOME"))
> - (process-environment
> + (let* ((process-environment
> (append
> `(;; Set XDF_CONFIG_HOME to /dev/null to prevent
> - ;; user-configuration to have an influence on
> + ;; user's configuration to have an influence on
> ;; language servers. (See github#441)
> "XDG_CONFIG_HOME=/dev/null"
Note that test/Makefile.in already unexports XDG_CONFIG_HOME, so
eglot-tests.el needs not concern itself with it.
> ;; ... on the flip-side, a similar technique by
> ;; Emacs's test makefiles means that HOME is set to
> - ;; /nonexistent. This breaks some common
> - ;; 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")))))
> + ;; /nonexistent or /tmp/. This breaks some common
> + ;; installations for LSP servers like pylsp, and
> + ;; rust-analyzer, making these tests mostly
> + ;; useless, so we hack around it here with a great
> + ;; big hack.
> + ,(format "HOME=%s" (expand-file-name (concat
> + "~" (user-login-name)))))
> process-environment))
> ;; Prevent "Can't guess python-indent-offset ..." messages.
> (python-indent-guess-indent-offset-verbose . nil)
--
Basil
This bug report was last modified 2 years and 106 days ago.
Previous Next
GNU bug tracking system
Copyright (C) 1999 Darren O. Benham,
1997,2003 nCipher Corporation Ltd,
1994-97 Ian Jackson.