use data-files without installation

Edward Z. Yang ezyang at mit.edu
Fri Mar 3 10:14:24 UTC 2017


One of the tracking bugs we have for this issue:
https://github.com/haskell/cabal/issues/4120
Note that the data file directory can be overridden
with environment variables, that might be good enough to
work around.

It would be really nice if inplace data files worked.
It is a little tricky to do, since the installed layout
may not match the inplace layout, but maybe it would be OK
if this were just opt in.

Edward

Excerpts from Henning Thielemann's message of 2017-03-03 11:02:30 +0100:
> 
> In a project I have currently some program text embedded as String in the 
> source code. I like to move that to an extra file, such that I can test 
> the program without running the Haskell code and such that non-Haskell 
> programmers can adapt the text. However, I hesitate to use the Data-Files 
> feature of Cabal since this would mean that I can test the Haskell code 
> only after installation of the whole Cabal package including the text 
> file.
> 
> Is there a way to use 'cabal repl' with the local version of the text 
> file? This would mean there must be a different variant 
> autogen/Paths_mod.hs, maybe the same file name but in a different 
> directory that is only passed to GHCi by 'cabal repl'. Manageable but 
> certainly surprising? Maybe only available by a new option like 'cabal 
> repl --local-dirs'.
> 
> More difficult: Can even 'cabal build' incl. dist/build/prog/prog and 
> 'cabal run' use local data files per request? Certainly not, since 
> dist/build/prog/prog shall just be installed by 'cabal install'.
> 
> Alternatively, is there a way to tell GHC to include a file in the 
> executable and provide access to its content? Would there be support in 
> Cabal for this feature?


More information about the cabal-devel mailing list