Search code examples
haskellcabalcabal-install

Is everything reinstalled from scratch in cabal sandboxes?


Let's assume the following procedure:

cd /home/user/experiment

git clone https://github.com/ryantrinkle/reflex.git

cabal sandbox init

cabal install --dependencies-only

Question:

At this point what packages will the sandbox in /home/user/experiment contain ? Will it contain the whole dependency hierarchy tree of Reflex ?

In other words, if Reflex is the root package then will the whole dependency tree of Reflex be compiled from scratch independently of what is installed already in the global package repository of cabal ?

I suspect yes, but I am not sure.

When I execute the above command sequence then the following packages are installed :

[vagrant@localhost reflex]$ cabal install --only-dependencies
Resolving dependencies...
Notice: installing into a sandbox located at /home/vagrant/reflex
Downloading dependent-sum-0.2.1.0...
Configuring base-orphans-0.3.3...
Downloading primitive-0.5.4.0...
Configuring mtl-2.2.1...
Building base-orphans-0.3.3...
Building mtl-2.2.1...
Installed base-orphans-0.3.3
Configuring nats-1...
Building nats-1...
Installed nats-1
Configuring stm-2.4.4...
Configuring tagged-0.8.0.1...
Installed mtl-2.2.1
Building stm-2.4.4...
Building tagged-0.8.0.1...
Configuring text-1.2.1.1...
Installed stm-2.4.4
Downloading ref-tf-0.4...
Configuring transformers-compat-0.4.0.4...
Installed tagged-0.8.0.1
Building text-1.2.1.1...
Building transformers-compat-0.4.0.4...
Configuring dependent-sum-0.2.1.0...
Installed transformers-compat-0.4.0.4
Building dependent-sum-0.2.1.0...
Configuring primitive-0.5.4.0...
Installed dependent-sum-0.2.1.0
Downloading dependent-map-0.1.1.3...
Building primitive-0.5.4.0...
Installed primitive-0.5.4.0
Configuring ref-tf-0.4...
Building ref-tf-0.4...
Installed ref-tf-0.4
Configuring StateVar-1.1.0.0...
Building StateVar-1.1.0.0...
Configuring distributive-0.4.4...
Installed StateVar-1.1.0.0
Building distributive-0.4.4...
Configuring dependent-map-0.1.1.3...
Installed distributive-0.4.4
Building dependent-map-0.1.1.3...
Configuring vector-0.10.12.3...
Installed dependent-map-0.1.1.3
Building vector-0.10.12.3...
Installed text-1.2.1.1
Configuring hashable-1.2.3.2...
Building hashable-1.2.3.2...
Installed hashable-1.2.3.2
Configuring unordered-containers-0.2.5.1...
Building unordered-containers-0.2.5.1...
Installed unordered-containers-0.2.5.1
Configuring semigroups-0.16.2.2...
Building semigroups-0.16.2.2...
Installed semigroups-0.16.2.2
Configuring void-0.7...
Configuring bifunctors-5...
Installed vector-0.10.12.3
Building void-0.7...
Building bifunctors-5...
Installed void-0.7
Configuring contravariant-1.3.1.1...
Building contravariant-1.3.1.1...
Installed contravariant-1.3.1.1
Configuring comonad-4.2.6...
Installed bifunctors-5
Building comonad-4.2.6...
Installed comonad-4.2.6
Configuring profunctors-5.1.1...
Configuring semigroupoids-5.0.0.2...
Building profunctors-5.1.1...
Building semigroupoids-5.0.0.2...
Installed profunctors-5.1.1
Installed semigroupoids-5.0.0.2
Downloading these-0.4.1...
Configuring these-0.4.1...
Building these-0.4.1...
Installed these-0.4.1

This seems an awful lot.

Are these exactly the packages contained in the dependency tree of Reflex ?

I suspect yes, but I am not sure, hence this question.


Solution

  • Not quite. At the moment, anything in the global package database is also used by sandboxes. I believe future versions of cabal-install will restrict this to a few whitelisted core packages that ship with GHC (and that shouldn't/can't be replaced anyway).