Git Product home page Git Product logo

cabal-extras's Introduction

cabal-extras

A tool suite to aid Haskell development using cabal-install. There are four tools in this repository:

  • cabal-env: An experiment on what cabal install --lib could be.
  • cabal-diff: Compare API of different package versions
  • cabal-bundler: (ab)use cabal-install solver to build standalone installation bundles
  • cabal-deps: An experiment on what cabal outdated could be.
  • cabal-store-check: A naive tool to try to repair cabal's nix-store

All tools are highly experimental, although I (Oleg Grenrus) use them daily.

There's also cabal-fmt, a .cabal file formatter, but it's more standalone tool.

Installation

To install individual executables from this repository,

  1. Make sure you have GHC-8.2 and cabal-install-3.0 or later installed.
  2. Clone it with git clone https://github.com/phadej/cabal-extras.git
  3. Install individual executables with make install-cabal-env, make install-cabal-deps etc.

You can pass flags to cabal install by setting INSTALL_FLAGS, e.g.

make INSTALL_FLAGS="--installdir $HOME/bin --install-method copy" install-cabal-env

Executables

cabal-bundler

TBW

cabal-diff

TBW

cabal-deps

TBW

cabal-env

Synopsis

$ cabal-env optics
$ ghci
Prelude> import Optics
Prelude Optics>

TBW

cabal-store-check

This is a small script which can find some broken packages in cabal nix-store. It's a proof-of-concept of

Synopsis

# Check if store package db is inconsistent
$ cabal-store-check
...
[   0.64132] error: haskell-ci-0.3.20190327-98543f1828739a9ad62f8722220f5d812f7f4a13f6fe2745a286c227593452b9 interface file for HaskellCI is missing
...

# You can remove broken packages with, which would repair the state
$ cabal-store-check --repair

cabal-store-gc

This is another small script to reduce size of cabal's nix-store.

Synopsis

# Add possible current projects dependencies as in direct root,
# and print reclaiming information
$ cabal-store-gc
...
...
[  16.89166] info: 262 components are referenced from the roots
[  16.89714] info: 183 components are in the store
[  16.89726] info: 393 components can be removed from the store
[  17.71338] info: 2328 MB can be freed

# If you want to perform the cleanup
$ cabal-store-gc --collect

# For more information, see
$ cabal-store-gc --help

Roots

There are three kind of roots, which retain the packages in the store:

  • executables in installdir. These are automatic roots.
  • packages references from environments in ~/.ghc/.../environments/.... These are also automatic roots.
  • indirect roots, which are links from ~/.cabal/store/roots to plan.jsons elsewhere in the file system. Indirect links allow to retain development project dependencies. New indirect roots can be added with --add-project-root or --add-root actions.

cabal-extras's People

Contributors

blackgnezdo avatar hasufell avatar kozross avatar lubieowoce avatar neosimsim avatar ocharles avatar phadej avatar ryanglscott avatar

Watchers

 avatar

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    ๐Ÿ–– Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. ๐Ÿ“Š๐Ÿ“ˆ๐ŸŽ‰

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google โค๏ธ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.