Skip to content

Commit 8dc39db

Browse files
committed
Reduce path lengths for temp package src and build dirs
This is for paths under $dist/tmp/ where we unpack package source tarballs and build them. This is for packages destined for the store. The names of these tmp dirs don't matter since they're guaranteed to be unique, so we only need short identifiers. So stop using full package names, and put the build artifacts in their own dir, rather than using a dist dir under the src dir.
1 parent 34eecf4 commit 8dc39db

File tree

1 file changed

+8
-7
lines changed

1 file changed

+8
-7
lines changed

cabal-install/Distribution/Client/ProjectBuilding.hs

Lines changed: 8 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -743,15 +743,16 @@ withTarballLocalDirectory verbosity distDirLayout@DistDirLayout{..}
743743
tarball pkgid dparams buildstyle pkgTextOverride
744744
buildPkg =
745745
case buildstyle of
746-
-- In this case we make a temp dir, unpack the tarball to there and
747-
-- build and install it from that temp dir.
746+
-- In this case we make a couple temp dirs, unpack the tarball to one
747+
-- and build and install it from the other. We avoid nesting the
748+
-- builddir under the tarball src dir to keep path name lengths down.
748749
BuildAndInstall ->
749-
withTempDirectory verbosity distTempDirectory
750-
(display (packageName pkgid)) $ \tmpdir -> do
751-
unpackPackageTarball verbosity tarball tmpdir
750+
let tmpdir = distTempDirectory in
751+
withTempDirectory verbosity tmpdir "src" $ \unpackdir ->
752+
withTempDirectory verbosity tmpdir "build" $ \builddir -> do
753+
unpackPackageTarball verbosity tarball unpackdir
752754
pkgid pkgTextOverride
753-
let srcdir = tmpdir </> display pkgid
754-
builddir = srcdir </> "dist"
755+
let srcdir = unpackdir </> display pkgid
755756
buildPkg srcdir builddir
756757

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

0 commit comments

Comments
 (0)