-
Notifications
You must be signed in to change notification settings - Fork 644
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
Use XDG directories #3456
base: master
Are you sure you want to change the base?
Use XDG directories #3456
Conversation
The problem here is that not all of it is actually configuration. |
@adamsmd Thanks for the contribution. Is this a fix for the issue #3334 and/or #3355? There was some discussion on potential issues affecting a change. Unfortunately it is not a one line fix, some more parts of the compiler need changing, as @Melvar mentioned, the directory specification used by Idris is not solely contained in If we can address these then potentially we discuss if we should change where Idris installs itself. Any questions please ask. |
(Apologies for the length of reply. I just want to lay out my reasoning. I hope this doesn't devolve into a long discussion.) @jfdm @Melvar This is not a fix of issue #3334 or #3355. Those deal install locations and are a broader issue that I don't have time to get embroiled in. This patch deals with user specific data and settings that are currently in As to where things should go, from the looks of the source code, the only files in For Runtime is for things like open pipes and such, so I don't think it belongs there. At first, it might look like cache because it is automatically generated and will be regenerated if deleted. However, I would expect things in cache to be okay to put in a This leaves configuration versus data files. This is harder to decide, and I could find no clarifications or guidelines for which history belongs to with XDG. I did find a proposal for adding a directory for application state (e.g. history, recently opened files, window locations, etc.). See https://wiki.debian.org/XDGBaseDirectorySpecification, but it doesn't look like it got traction. If we analogize to system-level directories, I don't think history would belong in either I also haven't been able to figure out what other apps do for this. Nothing stood out when I looked through my Is it a data file? On the one hand, history is data created by the user (which would argue for Is it a configuration file? On the one hand, many apps put 'clear history' in the preferences dialog and history files are often put in In summary, if you think it should go in |
I don't understand the Travis output. Could someone more familiar with the system help me figure out what went wrong? |
Seems like Setup.hs is flaking out with a segfault on GHC 7.10.3, maybe you can run it locally with 7.10.3 and see if it is reproducible. |
I personally would consider history, and more generally application state, to fall under user data. |
First, thanks for the detail thought process. It makes you intentions and rationale nice and clear. Kudos. From appearances, I think everyone is happy with having Idris support the XDG specification, less so about the value. I too have been considering this for alternate reasons, and had yet to think about the REPL user files. My initial thinking is for user directory to be treated as configuration files, and for the history to be either treated as cache or data. For the purposes of this commit, I think it is okay for Idris' REPL files to be contained within the same directory under Idris' XDG_CONFIG value. We can always fix the location, and Idris' XDG specification support at a later dat. |
Also, i've restarted the trivia build, and can confirm that on Mac OS X XDG is treated as UNIX, |
I've cleaned the cache and restarted the build hopefully, this will get the tests completing... |
The consensus seems to be for putting @jfdm: It looks like you've been doing some work in this area. If want to implement this yourself, feel free to do that instead of this pull request. |
I have tried to restart the Travis jobs for 7.10. |
It seems that |
@RyanGlScott Hi, since you are a bit familiar with GHC, I will try to ask you a bit for help! Do you have an idea why GHC 7.10.3 segfaults when increasing the |
I have no idea why it's segfaulting, and moreover, I can't reproduce it locally. Perhaps using a more recent version of |
@RyanGlScott Thanks, I will try. |
It still fails even when changing cabal-install to |
Well, the good news is that I managed to reproduce the issue and minimize it (see my |
@RyanGlScott Thanks for taking a look! Yeah it looks very weird. |
As noted here, the issue seems to be that we're now installing a more recent version of A somewhat feasible workaround is to install a more recent version of |
@RyanGlScott Great, thanks for looking at it. I guess this would be solved if we could somehow fix #3708 . |
#3708 has been closed. Anything else blocking this? |
@mixedCase The code does not pass the tests for 7.10. |
I will try to increase the cabal bounds. |
@RyanGlScott Sorry, but could you kindly try to take a look at this again? |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Sorry, I've lost context on this PR a bit. What is the minimum version of GHC that Idris currently supports? This matters since getXdgDirectory
was introduced in process-1.2.3.0
, so in order to avoid the problems in haskell/cabal#4423, I believe the simplest fix would be to use GHCs that all come shipped with a recent-enough version of process
.
It appears that GHC 7.10.3 comes shipped with process.1.2.3.0
, and if I'm reading this .travis.yml
file correctly, then Idris is using 7.10.3 as a minimum? If so, that might make our lives easier.
@@ -264,7 +264,7 @@ Library | |||
, cheapskate < 0.2 | |||
, containers >= 0.5 && < 0.6 | |||
, deepseq < 1.5 | |||
, directory >= 1.2.2.0 && < 1.2.3.0 || > 1.2.3.0 | |||
, directory > 1.2.3.0 |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
This bound should be directory >= 1.2.3
, if I understand the situation correctly.
Oh rats, I misread that. |
In that case, we could either:
|
@RyanGlScott Thanks for responding. |
Support for XDG directories was added in version 1.2.3.0 of the
directory
package so adding support to Idris was a one line change. I also removed some unneeded import lines forSystem.Directory
that I found in the process.This means that on Unix systems
~/.config/idris
will be used instead of~/.idris
. If you have anything in~/.idris
that you want to keep using, you will have to manually move it to~/.config/idris
. The old~/.idris
can be deleted.On Windows, the behavior is unchanged and uses
%APPDATA%
though I don't have a Windows machine on which to test this.I don't know what happens on OSX, but I suspect it is the same as on Unix systems though I don't have an OSX machine on which to test this. One could make the argument that it should go to
~/Library/
or~/Library/Preferences/
instead, but it wasn't going there before so I'll leave that for future work.