Skip to content

Fix datadir path in generated Paths_ file #6055

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

Merged
merged 2 commits into from
May 24, 2019

Conversation

JoshMeredith
Copy link
Collaborator

The generated datadir path can be incorrect if a project is configured for a single component as per #5862

Since the install command uses the non-component variant of the paths for the datadir,

InstallDirs {
datadir = dataPref,
-- NB: The situation with Haddock is a bit delicate. On the
-- one hand, the easiest to understand Haddock documentation
-- path is pkgname-0.1, which means it's per-package (not
-- per-component). But this means that it's impossible to
-- install Haddock documentation for internal libraries. We'll
-- keep this constraint for now; this means you can't use
-- Cabal to Haddock internal libraries. This does not seem
-- like a big problem.
docdir = docPref,
htmldir = htmlPref,
haddockdir = interfacePref}
-- Notice use of 'absoluteInstallDirs' (not the
-- per-component variant). This means for non-library
-- packages we'll just pick a nondescriptive foo-0.1
= absoluteInstallDirs pkg_descr lbi copydest
this patch changes the generated path to use the same function.


Please include the following checklist in your PR:

  • Patches conform to the coding conventions.
  • Any changes that could be relevant to users have been recorded in the changelog.
  • The documentation has been updated, if necessary.
  • If the change is docs-only, [ci skip] is used to avoid triggering the build bots.

Please also shortly describe how you tested your change. Bonus points for added tests!

@phadej
Copy link
Collaborator

phadej commented May 22, 2019

Can we refactor so "consistency" is obvious via code sharing?

@JoshMeredith
Copy link
Collaborator Author

Can we refactor so "consistency" is obvious via code sharing?

Yes, I think it would be a good idea to make for example absoluteMixedInstallDirs, although I don't know which variant would be a better default for the fields of InstallDirs that are unused by the install command and the generated file.

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

Successfully merging this pull request may close these issues.

2 participants