Commit 8dc39db7 authored by Duncan Coutts's avatar Duncan Coutts
Browse files

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.
parent 34eecf48
......@@ -743,15 +743,16 @@ withTarballLocalDirectory verbosity distDirLayout@DistDirLayout{..}
tarball pkgid dparams buildstyle pkgTextOverride
buildPkg =
case buildstyle of
-- In this case we make a temp dir, unpack the tarball to there and
-- build and install it from that temp dir.
-- 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.
BuildAndInstall ->
withTempDirectory verbosity distTempDirectory
(display (packageName pkgid)) $ \tmpdir -> do
unpackPackageTarball verbosity tarball tmpdir
let tmpdir = distTempDirectory in
withTempDirectory verbosity tmpdir "src" $ \unpackdir ->
withTempDirectory verbosity tmpdir "build" $ \builddir -> do
unpackPackageTarball verbosity tarball unpackdir
pkgid pkgTextOverride
let srcdir = tmpdir </> display pkgid
builddir = srcdir </> "dist"
let srcdir = unpackdir </> display pkgid
buildPkg srcdir builddir
-- In this case we make sure the tarball has been unpacked to the
Supports Markdown
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment