Skip to content

Installing an Idris Development version in a Cabal sandbox

Attila Lendvai edited this page Jul 27, 2021 · 1 revision

NOTE: Cabal's Sandbox feature is now obsolete (see: https://github.com/haskell/cabal/issues/6866)


This page documents how a development version of Idris can be installed using cabal-sandboxes.

These instructions have been tested on both Ubuntu 14.04 LTS and Debian Jessie, however, it is assumed that most of these instructions should apply equally well to other systems.

Optional Step Highlight Versions

While not strictly necessary, it can be convenient to have highlight-versions installed. highlight-versions can be used to easily see the dependencies that would be installed.

cabal install highlight-versions
export PATH=$PATH:.cabal-sandbox/bin

Idris Dependencies using System Package Manager.

The first step in our installation process is to install external and internal dependencies that can be satisfied by our system's package manager. Instructions for your favourite platform are available..

Clone and Initialise Sandbox

With the dependencies resolved we can then set up our installation environment. First we obtain the latest version:

git clone git://github.com/idris-lang/Idris-dev dev

Second we step into that directory, and turn it into a sandbox:

cd dev
cabal sandbox init
cabal update

Installing Idris

If you are interested in the dependencies that will be installed during installation , the following command will list them.

cabal install --dry-run --only-dependencies | highlight-versions 

If not the dependencies can be installed directly as follows:

cabal install --only-dependencies

Once you have installed those dependencies, you can just install Idris itself, in the simplest case with just make

make

Using Dev Version.

When using cabal sandboxes, binary files are installed within the sandbox in .cabal-sandbox/bin. As such the development idris environment will also be installed in ./.cabal-sandbox/. You can call the development version of Idris from the git repository's root as follows:

./.cabal-sandbox/bin/idris 

However, if you wish to make use of this development version in other projects on your system, then consider adding ./.cabal-sandbox/bin to your PATH.

Updating the Version.

There are a few simple steps you can follow to ensure that your development version is kept up-to-date when following bleeding edge Idris development.

  1. Never work on the master branch. Also work on dev branches that your create.
  2. Periodically ensure your copy of master is up to date. The git commands are:
git checkout master
git fetch upstream master
git merge upstream/master
  1. When rebuilding Idris in your sandbox, it is a good idea to make sure that libs/ has been purged of all ibc files. Sometimes during development files in libs/ can become renamed or the generated ibc files become stale. Although, the makefile does have a relic target it sometimes doesn't catch all the ibc files that are no longer tracked by Idris. Thus running the command (or windows equivalent) is good to purge libs of all generated ibc files.
find libs -name "*.ibc" -delete
Clone this wiki locally