Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Document extra-packages a bit better and clean up related entries (closes #5448) #8535

Merged
merged 3 commits into from
Oct 16, 2022
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
6 changes: 4 additions & 2 deletions doc/cabal-project.rst
Original file line number Diff line number Diff line change
Expand Up @@ -127,8 +127,10 @@ project are:
.. cfg-field:: extra-packages: package list with version bounds (comma separated)
:synopsis: Adds external packages as local

:strike:`Specifies a list of external packages from Hackage which
should be considered local packages.` (Not implemented)
Specifies a list of external packages from Hackage, which
should be considered local packages. The motivation for
:cfg-field:`extra-packages` is making libraries that are not
Copy link
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Is this one possible motivation or the motivation?

Copy link
Member Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Taken straight from the horse's mouth:
#3737 (comment)

I imagine there are other uses, but I don't know.

"A common use case" would be an alternative.

Copy link
Member Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Just found #6952 and the related #7865 and it seems you can install extra executables with extra-packages too, but there are caveats. Not sure if it should go into the documentation, while those are unresolved.

dependencies of any package in the project available for use in ghci.

There is no command line variant of this field.

Expand Down
13 changes: 6 additions & 7 deletions doc/nix-local-build.rst
Original file line number Diff line number Diff line change
Expand Up @@ -146,11 +146,10 @@ must be built per-project, versus external packages, which can be cached
across projects. To be more precise:

1. A **local package** is one that is listed explicitly in the
``packages``, ``optional-packages`` or ``extra-packages`` field of a
project. Usually, these refer to packages whose source code lives
directly in a folder in your project. But you can list an
arbitrary Hackage package in :cfg-field:`packages`
to force it to be treated as local.
``packages``, ``optional-packages`` or ``extra-packages`` fields of a
project. Packages in the former two fields will usually have their
source code stored in a folder in your project, while ``extra-packages`` lists
packages residing on Hackage that are treated as being local anyway.

Local packages, as well as the external packages (below) which depend on
them, are built **inplace**, meaning that they are always built
Expand All @@ -159,8 +158,8 @@ packages are not cached and not given unique hashes, which makes them
suitable for packages which you want to edit and recompile.

2. An **external package** is any package which is not listed in the
``packages`` field. The source code for external packages is usually
retrieved from Hackage.
``packages``, ``optional-packages`` and ``extra-packages`` fields.
The source code for external packages is usually retrieved from Hackage.

When an external package does not depend on an inplace package, it can
be built and installed to a **global** store, which can be shared across
Expand Down