Skip to content

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

Closed

Description

@dagit

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.

Activity

  1. ezyang commented on Nov 18, 2016

    @ezyang
    Contributor

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

  2. added
    cabal-install: v2-build system
    on Nov 18, 2016
  3. ezyang commented on Jan 28, 2017

    @ezyang
    Contributor

    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)
  4. self-assigned this
    on Jul 15, 2017
  5. fgaz commented on Jul 18, 2017

    @fgaz
    Member

    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)?

  6. 23Skidoo commented on Jul 18, 2017

    @23Skidoo
    Member

    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.

  7. added 2 commits that reference this issue on Jul 19, 2017
    0c79706
    de31b2a
  8. 23Skidoo commented on Oct 14, 2017

    @23Skidoo
    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

Metadata

Metadata

Assignees

Labels

cabal-install: v2-build system

Type

No type

Projects

No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions