Given the brittleness there should be at least a single configuration that works. I believe that tikhonj is right in the sense that nix can capture this configuration. Nix is not required but I can see how it can help.
Nix would be useful for a description of the non-Emacs dependencies. Particular versions of the compiler and LSP program. -- Some languages are more fickle about this than others.