Open phadej opened 5 years ago
btw, do we already have a ticket for the changes needed to the Paths_*
functionality in order to address the long-standing problems introduced by the per-component mode?
@hvr, I remember only relocatable store related stuff.
I found only #5543, which is somewhat related.
I'm using cabal new-build to prepare packages of Haskell applications for FreeBSD. That means that the directory where cabal installs to and the directory where executable ends up on user system differs.
This is a problem for pandoc, because it tries to find its data files in cabal installation dir:
Could not find data file /wrkdirs/usr/ports/textproc/hs-pandoc/work/cabal-home/.cabal/share/x86_64-freebsd-ghc-8.6.3/pandoc-2.7.1/data/templates/default.man
I tried passing --datadir=/usr/local/share/pandoc
to cabal new-build
command, but the error stays. Is --datadir
supposed to work with new-build machinery?
@arrowd see https://github.com/haskell/cabal/issues/4097#issuecomment-482055429 for a relevant related discussion
@arrowd see #4097 (comment) for a relevant related discussion
I don't see how it is relevant. I don't want relocatable executable, I just want functions from Paths_*
to have right prefix. Or at least getDataDirectory
return whatever value --datadir
have been supplied with.
@arrowd Perhaps you can run pandoc
via a script wrapper that sets the pandoc_datadir
env var to the correct location?
Thanks for the hint, but I don't need workarounds. In fact, I already found one - pandoc's embed_data_files
option. However, I believe that new-build should respected flags like --data-dir
, so no embedding or environment fiddling is required.
@arrowd Perhaps you can run
pandoc
via a script wrapper that sets thepandoc_datadir
env var to the correct location?
This workaround is also insufficient. For instance, when running haddock
you need to set both haddock_datadir
and haddock_api_datadir
to make it work. So, theoretically, you have to set env vars for every dependency too.