Closed Immortalin closed 2 years ago
This is a known issue. There are two workarounds currently:
edgedb
CLI. It is explicitly aware of WSL and uses WSL to run EdgeDB properly.edgedb instance start example
Are there any performance implications when using the Windows binary? Will the DB be created on the WSL filesystem or will it be created on the Windows side?
Are there any performance implications when using the Windows binary?
None.
Will the DB be created on the WSL filesystem or will it be created on the Windows side?
The instances will be created in a new WSL distribution called EdgeDB.WSL.1
. The only limitation of this approach is that you'll only be able to access EdgeDB instances from the Windows host, and not other WSL distros (this is a general WSL limitation, there's no cross-distro networking per se).
So if I am developing my app in WSL I should stick with the second method?
Yes.
The general rule is:
edgedb
binary.edgedb
binary (and use manual instance control for now)@tailhook, is there anything we can do here to improve the experience?
@tailhook, is there anything we can do here to improve the experience?
I'm not sure. The message is quite clear and doesn't suggest this is a bug by itself. I don't think it's a good idea to suggest running windows-native edgedb CLI because this is usually not what users want. We also can't check for WSL explicitly instead of checking for system, as I believe it should be technically possible to run systemd in WSL (although, you will have to log in to get the service running). Adding windows startup files from inside the user-managed WSL distribution may also lead to some undesired effects.
But generally I'm open to ideas.
There are three potential solutions: add the DB start service to the WSL user shell startup/profile script, add a GUI on the Windows side like what docker desktop does, or automatically start the instance behind the scenes when edgedb
is ran in a project folder containing the toml file.
There are three potential solutions: add the DB start service to the WSL user shell startup/profile script,
This is interesting approach. Although, not without issues:
wsl something
, not just wsl
)?start-conf=auto
so, we'll probably need to introduce start-conf=shell-profile
or similar. And this has to be enabled manually? If it's not, we may eventually get into situation when edgedb is started both from profile and systemd for some user and it will make it mess to debug.(2), and (3) can be shielded as much as possible from user by carefully spawning in background and hiding the output, but may still impose problems at times.
add a GUI on the Windows side like what docker desktop does, or
This is very similar to how we already handle windows from native context (i.e. we manage custom distro, support auto-start, etc.). Applying this to user managed distributions means trying to solve issues when user upgraded/removed the distribution, and also somehow keep in track global list of instances because clashes may be a problem, and deal with several other kinds of metadata synchronization errors between host system and distros.
automatically start the instance behind the scenes when
edgedb
is ran in a project folder containing the toml file.
We have discussed this multiple times. The problem that it only works when you use edgedb for running repl. But I think more common would be running an app instead. And users will see this as a bug ("repl is working, why my app couldn't connect few seconds ago?"). And if you want to start and instance for the app, instance start
is more straightforward than running repl to start the instance.
So at this point, I'm not sure any of these are worth the effort. Given that we hint how to start an instance and it's easy to put that into the shell profile file if you wish.
Steps to Reproduce:
edgedb project init