Re: [Hackage] #116: Odd paths on Windows

#116: Odd paths on Windows ---------------------+------------------------------------------------------ Reporter: igloo | Owner: ijones Type: defect | Status: new Priority: high | Milestone: Component: Cabal | Version: 1.1.6 Severity: normal | Resolution: Keywords: | Ghcversion: 6.6 Difficulty: normal | Platform: Linux ---------------------+------------------------------------------------------ Changes (by duncan): * priority: normal => high Comment: We should fix this. It's easy to move "\Haskell" into the $prefix rather than where it is currently in the $bindir and $libdir defaults. It's now really easy to change it's all specified clearly in Distribution.Simple.InstallDirs.defaultInstallDirs, we just need to decide what defaults we actually want on Windows. -- Ticket URL: http://hackage.haskell.org/trac/hackage/ticket/116 Hackage http://example.com/ My example project

On Fri, 2007-08-24 at 13:35 +0000, Hackage wrote:
#116: Odd paths on Windows
We should fix this.
It's easy to move "\Haskell" into the $prefix rather than where it is currently in the $bindir and $libdir defaults.
It's now really easy to change it's all specified clearly in Distribution.Simple.InstallDirs.defaultInstallDirs, we just need to decide what defaults we actually want on Windows.
So the current scheme on windows is: windowsProgramFilesDir <- getWindowsProgramFilesDir windowsCommonFilesDir <- getWindowsCommonFilesDir let prefixDir = windowsProgramFilesDir binDir = "$prefix" > "Haskell" > "bin" libDir = "$prefix" > "Haskell" libSubdir = case comp of Hugs -> "hugs" > "packages" > "$pkg" JHC -> "$compiler" _other -> "$pkgid" > "$compiler" libexecDir = "$prefix" > "$pkgid" includeDir = "$libdir" > "$libsubdir" > "include" dataDir = if hasLibs then windowsCommonFilesDir else "$prefix" > "Haskell" dataSubdir = "$pkgid" docDir = "$datadir" > "doc" > "$pkgid" htmlDir = "$docdir" > "html" So I'd suggest the following changes: "Haskell" should be part of the prefix rather than part of the bindir and libdir. So we'd still get C:\program file\Haskell by default, but if someone specified --prefix=c:\foobar\ then they'd really get c:\foobar\ not c:\foobar\haskell. I'd also change the doc dir to be independent of the data dir on windows (though leave it relative to datadir on unix). This is because on windows for libraries, the data dir is not relocatable, we use the windows common files dir. However we don't need to do that for documentation. However I'm not sure what directory it should go in. Here's the layout of a standard binary package: C:\program files\haskell\bin\foo.exe C:\program files\haskell\foo-1.0\myprogdata.txt Here's the layout of a standard library package: C:\program files\haskell\foo-1.0\ghc-6.6.1\libHSfoo.a C:\program files\haskell\foo-1.0\ghc-6.6.1\HSfoo.o C:\program files\haskell\foo-1.0\ghc-6.6.1\imports\{lots of hi files} C:\program files\common files\foo-1.0\mylibdata.txt where should documentation go? C:\program files\haskell\doc\html\foo\index.html C:\program files\haskell\doc\html\foo\foo.haddock etc (the \html\foo\foo.haddock subdir bit is not changable, that's where we put haddock docs relative to the docdir) and if I were to override the prefix I'd get: C:\MyPrefix\bin\foo.exe C:\MyPrefix\foo-1.0\myprogdata.txt or for a lib C:\MyPrefix\foo-1.0\ghc-6.6.1\libHSfoo.a C:\MyPrefix\foo-1.0\ghc-6.6.1\HSfoo.o C:\MyPrefix\foo-1.0\ghc-6.6.1\imports\{lots of hi files} C:\program files\common files\foo-1.0\mylibdata.txt and docs in: C:\MyPrefix\doc\foo-1.0\html\foo\index.html C:\MyPrefix\doc\foo-1.0\html\foo\foo.haddock I think Neil suggested we make it actually the same as unix, so like: C:\MyPrefix\bin\foo.exe C:\MyPrefix\share\foo-1.0\myprogdata.txt C:\MyPrefix\lib\foo-1.0\ghc-6.6.1\libHSfoo.a C:\MyPrefix\lib\foo-1.0\ghc-6.6.1\HSfoo.o C:\MyPrefix\lib\foo-1.0\ghc-6.6.1\imports\{lots of hi files} C:\program files\common files\foo-1.0\mylibdata.txt C:\MyPrefix\doc\foo-1.0\html\foo\index.html C:\MyPrefix\doc\foo-1.0\html\foo\foo.haddock As I've said, it's easy to change the code in Distribution.Simple.InstallDirs.defaultInstallDirs we just need to decide what we want to do. However, making libraries data files relocatable is not a simple task, so don't complain about the C:\program files\common files\foo-1.0 \mylibdata.txt anomaly unless you have a good suggestion :-). Also, in practise few library packages have data files, it's only docs we need to treat as not being data files on windows. Duncan

Hi
C:\program files\common files\foo-1.0\mylibdata.txt
Eek. The purpose of Common Files is for things that are shared between multiple programs, not for things that might move. Having C:\Program Files\Haskell\Fixed would be a lot better than polluting a directory that really should have been killed ages ago.
where should documentation go?
C:\program files\haskell\doc\html\foo\index.html C:\program files\haskell\doc\html\foo\foo.haddock
Anywhere you want, users will never find it without a shortcut on the start menu or some UI in their interpreter. Users should not be prodding around in Program Files, and in default Windows installs its hidden and you have to click a message "i really know what i'm doing" to see inside it.
However, making libraries data files relocatable is not a simple task, so don't complain about the C:\program files\common files\foo-1.0 \mylibdata.txt anomaly unless you have a good suggestion :-)
... text deleted since I don't have a good suggestion :-) ... Thanks Neil

On Fri, 2007-08-24 at 16:05 +0100, Neil Mitchell wrote:
Hi
C:\program files\common files\foo-1.0\mylibdata.txt
Eek. The purpose of Common Files is for things that are shared between multiple programs, not for things that might move. Having C:\Program Files\Haskell\Fixed would be a lot better than polluting a directory that really should have been killed ages ago.
How about just C:\Program Files\Haskell\$datasubdir
where should documentation go?
C:\program files\haskell\doc\html\foo\index.html C:\program files\haskell\doc\html\foo\foo.haddock
Anywhere you want, users will never find it without a shortcut on the start menu or some UI in their interpreter. Users should not be prodding around in Program Files, and in default Windows installs its hidden and you have to click a message "i really know what i'm doing" to see inside it.
Since you don't care, how about: $prefix\doc\$pkgid\ eg C:\Program Files\Haskell\doc\foo-1.0\ It will at least be relative to prefix unlike the datadir which is fixed for libs. As for UI, that's the job of a windows installer for a package imho and something like GUIHaskell can use ghc-pkg to find where the docs were installed (if at all). Sadly there's nothing similar for hugs. I've attached a patch with my suggestion. Someone who cares about Windows should test and apply it, or make a better patch. Actually, said Windows dev would also need to update the user guide to say what the default paths are and then close this bug: http://hackage.haskell.org/trac/hackage/ticket/116 Duncan
participants (3)
-
Duncan Coutts
-
Hackage
-
Neil Mitchell