Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

cove always assumes you're in the dist directory #5

Closed
weebney opened this issue Aug 23, 2023 · 6 comments
Closed

cove always assumes you're in the dist directory #5

weebney opened this issue Aug 23, 2023 · 6 comments

Comments

@weebney
Copy link

weebney commented Aug 23, 2023

$ pwd
/var/tmp/emptydir
$ ls
$ /path/to/cove
...
2023/08/23 01:49:14 main.go:45: error in main: opening data db: sqlite.Conn.LoadExtension: SQLITE_ERROR: ./dht-indexer-rust.so: cannot open shared object file: No such file or directory
$ ls
ledis  torrents.db  transcoder

Running cove from outside of the dist directory (where the binary and dht-indexer-rust.so are) does not work because it seems to assume that it is only being run in its own directory. As a result, it will create some files & folders in the working directory and will fail to launch because it can't find dht-indexer-rust.so in the working directory.

@anacrolix
Copy link
Owner

v0.0.8 supports running cove externally. dht-indexer-rust.so must be either in the working directory, or the same directory as the cove binary.

@anacrolix
Copy link
Owner

Ok this is released.

@weebney
Copy link
Author

weebney commented Aug 23, 2023

Could be nice to have the option specify a separate data dir; by default something like ~/.local/share/cove on Linux or %appdata%\cove on Windows.

@weebney
Copy link
Author

weebney commented Aug 23, 2023

Just realized this is not fixed entirely—cove still creates a bunch of data files in the working directory. I added a workaround by wrapping cove in a script that moves you to a default data directory, but this really should be managed by cove and not the user.

@anacrolix
Copy link
Owner

anacrolix commented Aug 23, 2023

Hmm this is by design. I somewhat opinionatedly believe long running processes should store their state in the working directory otherwise what is it for?

All the files produced in the working directory are cache files for now, so you could cwd to the standard for Arch using a wrapper script perhaps?

I'm open to adding the flags if it becomes a blocker for correct usage, and particularly if cove starts needing a configuration file or something like that.

@weebney
Copy link
Author

weebney commented Aug 24, 2023

Ultimately, it's your project and your call but I'm not sure what real benefit there is to breaking convention here—on both Windows and *NIX there's a standard way to store cached state that's easily available in os.UserCacheDir.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants