
On Mon, 2008-08-04 at 11:56 +1000, Manuel M T Chakravarty wrote:
Just some random remarks:
Thanks for the useful feedback on OSX conventions. I was unaware about several of them.
* Hiding installed files in a . directory is very bad style IMHO. I think that should never happen.
Just on OSX or on Unix too? On Linux I'm not sure where else we could put things that's per-user. People seem to object strenuously to programs automatically putting files in any dir other than ~/.progname (or one or two other .files established by specification or convention).
Independent of whether you install right into /usr/local/bin or whether you symlink or whatever. You might install files under /usr/local/lib/cabal and then symlink, but probably its nicer to installto /usr/local/lib/<package>-<version> and then symlink.
For global installs we use prefx=/usr/local at the moment, so that mean /usr/local/lib/<package>-<version> for libs and /usr/local/bin for binaries. I've just implemented the symlinking feature so we could change the default on global installs to use the version suffix on binaries and symlink back into /usr/local/bin. Or do you mean we should install binaries into /usr/local/lib(exec?)/<package>-<version> and then symlink into /usr/local/bin. That would also be reasonable I suppose, though then the versioned binaries are not on the path.
* On OS X, its not generally appropriate to install into /usr/local either. Each user has ~/Applications and ~/Library directories that are usually used for per-user installs. Just generally using sudo and put binaries into /usr/local is also bad because not every user will have admin rights on the machine.
Oh, great. I didn't know OS X had a standard location for per-user installs. That's excellent. So is there a preferred layout for those dirs? I'm guessing there probably is.
* ~/.cabal is bad on Mac OS, too. Preferences ought to go into ~/ Library/Preferences/
Ok. BTW, in that case we should probably fix System.Directory.getAppUserDataDirectory to follow the system convention on OSX. Currently it uses $HOME/.appname on all unix systems (and the Windows convention on Windows). If necessary we may want to split getAppUserDataDirectory into a variant for config and another for data. Since cabal-install is a program should it still be using ~/Library/Preferences/ or is there are corresponding ~/Applications/Preferences/ ? Where would be appropriate for cabal-install put its download cache and build logs?
* Versioning should be the default (and not optional).
Well, it's always configurable (distros that allow only a single version of a program probably would not want it for example), but yes, I think it's a pretty sensible default configuration. We version libs of course, but up 'til now all binaries have been unversioned. We recently added support for arbitrary program prefixes and suffixes (which can include program $version var) and adding unversioned symlinks into some other dir. It's less clear what we'd do on windows if we want versioned binaries since there are no links. Duncan