Skip to content

Fix install of packages bundling generated source in dist/ #4012

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
Oct 21, 2016
Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
15 changes: 10 additions & 5 deletions cabal-install/Distribution/Client/ProjectBuilding.hs
Original file line number Diff line number Diff line change
Expand Up @@ -744,16 +744,21 @@ withTarballLocalDirectory verbosity distDirLayout@DistDirLayout{..}
tarball pkgid dparams buildstyle pkgTextOverride
buildPkg =
case buildstyle of
-- In this case we make a couple temp dirs, unpack the tarball to one
-- and build and install it from the other. We avoid nesting the
-- builddir under the tarball src dir to keep path name lengths down.
-- In this case we make a temp dir (e.g. tmp/src2345/), unpack
-- the tarball to it (e.g. tmp/src2345/foo-1.0/), and for
-- compatibility we put the dist dir within it
-- (i.e. tmp/src2345/foo-1.0/dist/).
--
-- Unfortunately, a few custom Setup.hs scripts do not respect
-- the --builddir flag and always look for it at ./dist/ so
-- this way we avoid breaking those packages
BuildAndInstall ->
let tmpdir = distTempDirectory in
withTempDirectory verbosity tmpdir "src" $ \unpackdir ->
withTempDirectory verbosity tmpdir "build" $ \builddir -> do
withTempDirectory verbosity tmpdir "src" $ \unpackdir -> do
unpackPackageTarball verbosity tarball unpackdir
pkgid pkgTextOverride
let srcdir = unpackdir </> display pkgid
builddir = srcdir </> "dist"
buildPkg srcdir builddir

-- In this case we make sure the tarball has been unpacked to the
Expand Down