mattwparas / steel

An embedded scheme interpreter in Rust
Apache License 2.0
1.07k stars 50 forks source link

Follow the XDG Base Directory Specification #242

Open hakan-demirli opened 2 months ago

hakan-demirli commented 2 months ago

XDG Base Directory Specification dictates which files should go where.

Steel currently dumps its dir to the home directory.

dryya commented 1 month ago

+1 from me, I would really love to see this changed now while steel is in alpha/beta instead of waiting until later and making this minor usability change more complicated.

mattwparas commented 1 month ago

I don't disagree, however I wasn't quite sure where "programming language files and libraries" fell under the spec - also in the meantime while I figure out how to handle this, you can set the location where steel installs things by setting the $STEEL_HOME env var

mattwparas commented 1 month ago

I guess the question then, is do steel library files go under the xdg equivalent of ~/.local/share/steel or /.local/lib/steel? I don't have a preference myself

kskarthik commented 1 month ago

Yes, $STEEL_HOME could be set to any $XDG_*

hakan-demirli commented 1 month ago

I guess the question then, is do steel library files go under the xdg equivalent of ~/.local/share/steel or /.local/lib/steel? I don't have a preference myself

It depends on whether the library files are shared. I would go with ~/.local/lib/ since it should be ok as long as the usage is consistent. Ubuntu manual describes the paths as follows:

~/.local/lib/
           Static, private vendor data that is compatible with all architectures.

~/.local/lib/arch-id/
   Location for placing public dynamic libraries. The architecture identifier to use is
   defined on Multiarch Architecture Specifiers (Tuples)[6] list.

~/.local/share/
           Resources shared between multiple packages, such as fonts or artwork.
genevieve-me commented 1 month ago

For what it's worth I would also suggest that the history file be kept in XDG_STATE_HOME. I don't think ~/.local/lib is actually defined in the XDG spec, nor is there an environment variable for it, but I also wouldn't really mind if it were used. I think the standard for that was put forward by systemd: https://www.freedesktop.org/software/systemd/man/latest/file-hierarchy.html