-
Notifications
You must be signed in to change notification settings - Fork 691
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
Questions about prefix-independence for data files #7888
Comments
This may be a problem not only with documentation. I've heard from @phadej the data files feature is not fully working or not for all OSes and there is no obvious way forward. I guess studying open issues about that might indicate why. Indeed, if would be great to at least document what is failing. |
Working on Windows, and looking at my generated
So it seems that the data dir is hardwired, but it can be overridden using an environment variable. I don't see anything related to finding the data dir by asking the OS for the path of the executable (as implied by the prefix-independence docs) but perhaps it would exist if I had used some non-default compilation option. |
In the Cabal source code, the file
But how to enable Apparently, there's a |
Uhoh, so the feature is not only undocumented and not quite working, but there are also bits and pieces of its carcass laying around and tripping contributors? That definitely requires an intervention. |
I did some chackes with: module Main where
import Paths_datadirs
main :: IO ()
main = do
dir <- getDataDir
putStrLn $ "Datadir: " ++ dir PS D:\dev\ws\haskell\issues\datadirs> cabal run
Datadir: D:\dev\ws\haskell\issues\datadirs\.\.
PS D:\dev\ws\haskell\issues\datadirs> cabal install
....
Copying 'datadirs.exe' to 'D:\bin\datadirs.exe'
PS D:\dev\ws\haskell\issues\datadirs> datadirs
Datadir: D:\cabal\store\ghc-8.10.7\datadirs-0.1.0.0-8741e1327c97f40d292496f63ccc5862cd3e0d46\share Of course you need |
I've been following the documentation for the Paths_pkgname and data-files mechanism and managed to get a simple example going.
However, I don't quite understand the documentation for prefix-independence:
Does that mean that prefix-independence is only for Windows? Perhaps it should be explicitly stated.
Here by "installing", do we mean something like copying the executable to another location, maybe across machines?
If the executable finds the other files relative to
$bindir
, why is$prefix
needed at all?Is this the default, or do I have to do tweak something in order to achieve it? Does "beginning with $prefix" mean "beginning with the literal text '$prefix'" or "beginning with the value of $prefix"?
System information
The text was updated successfully, but these errors were encountered: