Skip to content
GitLab
Projects
Groups
Snippets
Help
Loading...
Help
Help
Support
Community forum
Keyboard shortcuts
?
Submit feedback
Sign in / Register
Toggle navigation
GHC
Project overview
Project overview
Details
Activity
Releases
Repository
Repository
Files
Commits
Branches
Tags
Contributors
Graph
Compare
Locked Files
Issues
0
Issues
0
List
Boards
Labels
Service Desk
Milestones
Iterations
Merge Requests
0
Merge Requests
0
Requirements
Requirements
List
CI / CD
CI / CD
Pipelines
Jobs
Schedules
Security & Compliance
Security & Compliance
Dependency List
License Compliance
Operations
Operations
Incidents
Environments
Packages & Registries
Packages & Registries
Package Registry
Container Registry
Analytics
Analytics
CI / CD
Code Review
Insights
Issue
Repository
Value Stream
Wiki
Wiki
Snippets
Snippets
Members
Members
Collapse sidebar
Close sidebar
Activity
Graph
Create a new issue
Jobs
Commits
Issue Boards
Open sidebar
Alex D
GHC
Commits
34a54b00
Commit
34a54b00
authored
Sep 23, 2009
by
Simon Marlow
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
Document -package-id, and use the term "package ID" consistently
parent
b8766c9a
Changes
1
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
53 additions
and
34 deletions
+53
-34
docs/users_guide/packages.xml
docs/users_guide/packages.xml
+53
-34
No files found.
docs/users_guide/packages.xml
View file @
34a54b00
...
...
@@ -167,6 +167,22 @@ exposed-modules: Network.BSD,
</listitem>
</varlistentry>
<varlistentry>
<term>
<option>
-package-id
<replaceable>
P
</replaceable></option>
<indexterm><primary><option>
-package-id
</option></primary></indexterm>
</term>
<listitem>
<para>
Exposes a package like
<option>
-package
</option>
, but the
package is named by its ID rather than by name. This is a
more robust way to name packages, and can be used to
select packages that would otherwise be shadowed. Cabal
passes
<option>
-package-id
</option>
flags to GHC.
</para>
</listitem>
</varlistentry>
<varlistentry>
<term><option>
-hide-all-packages
</option>
<indexterm><primary><option>
-hide-package
</option></primary>
...
...
@@ -232,8 +248,9 @@ exposed-modules: Network.BSD,
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 identifier for the package,
that is it should include the version number. For example:
should be the full
package
<literal>
name-version
</literal>
for the package.
For example:
<literal>
-package mypkg-1.2
</literal>
.
</para>
</listitem>
</varlistentry>
...
...
@@ -389,13 +406,15 @@ $ export GHC_PACKAGE_PATH=$HOME/.my-ghc-packages.conf:</screen>
</sect3>
</sect2>
<sect2
id=
"
broken-package
s"
>
<title>
Dependencies
and broken packages
</title>
<sect2
id=
"
package-id
s"
>
<title>
Package IDs, dependencies,
and broken packages
</title>
<para>
Each installed package has a unique identifier, which
distinguishes it from all other installed packages on the
system. To see the identifiers associated with each installed
package, use
<literal>
ghc-pkg list -v
</literal>
:
</para>
<para>
Each installed package has a unique identifier (the
“
installed package ID
”
, or just
“
package
ID
”
for short) , which distinguishes it from all other
installed packages on the system. To see the package IDs
associated with each installed package, use
<literal>
ghc-pkg
list -v
</literal>
:
</para>
<screen>
$ ghc-pkg list -v
...
...
@@ -409,13 +428,13 @@ using cache: /usr/lib/ghc-6.12.1/package.conf.d/package.cache
</screen>
<para>
The string in parentheses after the package name is the
uniqu
e
identifier: it normally begins with the package name
and
version, and ends in a hash string derived from the compiled
package. Dependencies between packages are expressed in terms
of these unique identifiers, rather than just packages and
versions. For example, take a look at the dependencies of
the
<literal>
haskell98
</literal>
package:
The string in parentheses after the package name is the
packag
e
ID: it normally begins with the package name and version,
and
ends in a hash string derived from the compiled package.
Dependencies between packages are expressed in terms of package
IDs, rather than just packages and versions. For example, take
a look at the dependencies of the
<literal>
haskell98
</literal>
package:
</para>
<screen>
...
...
@@ -430,23 +449,23 @@ depends: array-0.2.0.1-9cbf76a576b6ee9c1f880cf171a0928d
</screen>
<para>
The purpose of the
unique package identifier is to detect
problems caused by re-installing a package without also
recompiling the packages that depend on it. Recompiling
dependencies is necessary, because the newly compiled package
may have a differnt ABI (Application Binary Interface) than the
previous version, even if both packages were built from the sam
e
s
ource code using the same compiler. With unique package
identifiers, a recompiled package will have a different unique
identifer from the previous version, so packages that depended
on the previous version are now orphaned - one of their
dependencies is not satisfied. Packages that are broken in this
way are shown in the
<literal>
ghc-pkg list
</literal>
output
either in red (if possible) or otherwise surrounded by
braces. In the following example, we have recompiled an
d
reinstalled the
<literal>
filepath
</literal>
package, and this
has caused various dependencies
including
<literal>
Cabal
</literal>
to
break:
</para>
The purpose of the
package ID is to detect problems caused by
re-installing a package without also recompiling the packages
that depend on it. Recompiling dependencies is necessary,
because the newly compiled package may have a differnt ABI
(Application Binary Interface) than the previous version, even
if both packages were built from the same source code using th
e
s
ame compiler. With package IDs, a recompiled
package will have a different package ID from the previous
version, so packages that depended on the previous version are
now orphaned - one of their dependencies is not satisfied.
Packages that are broken in this way are shown in
the
<literal>
ghc-pkg list
</literal>
output either in red (if
possible) or otherwise surrounded by braces. In the following
example, we have recompiled and reinstalle
d
the
<literal>
filepath
</literal>
package, and this has caused
various dependencies including
<literal>
Cabal
</literal>
to
break:
</para>
<screen>
$ ghc-pkg list
...
...
@@ -1137,8 +1156,8 @@ haddock-html: /usr/share/doc/ghc/html/libraries/unix
<indexterm><primary><literal>
id
</literal></primary><secondary>
package specification
</secondary></indexterm>
</term>
<listitem>
<para>
The package
's unique identifier. It is up to you to
choose a suitable
one.
</para>
<para>
The package
ID. It is up to you to choose a suitable
one.
</para>
</listitem>
</varlistentry>
...
...
Write
Preview
Markdown
is supported
0%
Try again
or
attach a new file
.
Attach a file
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Cancel
Please
register
or
sign in
to comment