You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
{{ message }}
Repository navigation
Nix-style builds need to install data files for inplace builds #4120
Currently, new-build does not install data-files (possibly also extra-files). A sufficient condition for this bug is an "inplace" build. It may happen in other cases as well.
To be more specific, when we new-build an inplace package, we configure some bogus install paths for data files which get baked into Paths_pkg.hs. However, a new-build of an inplace package never actually installs into those directories, so if you actually try to run an inplace executable it won't find anything.
One way to fix this is to configure install paths into the dist-newstyle directory (at the cost of accumulating technical debt for when we eventually want relocatable build directories) and then installing the files into that location. Another possibility is to teach Paths to be able to pick up local data files prior to installation (so we don't have to go copy things), although this may be difficult if the install layout is different than the source layout. @dcoutts is likely to have Opinions(TM).
If the data-files don't change much, run an old style "cabal install" which will stick the install files where the bogus paths are looking
Set environment variables to where the data-files are (note that your in-tree data files need to have the same layout as when they are installed, which may not necessarily be the case)
I can't think of anything except maybe custom setup shenaningans (it should be ok to ignore those). You should remember to take data-dir into account, though.
Activity
ezyang commentedon Nov 18, 2016
To be more specific, when we new-build an inplace package, we configure some bogus install paths for data files which get baked into Paths_pkg.hs. However, a new-build of an inplace package never actually installs into those directories, so if you actually try to run an inplace executable it won't find anything.
One way to fix this is to configure install paths into the dist-newstyle directory (at the cost of accumulating technical debt for when we eventually want relocatable build directories) and then installing the files into that location. Another possibility is to teach Paths to be able to pick up local data files prior to installation (so we don't have to go copy things), although this may be difficult if the install layout is different than the source layout. @dcoutts is likely to have Opinions(TM).
ezyang commentedon Jan 28, 2017
Known workarounds:
fgaz commentedon Jul 18, 2017
Is it reasonable to assume this? What could change it?
Old-run also does this. Is it fine if i replicate this behaviour in new-run (i.e. not copying the data files anywhere and simply setting the env var)?
23Skidoo commentedon Jul 18, 2017
I can't think of anything except maybe custom setup shenaningans (it should be ok to ignore those). You should remember to take
data-dirinto account, though.Add datadir env var before running the exe
Add test for haskell#4120
23Skidoo commentedon Oct 14, 2017
NB: This is not fixed in the general case (running the inplace-built exe from
dist-newstyle/...manually), only fornew-run.