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
Update ~/.slime to use $XDG_DATA_HOME #787
base: master
Are you sure you want to change the base?
Conversation
This commit updates the `~/.slime` references in `Makefile` and `swank-loader.lisp` to check for XDG_DATA_HOME. If the environment variable is set, it uses $XDG_DATA_HOME/slime as the default fasl directory. This change is necessary as there is no way to avoid creation of "~/.slime" when loading a system that requires Swank. My personal example is trying to port a Clack application to OpenBSD. The OpenBSD build system does not allow writing to home directories as part of the build process. Prior to these changes, I tried using asdf:defsystem-depends-on, asdf:around-compile, and use of a secondary system to only load swank.
Relates to #610 |
If the XDG_DATA_HOME environment variable is unset, it is still returned as truthy from `uiop:getenv`. This commit explicitly checks that the entry returned has more than zero characters. Function now operates as intended.
Can it be made optional? |
Using the environment variable alone seems to be the least intrusive means to change the behavior. How would you like it to be made optional? There is no way to pass command-line arguments or any other switches during (for instance) a quickload installation of swank. A separate environment variable could be used, or a sentinel file, but these methods all seem to add more cludge that necessary. Please advise |
The use of XDG_DATA_HOME comes from the Free Desktop specification. |
I don't have XDG_DATA_HOME or Free Desktop on macOS, so having different locations on the two systems I use at the same time is going to be inconvenient. |
I don't have XDG_DATA_HOME on OpenBSD either (it would depend on the window manager choice). My motivation for the change is to have control over the location of the slime directory during installation. Would using a "SLIME_DATA_DIRECTORY" environment variable do the trick? That would mean the current behavior only changes if someone chooses to change it. One could then set SLIME_DATA_DIRECTORY=XDG_DATA_HOME if that's the behavior they want. Different environment variable? |
This commit changes the environment variable that is read from XDG_DATA_HOME to SLIME_HOME_DIR. If this variable is set, and non-empty, then it will be used rather than `~/.slime`.
This commit updates the
~/.slime
references inMakefile
andswank-loader.lisp
to check for XDG_DATA_HOME. If the environment variable is set, it uses $XDG_DATA_HOME/slime as the default fasl directory.This change is necessary as there is no way to avoid creation of "~/.slime" when loading a system that requires Swank. My personal example is trying to port a Clack application to OpenBSD. The OpenBSD build system does not allow writing to home directories as part of the build process.
Prior to these changes, I tried using asdf:defsystem-depends-on, asdf:around-compile, and use of a secondary system to only load swank.