This tool is used to modify the package manifest (futhark.pkg) and
download the required packages it describes. futhark-pkg is not a
build system; you will still need to compile your Futhark code with
the usual compilers. The only purpose of futhark-pkg is to
download code (and perform other package management utility tasks).
This manpage is not a general introduction to package management in
Futhark; see the User’s Guide for that.

The futhark-pkg subcommands will modify only two locations in the
file system (relative to the current working directory): the
futhark.pkg file, and the contents of lib/. When modifying
lib/, futhark-pkg constructs the new version in lib~new/
and backs up the old version in lib~old. If futhark-pkg
should fail for any reason, you can recover the old state by moving
lib~old back. These temporary directories are erased if
futhark-pkg finishes without errors.

The futhark-pkgsync and futhark-pkginit subcommands are
the only ones that actually modifies lib/; the others modify only
futhark.pkg and require you to manually run futhark-pkgsync
afterwards.

Most commands take a -v/--verbose option that makes
futhark-pkg write running diagnostics to stderr.

Add the specified package of the given minimum version as a
requirement to futhark.pkg. If no version is provided, the newest
one is used. If the package is already required in futhark.pkg,
the new version requirement will replace the old one.

Note that adding a package does not automatically download it. Run
futhark-pkgsync to do that.

Verify that the futhark.pkg is valid, that all required packages
are available in the indicated versions. This command does not check
that these versions contain well-formed code. If a package path is
defined in futhark.pkg, also checks that .fut files are
located at the expected location in the file system.

Populate the lib/ directory with the packages listed in
futhark.pkg. Warning: this will delete everything in lib/
that does not relate to a file listed in futhark.pkg, as well as
any local modifications.

It is possible to use futhark-pkg with packages that have not yet
made proper releases. This is done via pseudoversions of the form
0.0.0-yyyymmddhhmmss+commitid. The timestamp is not verified
against the actual commit. The timestamp ensures that newer commits
take precedence if multiple packages depend on a commit version for
the same package. If futhark-pkgadd is given a package with no
releases, the most recent commit will be used. In this case, the
timestamp is merely set to the current time.

Commit versions are awkward and fragile, and should not be relied
upon. Issue proper releases (even experimental 0.x version) as soon
as feasible. Released versions also always take precedence over
commit versions, since any version number will be greater than 0.0.0.

Since the lib/ directory is populated with transitive dependencies
as well, it is possible for a package to depend unwittingly on one of
the dependencies of its dependencies, without the futhark.pkg file
reflecting this.

There is no caching of zipballs and version lists between invocations,
so the network traffic can be rather heavy.