Skip to content
100644 104 lines (78 sloc) 3.75 KB
7e676f2 @Paczesiowa better looking title for file
1 Virtual Haskell Environment
2 ===========================
fe3808f @Paczesiowa add README file
4 What is it?
5 -----------
6 virthualenv is a tool (inspired by Python's virtualenv)
7 to create isolated Haskell environments.
10 What does it do?
11 ----------------
12 It creates a sandboxed environment in a .virthualenv/ sub-directory
13 of your project, which, when activated, allows you to use regular Haskell tools
14 (ghc, ghci, ghc-pkg, cabal) to manage your Haskell code and environment.
15 It's possible to create an environment, that uses different GHC version
16 than your currently installed. Very simple emacs integration mode is included.
18 Basic usage
19 -----------
20 First, choose a directory where you want to keep your
21 sandboxed Haskell environment, usually a good choice is a directory containing
22 your cabalized project (if you want to work on a few projects
23 (perhaps an app and its dependent library), just choose any of them,
24 it doesn't really matter). Enter that directory:
26 > cd ~/projects/foo
28 Next, create your new isolated Haskell environment
29 (this is a one time only (per environment) step):
31 > virthualenv
33 Now, every time you want to use this enviroment, you have to activate it:
35 > source .virthualenv/bin/activate
37 That's it! Now it's possible to use all regular Haskell tools like usual,
38 but it won't affect your global/system's Haskell environment, and also
39 your per-user environment (from ~/.cabal and ~/.ghc) will stay the same.
40 All cabal-installed packages will be private to this environment,
41 and also the external environments (global and user) will not affect it
42 (this environment will only inherit very basic packages,
43 mostly ghc and Cabal and their deps).
45 When you're done working with this environment, enter command 'deactivate',
46 or just close the current shell (with exit).
48 > deactivate
50 Advanced usage
51 --------------
52 The only advanced usage is using different GHC version.
53 This can be useful to test your code against different GHC version
54 (even against nightly builds).
56 First, download binary distribution of GHC for your platform
57 (e.g. ghc-7.0.4-i386-unknown-linux.tar.bz2),
58 then create a new environment using that GHC:
60 > virthualenv --ghc=/path/to/ghc_something.tar.bz2
62 Then, proceed (with [de]activation) as in the basic usage case.
64 Misc
65 ----
66 virthualenv has been tested on i386 Linux and FreeBSD systems,
67 but it should work on any Posix platform. External (from tarball) GHC feature
68 requires binary GHC distribution compiled for your platform,
69 that can be extracted with tar and installed with
70 "./configure --prefix=PATH; make install".
72 FAQ
73 ---
74 Q: Can I use it together with tools like cabal-dev or capri?
75 A: No. All these tools work more or less the same (wrapping cabal command,
76 setting GHC_PACKAGE_PATH env variable), so something will probably break.
78 Q: Using GHC from tarball fails, when using FreeBSD with a bunch of make tool
79 gibberish. What do I do?
80 A: Try '--make-cmd=gmake' switch.
82 Q: Can I use virthualenv inside virthualenv?
83 A: No. It may be supported in future versions.
85 Q: Does it work on x64 systems?
86 A: It hasn't been tested, but there's no reason why it shouldn't.
88 Q: Will it work on Mac?
89 A: I doubt it. It should be easy to make it work there with system's GHC,
90 Using GHC from tarball will be probably harder. I don't have any mac
91 machines, so you're on your own, but patches/ideas/questions are welcome.
93 Q: Will it work on Windows?
94 A: I really doubt it would even compile. I don't have access to any windows
95 machines, so you're on your own, but patches/ideas/questions are welcome.
96 Maybe it would work on cygwin.
98 Q: Does it require bash?
99 A: No, it should work with any POSIX-compliant shell. It's been tested with
100 bash, bash --posix, dash, zsh and ksh.
102 Q: Can I use it with a different haskell package repository than hackage?
103 A: Yes, just adjust the url in .virthualenv/cabal/config file.
Something went wrong with that request. Please try again.