-
Notifications
You must be signed in to change notification settings - Fork 848
Description
On Windows, Stack uses an incorrect location to store data, which causes problems for people using roaming profiles feature of Windows (mostly at enterprises). Mostly it means that logons take longer as this folder is synchronized over LAN.
The problem persists through Haskell infrastructure because of deficiencies in directory library as it doesn't have separate local/roaming locations because roaming per-user config is irrelevant in non-windows AFAIK. See haskell/cabal#4597 for a related issue with Cabal (not created by me)
The biggest consumers of my precious (it's normally limited by a disk quota by sysadmin bureacracy) roaming profile space are stack, local and cabal folders, all Haskell-related.
Although commonly they are fixed paths relative to user's home dir, and also stored in the registry, we shouldn't rely on this and use SHGetKnownFolderPath C call with FOLDERID_LocalAppData argument to get the right place. Note that it's slightly more complex if we want to support Server 2003 and Windows XP. Of course it's not a good idea to do that in stack but in directory.
Besides the roaming profile problems, there is inconsistency: indices, snapshots etc are stored in %appdata%/stack, and ghc/mingw in %appdatalocal%/programs/stack (which is FOLDERID_UserProgramFiles/stack)
IMO the best solution is to install all unix-style apps (including haskell compiled binaries) to FOLDERID_UserProgramFiles/local/bin. This way many apps can coexist (e.g. git and neovim can be safely put there ans use bin, share etc subfolders in local, so it becomes an analog of the ~/.local hierarchy)
The least invasive solution is probably just to use FOLDERID_LocalAppData/cabal and FOLDERID_LocalAppData/local instead of FOLDERID_AppData/* as it's done now.
There are guides for windows analogous to man hier, so I can provide with references if needed. But the topic of where put unix-style per-user software is very controversial, so I don't expect a quick and easy solution.