Use a non-default build dir when building add-source deps.

Fixes #1281.
Merge pull request #1312 from 23Skidoo/sandbox-dist-builddir

Use a non-default build dir when building add-source deps.
80-col violations.
Use a subdir of 'dist' as build dir for building add-source deps.

Works better with 'cabal clean'.
80-col violations.
Make configAbsolutePaths work with sandboxes.

The package DB dir is created *after* we've changed the 'configPackageDBs'
setting with 'setPackageDB'.

Aside: we really need some functional tests for sandboxes.
80-col violations.
Typos.
80-col violation.
Use 'dist-sandbox-$SANDBOX_DIR_HASH' as the build dir for add-source deps.

This avoids the risk of conflicts if we use a single add-source dep with
multiple sandboxes.
Use pre-order traversal when simplifying CondTree's.

Fixes #676.
Merge branch 'master' of https://github.com/manzyuk/cabal
80-col violation.
Avoid the timestamp check for `add-source --snapshot` dependencies.

Snapshot deps now behave more like `cabal-dev add-source`. Implemented by adding
a BuildTreeRefType field to the BuildRef index entry.

Fixes #1321.
Merge pull request #1322 from 23Skidoo/snapshots-avoid-timestamp-check

Avoid the timestamp check for `add-source --snapshot` dependencies.
Add a debug message.
Fix another issue caused by 'user-install: True'.

I'm starting to think that it's better to set it to False and solve the rootCmd
problem in another way.
Add a generalised variant of 'topHandler'.
Don't die if some deps weren't reinstalled.
Use globalInstallDirs as the sandbox location.

Reverts 7b2e3630f2ada8a56bf9100144e1bb9acbe6dc6a. Instead of temporarily setting
'configUserInstall' to 'False' in various places, we now just check that we're
not in a sandbox when deciding whether we should use 'rootCmd'.