diff options
author | Edward Z. Yang <ezyang@cs.stanford.edu> | 2014-07-18 14:48:47 +0100 |
---|---|---|
committer | Edward Z. Yang <ezyang@cs.stanford.edu> | 2014-08-05 10:08:02 +0100 |
commit | 66218d15b7c27a4a38992003bd761f60bae84b1f (patch) | |
tree | 2537bf88de77a1a7f98204c498b0f623308d3cb6 /docs | |
parent | edff1efa74edcfa9db0010ae92e1e159ecb60b7e (diff) | |
download | haskell-66218d15b7c27a4a38992003bd761f60bae84b1f.tar.gz |
Package keys (for linking/type equality) separated from package IDs.
This patch set makes us no longer assume that a package key is a human
readable string, leaving Cabal free to "do whatever it wants" to allocate
keys; we'll look up the PackageId in the database to display to the user.
This also means we have a new level of qualifier decisions to make at the
package level, and rewriting some Safe Haskell error reporting code to DTRT.
Additionally, we adjust the build system to use a new ghc-cabal output
Make variable PACKAGE_KEY to determine library names and other things,
rather than concatenating PACKAGE/VERSION as before.
Adds a new `-this-package-key` flag to subsume the old, erroneously named
`-package-name` flag, and `-package-key` to select packages by package key.
RFC: The md5 hashes are pretty tough on the eye, as far as the file
system is concerned :(
ToDo: safePkg01 test had its output updated, but the fix is not really right:
the rest of the dependencies are truncated due to the fact the we're only
grepping a single line, but ghc-pkg is wrapping its output.
ToDo: In a later commit, update all submodules to stop using -package-name
and use -this-package-key. For now, we don't do it to avoid submodule
explosion.
Signed-off-by: Edward Z. Yang <ezyang@cs.stanford.edu>
Test Plan: validate
Reviewers: simonpj, simonmar, hvr, austin
Subscribers: simonmar, relrod, carter
Differential Revision: https://phabricator.haskell.org/D80
Diffstat (limited to 'docs')
-rw-r--r-- | docs/users_guide/flags.xml | 2 | ||||
-rw-r--r-- | docs/users_guide/packages.xml | 18 |
2 files changed, 8 insertions, 12 deletions
diff --git a/docs/users_guide/flags.xml b/docs/users_guide/flags.xml index 1dd224a611..8381ca1254 100644 --- a/docs/users_guide/flags.xml +++ b/docs/users_guide/flags.xml @@ -590,7 +590,7 @@ </thead> <tbody> <row> - <entry><option>-package-name</option> <replaceable>P</replaceable></entry> + <entry><option>-this-package-key</option> <replaceable>P</replaceable></entry> <entry>Compile to be part of package <replaceable>P</replaceable></entry> <entry>static</entry> <entry>-</entry> diff --git a/docs/users_guide/packages.xml b/docs/users_guide/packages.xml index 62b4e96bfd..50549b409c 100644 --- a/docs/users_guide/packages.xml +++ b/docs/users_guide/packages.xml @@ -258,19 +258,15 @@ exposed-modules: Network.BSD, </varlistentry> <varlistentry> - <term><option>-package-name</option> <replaceable>foo</replaceable> - <indexterm><primary><option>-package-name</option></primary> + <term><option>-this-package-key</option> <replaceable>foo</replaceable> + <indexterm><primary><option>-this-package-key</option></primary> </indexterm></term> <listitem> <para>Tells GHC the the module being compiled forms part of - package <replaceable>foo</replaceable>. + package key <replaceable>foo</replaceable>; internally, these + keys are used to determine type equality and linker symbols. If this flag is omitted (a very common case) then the default package <literal>main</literal> is assumed.</para> - <para>Note: the argument to <option>-package-name</option> - should be the full - package <literal>name-version</literal> for the package. - For example: - <literal>-package mypkg-1.2</literal>.</para> </listitem> </varlistentry> @@ -328,7 +324,7 @@ exposed-modules: Network.BSD, <para>Every complete Haskell program must define <literal>main</literal> in module <literal>Main</literal> - in package <literal>main</literal>. (Omitting the <option>-package-name</option> flag compiles + in package <literal>main</literal>. (Omitting the <option>-this-package-key</option> flag compiles code for package <literal>main</literal>.) Failure to do so leads to a somewhat obscure link-time error of the form: <programlisting> @@ -1170,8 +1166,8 @@ ghc-pkg dot | tred | dot -Tpdf >pkgs.pdf </itemizedlist> <para>To compile a module which is to be part of a new package, - use the <literal>-package-name</literal> option (<xref linkend="using-packages"/>). - Failure to use the <literal>-package-name</literal> option + use the <literal>-this-package-key</literal> option (<xref linkend="using-packages"/>). + Failure to use the <literal>-this-package-key</literal> option when compiling a package will probably result in disaster, but you will only discover later when you attempt to import modules from the package. At this point GHC will complain that the |