Skip to content
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

Nix-style builds need to install data files for inplace builds #4120

Closed
dagit opened this issue Nov 18, 2016 · 5 comments · Fixed by #4610
Closed

Nix-style builds need to install data files for inplace builds #4120

dagit opened this issue Nov 18, 2016 · 5 comments · Fixed by #4610

Comments

@dagit
Copy link
Collaborator

dagit commented Nov 18, 2016

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.

@ezyang
Copy link
Contributor

ezyang commented 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
Copy link
Contributor

ezyang commented Jan 28, 2017

Known workarounds:

  1. 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
  2. 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)

@fgaz
Copy link
Member

fgaz commented Jul 18, 2017

your in-tree data files need to have the same layout as when they are installed

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
Copy link
Member

23Skidoo commented Jul 18, 2017

What could change it?

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.

fgaz added a commit to fgaz/cabal that referenced this issue Jul 19, 2017
This enables the executale to find the datafiles in inplace builds.

Fixes haskell#4120
fgaz added a commit to fgaz/cabal that referenced this issue Jul 19, 2017
Datafiles should work when running an inplace exe
@23Skidoo
Copy link
Member

NB: This is not fixed in the general case (running the inplace-built exe from dist-newstyle/... manually), only for new-run.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

Successfully merging a pull request may close this issue.

4 participants