https://github.com/hvr/cabal-env
Tool for managing GHC package environments
https://github.com/hvr/cabal-env
cabal ghc haskell
Last synced: 10 months ago
JSON representation
Tool for managing GHC package environments
- Host: GitHub
- URL: https://github.com/hvr/cabal-env
- Owner: hvr
- Created: 2018-05-12T20:26:40.000Z (over 7 years ago)
- Default Branch: master
- Last Pushed: 2019-10-06T23:01:50.000Z (over 6 years ago)
- Last Synced: 2025-03-23T20:51:14.818Z (10 months ago)
- Topics: cabal, ghc, haskell
- Language: Shell
- Homepage:
- Size: 6.84 KB
- Stars: 8
- Watchers: 2
- Forks: 0
- Open Issues: 2
-
Metadata Files:
- Readme: README.md
Awesome Lists containing this project
README
# cabal-env
`cabal-env` is a prototype UI for managing the new [package environments](https://downloads.haskell.org/~ghc/latest/docs/html/users_guide/packages.html#package-environments) facility implement in GHC for use by cabal's [nix-style local builds](https://cabal.readthedocs.io/en/latest/nix-local-build-overview.html) which allows to provide seamless access to the nix-style package store for direct invocations GHC and GHCi.
__NOTE__: A newer different prototype (different implementation, but same name `cabal-env`) can be found at https://github.com/phadej/cabal-env
## Usage
```
Usage: ./cabal-env.sh [-n ] (-r | -l | [DEP]+)"
Creates GHC package environment named '' (default = 'default')
containing the specified deps.
Flags:
-n set environment name to operate on;
use the special env-name '.' to create a
local '.ghc.environment' file in the current folder.
(default: 'default')
-r deletes the specified environment (via -n)
-l lists available environments for current 'ghc'
(cannot be combined with other flags)
-i create temporary environment and invoke GHCi with it
(cannot be combined with other flags)
-s run script (via 'runghc') in temporary environment
GHC Package environments are supported since GHC 8.0.2 and Cabal 2.2;
By default, the environment named 'default' is loaded by GHC and GHCi
if it exists.
You can select a specific package environment for GHC(i) via e.g.
'ghci -package-env myenv' or by setting an environment variable
'GHC_ENVIRONMENT=myenv ghci'
Examples:
./cabal-env.sh -n lens 'lens == 4.15.*' 'lens-aeson == 1.0.*' http-streams
./cabal-env.sh unordered-containers QuickCheck quickcheck-instances
./cabal-env.sh -s webcrawler.hs wreq
./cabal-env.sh -i lens-aeson
```