Subject: Re: bug#61637: 30.0.50; Fix Eglot tests that need HOME=~USER

From: Eli Zaretskii <[email-masked]>
Date: Mon, 20 Feb 2023 15:01:08 +0200

> Cc: "João Távora" <[email-masked]>
> Date: Sun, 19 Feb 2023 19:10:03 +0000
> From:  "Basil L. Contovounesios" via "Bug reports for GNU Emacs,
>  the Swiss army knife of text editors" <[email-masked]>
> 
> 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
> 
> The following patch temporarily sets HOME=~USER in only those tests that
> need it.  The patch consolidates some let-bindings into a single form to
> minimise collateral indentation changes.  It also bumps the
> rust-analyzer client/registerCapability timeout from 1 second to 3,
> because sometimes 1 second was too short a wait.  Finally, it updates
> the expected autopep8 reformatting results to what I see locally, and
> skips a test that fails without YASnippet.

I'd rather we didn't touch the real user home directory during tests,
it could do real damage or at the very least cause unintended changes
to the user customizations.

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)?

> WDYT?  And should any fixes go to emacs-29 or master?

Master, please.  We have enough adventures on emacs-29 already.  And
this one is not really critical.