# Fix \`Failed to load environment variables\` error message after self-update on Linux \(\#46367\) · gitcafe/zed

[View on GitCafe](https://git.cafe/gitcafe/zed/commit/271bcf65ef8759591006e5127ca2da9d16a925fd)

Repository: [gitcafe/zed](https://git.cafe/gitcafe/zed)

Visibility: public

Requested revision: 271bcf65ef8759591006e5127ca2da9d16a925fd

Requested commit: 271bcf65ef8759591006e5127ca2da9d16a925fd

Commit: 271bcf65ef8759591006e5127ca2da9d16a925fd

Tree: dd5866170822d12dfe077aa83fb14bef164ed563

Author: Martin Pool

Committer: GitHub

## Message

```
Fix `Failed to load environment variables` error message after self-update on Linux (#46367)

Closes #46365

The behavior I'm trying to handle here is documented in
https://man7.org/linux/man-pages/man5/proc_pid_exe.5.html.

[@merlinz01

](https://github.com/zed-industries/zed/issues/46365#issuecomment-3723996684)
points to some other alternatives but they don't seem necessary or
justified here.

# Testing

I've manually replaced the binary of a process running this build, to
simulate an update, and then opened a new tree and I don't see the error
message.

I don't know if there's a reasonable way to unit-test this? Let me know.
It seems like it would require using something like rusty-fork to spawn
a specific binary for the test, which I don't think I see already in the
Zed tree and perhaps it would be overkill to add just for this?


Release Notes:

- Fixed "Failed to load environment variables" after applying an update
```

## Parents

- [d35fee1cd131df90d1e14e06ec75f7d1c0a3bcf6](https://git.cafe/gitcafe/zed/commit/d35fee1cd131df90d1e14e06ec75f7d1c0a3bcf6?format=markdown)

[Source at this commit](https://git.cafe/gitcafe/zed/tree/271bcf65ef8759591006e5127ca2da9d16a925fd?format=markdown)
