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{..} ...@@ -743,15 +743,16 @@ withTarballLocalDirectory verbosity distDirLayout@DistDirLayout{..}
tarball pkgid dparams buildstyle pkgTextOverride tarball pkgid dparams buildstyle pkgTextOverride
buildPkg = buildPkg =
case buildstyle of case buildstyle of
-- In this case we make a temp dir, unpack the tarball to there and -- In this case we make a couple temp dirs, unpack the tarball to one
-- build and install it from that temp dir. -- 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 -> BuildAndInstall ->
withTempDirectory verbosity distTempDirectory let tmpdir = distTempDirectory in
(display (packageName pkgid)) $ \tmpdir -> do withTempDirectory verbosity tmpdir "src" $ \unpackdir ->
unpackPackageTarball verbosity tarball tmpdir withTempDirectory verbosity tmpdir "build" $ \builddir -> do
unpackPackageTarball verbosity tarball unpackdir
pkgid pkgTextOverride pkgid pkgTextOverride
let srcdir = tmpdir </> display pkgid let srcdir = unpackdir </> display pkgid
builddir = srcdir </> "dist"
buildPkg srcdir builddir buildPkg srcdir builddir
-- In this case we make sure the tarball has been unpacked to the -- In this case we make sure the tarball has been unpacked to the
......
Markdown is supported
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