summaryrefslogtreecommitdiff
path: root/docs
diff options
context:
space:
mode:
authorEdsko de Vries <edsko@well-typed.com>2015-01-12 05:22:22 -0600
committerAustin Seipp <austin@well-typed.com>2015-01-13 10:10:38 -0600
commit099b76769f02432d8efcd7881348e5f5b6b50787 (patch)
treea87363a9b6cc429fede679b3a0e6fb9f4ebecca6 /docs
parent07ace5c221adbb1675413a0fac300a9f7913c234 (diff)
downloadhaskell-099b76769f02432d8efcd7881348e5f5b6b50787.tar.gz
Package environments
Summary: Package environments are files with package IDs that indicate which packages should be visible; see entry in user guide for details. Reviewers: duncan, austin Reviewed By: duncan, austin Subscribers: carter, thomie Differential Revision: https://phabricator.haskell.org/D558
Diffstat (limited to 'docs')
-rw-r--r--docs/users_guide/packages.xml86
1 files changed, 86 insertions, 0 deletions
diff --git a/docs/users_guide/packages.xml b/docs/users_guide/packages.xml
index 15ce719939..1c92defcdc 100644
--- a/docs/users_guide/packages.xml
+++ b/docs/users_guide/packages.xml
@@ -1812,6 +1812,92 @@ haddock-html: /usr/share/doc/ghc/html/libraries/unix
-->
</sect2>
+ <sect2 id="package-environments">
+ <indexterm><primary>package environments</primary></indexterm>
+ <title>
+ Package environments
+ </title>
+ <para>
+ A <emphasis>package environment</emphasis> is a file that tells
+ <literal>ghc</literal> precisely which packages should be visible. It
+ contains package IDs, one per line:
+ </para>
+<screen>
+package_id_1
+package_id_2
+...
+package_id_n
+</screen>
+ <para>
+ If a package environment is found, it is equivalent to passing these
+ command line arguments to <literal>ghc</literal>:
+ </para>
+<screen>
+-hide-all-packages
+-package-id package_id_1
+-package-id package_id_2
+...
+-package-id package_id_n
+</screen>
+ <para>
+ In order, <literal>ghc</literal> will look for the package environment
+ in the following locations:
+ </para>
+ <itemizedlist>
+ <listitem>
+ <para>
+ File
+ <replaceable>file</replaceable>
+ if you pass the option
+ <option>-package-env <replaceable>file</replaceable></option>.
+ </para>
+ </listitem>
+ <listitem>
+ <para>
+ File
+ <filename>$HOME/.ghc/<replaceable>arch</replaceable>-<replaceable>os</replaceable>-<replaceable>version</replaceable>/environments/<replaceable>name</replaceable></filename>
+ if you pass the option
+ <option>-package-env <replaceable>name</replaceable></option>.
+ </para>
+ </listitem>
+ <listitem>
+ <para>
+ File
+ <replaceable>file</replaceable>
+ if the environment variable <literal>GHC_ENVIRONMENT</literal>
+ is set to <replaceable>file</replaceable>.
+ </para>
+ </listitem>
+ <listitem>
+ <para>
+ File
+ <filename>$HOME/.ghc/<replaceable>arch</replaceable>-<replaceable>os</replaceable>-<replaceable>version</replaceable>/environments/<replaceable>name</replaceable></filename>
+ if the environment variable <literal>GHC_ENVIRONMENT</literal>
+ is set to <replaceable>name</replaceable>.
+ </para>
+ </listitem>
+ <listitem>
+ <para>
+ File <filename>./.ghc.environment</filename> if it exists.
+ </para>
+ </listitem>
+ <listitem>
+ <para>
+ File
+ <filename>$HOME/.ghc/<replaceable>arch</replaceable>-<replaceable>os</replaceable>-<replaceable>version</replaceable>/environments/default</filename>
+ if it exists.
+ </para>
+ </listitem>
+ </itemizedlist>
+ <para>
+ Package environments can be modified by further command line arguments;
+ for example, if you specify
+ <option>-package <replaceable>foo</replaceable></option>
+ on the command line, then package <replaceable>foo</replaceable> will be
+ visible even if it's not listed in the currently active package
+ environment.
+ </para>
+ </sect2>
</sect1>
<!-- Emacs stuff: