diff --git a/doc/tutorials/Advanced_Install.pdf b/doc/tutorials/Advanced_Install.pdf deleted file mode 100644 index 697462620f9..00000000000 Binary files a/doc/tutorials/Advanced_Install.pdf and /dev/null differ diff --git a/doc/tutorials/Advanced_Usage.html b/doc/tutorials/Advanced_Usage.html new file mode 100644 index 00000000000..b9753ec6f88 --- /dev/null +++ b/doc/tutorials/Advanced_Usage.html @@ -0,0 +1,87 @@ +

Using OPAM

+

This document covers most of the common OPAM features. If you're looking for a +quick introduction, check the Basic Usage tutorial first.

+

If you are a developper and want to get a project packaged or change an existing +package, see the step-by-step packaging guide

+

The full documentation is available inline, using

+
opam --help
+opam <command> --help
+

This document is intended as a quicker overview, use the above to dig into the +details.

+

opam init

+

OPAM needs to initialise its internal state in a ~/.opam directory to work. +This command can also take care of installing a version of OCaml if needed.

+

To operate as expected, some variables need to be set in your environment. You +will be prompted to update your configuration, and given instructions on how +to proceed manually if you decline.

+

opam update

+

This command synchronises OPAM's database with the package repositories. The +lists of available packages and their details are stored into +~/.opam/repo/<name>. Remember to run this regularly if you want to keep +up-to-date, or if you are having trouble with a package.

+

Looking up packages

+

There are three useful commands for that:

+ + +

opam install

+

This command installs packages along with all their dependencies. You can +specify one or several packages, along with version constraints. E.g:

+
opam install lwt
+opam install ocp-indent ocp-index.1.0.2
+opam install "ocamlfind>=1.4.0"
+

opam upgrade

+

Will attempt to upgrade the installed packages to their newest versions. You +should run it after opam update, and may use opam pin to prevent specific +packages from being upgraded.

+

opam switch

+

This command enables the user to have several installations on disk, each with +their own prefix, set of installed packages, and OCaml version. Use cases +include having to work or test with different OCaml versions, keeping separate +development environments for specific projects, etc.

+

Use opam switch <version> to switch to a different OCaml version, or opam +switch <name> --alias-of <version> to name the new switch as you like. Don't +forget to run the advertised eval $(opam config env) to update your PATH +accordingly.

+

Creating a new switch requires re-compiling OCaml, unless you make it an alias +of the "system" switch, relying on the global OCaml installation.

+

There are a bunch of specific or experimental OCaml compiler definitions on the +official repository, list them all with opan switch list --all.

+

opam pin

+

This command allows to pin a package to a specific version, but in fact, as you +know if you've read the Packaging guide, it can do much more.

+

The syntax is

+
opam pin add <package name> <target>
+

Where <target> may be a version, but also a local path, an http address or +even a git, mercurial or darcs URL. The package will be kept up-to-date with its +origin on opam update and when explicitely mentionned in a command, so that +you can simply run opam upgrade <package name> to re-compile it from its +upstream. If the upstream includes OPAM metadata, that will be used as well.

+
opam pin add camlpdf 1.7                                      # version pin
+opam pin add camlpdf ~/src/camlpdf                            # path
+opam pin add opam-lib https://github.com/ocaml/opam.git#1.2   # specific branch or commit
+opam pin add opam-lib --dev-repo                              # upstream repository
+

This can be used in conjunction with opam source to start and hack an existing +package before you know it:

+
opam source <package> --dev-repo --pin
+cd <package>; hack hack hack;
+opam upgrade <package>
+

opam repo

+

OPAM is configured by default to use the community's software repository at +opam.ocaml.org, but this can easily be +changed at opam init time or later.

+

opam repo add <name> <address> will make OPAM use the definitions of any +package versions defined at <address>, falling back to the previously defined +repositories for those which aren't defined. The <address> may point to an +http, local or version-controlled repository.

+

Defining your own repository, either locally or online, is quite easy: you can +start off by cloning the official +repository if you intend it as a +replacement, or just create a new directory with packages and compilers +sub-directories. See the packaging guide if you need help on +the package format.

+

If your repository is going to be served over HTTP, you should generate an index +using the opam-admin tool.

diff --git a/doc/tutorials/Advanced_Usage.pdf b/doc/tutorials/Advanced_Usage.pdf deleted file mode 100644 index 39b85b0701d..00000000000 Binary files a/doc/tutorials/Advanced_Usage.pdf and /dev/null differ diff --git a/doc/tutorials/Basic_Usage.html b/doc/tutorials/Basic_Usage.html new file mode 100644 index 00000000000..360c3e89a21 --- /dev/null +++ b/doc/tutorials/Basic_Usage.html @@ -0,0 +1,32 @@ +

Learn to use OPAM in 2 minutes

+

This short tutorial covers the very basic use cases to get you started with +OPAM. A more lengthy introduction can be found in the +Advanced Usage guide.

+

Initialising OPAM

+
opam init
+

This will create the ~/.opam directory, within which packages will be +installed and where OPAM will store its data.

+

Browsing available packages

+

The following commands will enable you to obtain information on available +packages:

+
opam list -a            # List all available packages
+opam search QUERY       # List packages with QUERY in their name or description
+opam show PACKAGE       # Display information about PACKAGE
+

You may prefer to browse them online. If you +find a package there but not on your computer, either it has been recently added +and you should simply run opam update, or it's not available on your system or +OCaml version -- opam install PACKAGE should give you the reason.

+

Installing a package

+

The two commands you will probably use the most with OPAM are:

+
opam update             # Update the packages database
+opam install PACKAGE    # Download, build and install the latest version of PACKAGE
+

Upgrading your installed packages

+

You may want to regularly issue these commands to keep your packages up-to-date:

+
opam update             # Update the packages database
+opam upgrade            # Re-install packages that were updated since last upgrade
+

Do more with OPAM

+

If you need more details and options, OPAM is self-documented through

+
opam --help
+

To learn how to use more advanced features of OPAM (package pinning, multiple +repositories, multiple compilers...), move on to the Advanced +Usage guide, or the Packaging tutorial.

diff --git a/doc/tutorials/Basic_Usage.pdf b/doc/tutorials/Basic_Usage.pdf deleted file mode 100644 index 0eaed819ae5..00000000000 Binary files a/doc/tutorials/Basic_Usage.pdf and /dev/null differ diff --git a/doc/tutorials/Developing.pdf b/doc/tutorials/Developing.pdf deleted file mode 100644 index 17d7ba26060..00000000000 Binary files a/doc/tutorials/Developing.pdf and /dev/null differ diff --git a/doc/tutorials/FAQ.html b/doc/tutorials/FAQ.html new file mode 100644 index 00000000000..ddad4029175 --- /dev/null +++ b/doc/tutorials/FAQ.html @@ -0,0 +1,121 @@ +

OPAM FAQ

+

→ How to get, install and upgrade OPAM ?

+

See the Quick install guide.

+

→ Where is the manual ?

+

OPAM has git-like, hierarchical manpages. Try opam --help for a starting point.

+

Get started with OPAM packages by reading the Packaging Howto.

+

See the details on the file formats and more in the Developper +Guide +(pdf).

+

→ What changes does OPAM do to my filesystem ?

+

OPAM is designed to be run strictly as user (non-root), and apart for the +explicit options provided during opam init, only writes within ~/.opam (and +/tmp). This directory -- the default "OPAM root" -- contains configuration, +various internal data, a cache of downloaded archives, and your OCaml +installations.

+

→ Why does opam init need to add stuff to my init scripts / why is eval $(opam config env) needed ?

+

You need two things when you install OPAM packages: to have their libraries +accessible, and to access binary programs. To provide those, OPAM needs to setup +a few ocaml-related environment variables, and to prepend to your PATH variable.

+

Of course, you may choose not to let OPAM change anything at opam init, and +run eval $(opam config env) yourself whenever you will be needing it.

+

→ What is a "switch" ?

+

An ocaml installation and a set of installed packages within an OPAM +installation. This can be used to keep different OCaml versions side-by-side, or +different sets of packages. See the related +section in the Advanced usage manual and +opam switch --help. The "prefix" for a given installation is simply +~/.opam/<switch-name>.

+

A switch is either based on a system-wide OCaml installation, or on a local +installation. In the former case, OPAM will need to recompile all packages when +your system compiler changes. In the latter case, OCaml will be downloaded and +compiled on creation of the switch.

+

→ Can I work on different switches at the same time in different shells ?

+

Yes. Use one of:

+
eval $(opam config env --switch <switch>)     # for the current shell
+opam config exec --switch <switch> <command>  # for one command
+

This only affects the environment.

+

→ Can I get a new switch with the same packages installed ?

+

Yes. Use:

+
opam switch export file.export  # from the previous switch
+opam switch <new switch>
+opam switch import file.export
+

OPAM might fail if you had packages installed that are not compatible with the +OCaml version in your new switch. In that case, you'll need to remove them from +the file.export file by hand (the format is straight-forward, one line per +package).

+

→ I installed a package by hand / used ocamlfind remove / fiddled with the installed packages and OPAM is out of sync. Help !

+

Don't panic. OPAM assumes it's controlling what's below ~/.opam/<switch>, but +there are several ways you can recover:

+ + +

→ What are the minimum requirements ?

+

1GB of memory should be all you need. It was reported that you may run into +problems with 512MB of RAM and no swap. Of course, software packages themselves +may be more greedy.

+

→ Some package fail during compilation, complaining about missing dependencies ("m4", "libgtk", etc.)

+

They probably depend on system, non-OCaml libraries: you'll need to install them +using your system package manager (apt-get, yum, pacman, homebrew, etc.). If you +have no idea what the missing system package might be:

+ + +

→ I have weird checksum errors: where do they come from ?

+

First of all, you should make sure your repositories are up-to-date:

+
opam update
+

If this isn't enough, or if you get the checksum errors while running opam +init, this could be caused by a badly configured proxy cache that is serving +stale files. To clear your proxy cache, you can use wget --no-cache +<remote-file> and retry.

+

As a last resort, you can bypass the checksum checks using --no-checksums.

+

→ OPAM is prompting me to install or upgrade packages that I am not interested in, or doesn't install the latest version by default. Why ? What can I do ?

+ + +

→ Where do I report Bugs, Issues and Feature Requests?

+ diff --git a/doc/tutorials/Makefile b/doc/tutorials/Makefile index 9af5766db2e..10c4783920e 100644 --- a/doc/tutorials/Makefile +++ b/doc/tutorials/Makefile @@ -1,14 +1,14 @@ all: opam.wiki cd opam.wiki && git pull - $(MAKE) Advanced_Install.pdf Basic_Usage.pdf \ - Advanced_Usage.pdf Basic_Usage.pdf \ - Packaging.pdf Developing.pdf + $(MAKE) Quick_Install.html Basic_Usage.html FAQ.html \ + Advanced_Usage.html Packaging.html \ + Specifying_Solver_Preferences.html opam.wiki: git clone git://github.com/ocaml/opam.wiki.git -%.pdf: opam.wiki/%.md - pandoc $^ -o $@ +%.html: opam.wiki/%.md + omd $^ -o $@ clean: @[ -d opam.wiki ] && \ diff --git a/doc/tutorials/Packaging.html b/doc/tutorials/Packaging.html new file mode 100644 index 00000000000..bd5b1227477 --- /dev/null +++ b/doc/tutorials/Packaging.html @@ -0,0 +1,251 @@ +

Tl;dr

+

Create a local package from the current directory

+
$ opam pin add <name> .
+

Get a local copy of an existing package and install from there

+
$ opam source <package> --pin
+

Get it back to normal

+
$ opam pin remove <package>
+

Publish to the OPAM repository:

+ + +

Creating OPAM packages

+

An OPAM package is basically just a bunch of data on a software project:

+ + +

This document will go through a simple way to get it in the right format, whether +you are packaging your own project or someone else's. It's not a complete guide +to the opam file format.

+

Creating a local package

+

We'll be assuming that you have a working OPAM installation. If not, please +first read the quick install guide.

+

Get the source

+

Let's start from the root directory of your project source, typically obtained +from a version-controlled repository or from a tarball.

+
$ wget https://.../project.tar.gz && tar xvzf project.tar.gz
+# Or
+$ git clone git://.../project.git
+...
+$ cd project
+

Opam pin

+

OPAM 1.2 provides a feature that allows you to register packages locally, +without the need for them to exist in a repository. We call this pinning, +because it is an extension of the very common feature that allows to pin a +package to a specific version number in other package managers.

+

So let's create a package pinned to the current directory. We just need to +choose a name and issue the command:

+
$ opam pin add <project> . -n
+

(-n tells OPAM to not try and install just yet, we'll get to it later)

+

The "opam" file

+

At this stage, OPAM will be looking for metadata for the package <project>, on +its repository and in the source directory. Not finding any, it will open an +editor with a pre-filled template for your package's opam file. It's best to +keep the project's README file open at this stage, as it should contain the +information we're interested in, only in a less normalised format.

+
opam-version: "1.2"
+maintainer: "Name <email>"
+author: "Name <email>"
+name: "project"
+version: "0.1"
+homepage: ""
+bug-reports: ""
+license: ""
+build: [
+  ["./configure" "--prefix=%{prefix}%"]
+  [make]
+]
+install: [make "install"]
+remove: ["ocamlfind" "remove" "project"]
+depends: "ocamlfind"
+

The opam-version, maintainer and version fields are mandatory ; you should +remove the others rather than leave them empty.

+ + +

A few other fields are available, but that should be enough to get started. Like +install and remove, most fields may contain lists in square brackets rather +than a single element: maintainer, author, homepage, bug-reports, +license and depends.

+

One you save and quit, OPAM will syntax-check and let you edit again in case of +errors.

+

Installing

+

The best test is to let OPAM attempt to install your just created package. As +for any package, you do it by hand with:

+
$ opam install <project> --verbose
+

At this point, OPAM will get a snapshot of the project, resolve its dependencies +and propose a course of actions for the install. Let it go and see if your +project installs successfully ; it's a good idea to use --verbose as it will +make OPAM print the output of the externals commands, in particular the ones in +the build instructions.

+

You can now check that everything is installed as expected. Do also check that +opam remove <project> works properly.

+

If you need to change anything, simply do

+
opam pin edit <project>
+

to get back to editing the opam file. Manually editing the opam file in +your source tree also works.

+

So far, so good ! You may have missed dependencies in case they were already +installed on your system, but that will be checked automatically by the +continuous integration system when you attempt to publish your package to the +OPAM repository, so don't worry.

+

Getting a full OPAM package

+

There are still two things missing for a complete package.

+ + +

Publishing

+

Publishing is currently handled through Github, using the pull-request +mechanism. If you're not familiar with it, it is a fancy way to:

+ + +

Here is how to do it from scratch:

+
    +
  1. Go to https://github.com/ocaml/opam-repository and hit the Fork button on + the top right corner (you may be asked to login or register)

    +
  2. +
  3. Get the clone URL on the right, and, from the shell, run git clone <url> + to get your local copy

    +
  4. +
  5. Now we'll add the new package description (opam, descr and url files) + into opam-repository/packages/<project>/<project>.<version>/ and make that + a git commit:

    +
    $ cd opam-repository/packages
    +$ mkdir -p <project>/<project>.<version>
    +$ cp <project-src>/opam <project>/<project>.<version>
    +$ cp <path-to>/url <path-to>/descr <project>/<project>.<version>
    +$ git add <project>
    +$ git commit -m "Added new fancy <project>.<version>"
    +
  6. +
  7. Sending that back to github is just a matter of running git push

    +
  8. +
  9. Back to the web interface, refresh, hit the Pull request button, check your + changes and confirm;

    +
  10. +
  11. Wait for feedback !

    +
  12. +
+ +

Don't forget to opam pin remove <project> once your project is on the +repository, if you don't want to continue using your local version. Remember +that as long as the package is pinned, OPAM will use the metadata found in its +source if any, but otherwise only what is in the OPAM repository matters. Use +git pin list to list all currently pinned packages.

+

Some tricks

+ + +

More on opam files

+

The opam files can express much more than what was shown above. Without getting +into too much details, here are some of the most useful features:

+ + +

For more, see the +OPAM Developer's Manual

diff --git a/doc/tutorials/Packaging.pdf b/doc/tutorials/Packaging.pdf deleted file mode 100644 index d733ea8303a..00000000000 Binary files a/doc/tutorials/Packaging.pdf and /dev/null differ diff --git a/doc/tutorials/Quick_Install.html b/doc/tutorials/Quick_Install.html new file mode 100644 index 00000000000..d53b16476c1 --- /dev/null +++ b/doc/tutorials/Quick_Install.html @@ -0,0 +1,76 @@ +

Notice

OPAM 1.2.0 is just being released. It may take a few days before the binary +packages make it to your distribution, we'll keep updating as it goes. If you +don't want to wait:

+ +
+

Install OPAM in 2 minutes

+

This page describes how to install and configure OPAM. +For further help on how to use OPAM, either read +opam --help or move on to the Basic Usage guide.

+

Installing OPAM with your distribution

+

You can use the OPAM package of your distribution if +available. Here is a list of supported distributions:

+

Archlinux

+

The opam and opam-git packages are available in the AUR. Replace opam with opam-git in the following instruction to get the development version:

+
yaourt -S opam
+

Debian

+

Binary packages of OPAM 1.1.1 are available for the testing and unstable distributions. Wheezy users are left with the options of compiling from source, pinning the packages from the testing repository, requesting a backport from Debian, or using our binary installer below.

+
apt-get install opam
+

Exherbo

+

Simply install the dev-ocaml/opam package: cave resolve -x dev-ocaml/opam. +You might need to add the ::ocaml-unofficial repository first: cave resolve -x repository/ocaml-unofficial.

+

Mageia

+

The opam package for Mageia can be installed with the command:

+
urpmi opam
+

OSX

+

OPAM packages for homebrew and MacPorts are available:

+
brew install opam                   # using Homebrew on OSX Mavericks
+brew install opam --without-aspcud  # using Homebrew on OSX Mountain Lion (or lower)
+port install opam                   # using MacPort
+

See also howto setup Emacs.app for opam usage.

+

Ubuntu (Precise, Quantal, Raring and Saucy)

+
add-apt-repository ppa:avsm/ppa
+apt-get update
+apt-get install ocaml opam
+

There are also PPAs available that are pinned to specific revisions of OCaml and OPAM to help with automated testing.

+

If the command add-apt-repository is not available, you can install the package python-software-properties with apt-get install python-software-properties. Alternatively, you may manually edit the file /etc/apt/sources.list to add the PPA for your Ubuntu release.

+

Ubuntu Trusty LTS

+

OCaml 4.01.0 and OPAM 1.1.1 are included in Ubuntu Trusty's universe repository, so just install them as normal.

+
apt-get update
+apt-get install ocaml ocaml-native-compilers camlp4-extra opam
+

Binary installer

+

Pre-compiled versions for most common architectures and OSes are available on the Github "releases" page. We also provide a very simple installer script that will automatically download the right version for you, put it in your binary directory and initialize it.

+

Download opam_installer.sh and run it as follows:

+
sh <path to>/opam_installer.sh /usr/local/bin
+

You can also specify which version of OCaml you want to install:

+
sh ./opam_installer.sh /usr/local/bin 3.12.1 # Install the latest OPAM and OCaml 3.12.1
+sh ./opam_installer.sh /usr/local/bin system # Install the latest OPAM using the system compiler (if any)
+

From Sources

+

Getting the Sources

+

Sources of the latest stable version of OPAM are available on Github:

+ + +

You can also download the full archives, including OPAM dependencies:

+ + +

Follow the instructions in README.md to get OPAM built and installed from +there.

+

Using ocamlbrew

+

ocamlbrew is a script that can bootstrap an OCaml environment including OPAM, from source. This option does not require an existing OCaml installation, or a pre-compiled OPAM binary for your platform. To bootstrap a new OCaml environment including OPAM, make sure that you have the necessary pre-requisites installed to run ocamlbrew, and then run:

+
curl -kL https://raw.github.com/hcarty/ocamlbrew/master/ocamlbrew-install | env OCAMLBREW_FLAGS="-r" bash
diff --git a/doc/tutorials/Specifying_Solver_Preferences.html b/doc/tutorials/Specifying_Solver_Preferences.html new file mode 100644 index 00000000000..39a5aa32b2e --- /dev/null +++ b/doc/tutorials/Specifying_Solver_Preferences.html @@ -0,0 +1,60 @@ +

Specifying user Preferences for the External Solvers

+

A fundamental distinguishing feature of the opam package manager is the fact that it is designed to reuse state-of-the-art dependency solving technology that gives the users the possibility to express their preferences regarding the operations to be performed during an installation, instead of being bound to an hard-coded strategy. +This section provides basic documentation on this feature, and its usage.

+

What are user preferences for installations, and why are them important?

When you request the installation of some packages, say p1...pn, opam has a lot to do: it needs to look at all the packages already installed on your machine, find all packages available from the repositories, consider your request, and then come up with a set of actions to be performed to satisfy your request.

+

Unfortunately, there are a lot of assumptions hidden in your mind when you tell opam that you want p1...pn installed: should it choose the latest version of the p1...pn? That seems a sensible thing to do, but sometimes installing a recent version of a package p may lead to downgrading or removing another package q, which is something you might not want. What should opam do in this case? Remove q to get the latest p, or keep q and get the most recent p that is compatible with it? +Well, the answer is: it depends! It depends on what you really want, and different users may have different points of view.

+

User preferences, supported by CUDF-compatible solvers, are the means you can use to make the assumptions in your mind explicit and known to the solver used by opam, so that the actions performed on your machine correspond to your personalised needs.

+

How do I express my preferences?

+

Preferences are expressed using a simple language built by prefixing a little set of combinators with the - (minus) or + (plus) operators. The most useful combinators are the following ones:

+ + +

For example, the preference -removed tells the solver that among all possible ways of satisfying your request, it should choose one that minimises the number of packages removed.

+

These combinators can be combined in a comma separated sequence, that is treated in lexicographic order by the solver.

+

Default preferences for an upgrade

For example, the preference -removed,-notuptodate,-changed tells the solver that after ensuring that removals are minimised, it should look for a solution that minimises also the number of packages wich are not at their latest version, and then reduce the changes to a minimum.

+

This is the default preference setting used by opam when you perform an update or an upgrade, and in practice it tries to bring all your packages to the latest version available, as far as this does not implies removing too many packages. It can be set using the environment variable OPAMUPGRADECRITERIA

+

Default preferences for an install

When you request to install a (set of) package(s), in general you do not expect to see all your existing packages updated, and this is why in this case opam uses a different default value -removed,-changed,-notuptodate that tries to minimise changes to the system. It can be set using the environment variable OPAMCRITERIA

+

Specifying preferences for opam

+

Recent versions of opam allow to specify your criteria on the command line, using the --criteria option, that will apply only to the current command. +For example if you are a very conservative user, you might try issueing the following command:

+
opam install --criteria="-removed,-changed" ...
+

This can also be used for some tricks: if for example you want to repair your set of installed packages, you can use the opam upgrade command without specifying a preference for newer versions in the criteria:

+
opam upgrade --criteria="-changed"
+

You can also use the OPAMCRITERIA and OPAMUPGRADECRITERIA environment variables to specify your preferences (for example, adding your preferred settings to a shell profile). If both variables are set, upgrades are controlled by OPAMUPGRADECRITERIA, while OPAMCRITERIA applies to all other commands. +If only OPAMCRITERIA is set, it applies to all commands. If only OPAMUPGRADECRITERIA is set, it applies to upgrade commands only, while all other commands are controlled by the opam internal default preferences.

+

Yes, there are different versions of the user preference language

+

The opam package manager is an instance of the approach described in the article "A modular package manager architecture", which was one of the outcomes of the Mancoosi research project. This architecture relies on external dependency solvers for package managers, that communicate with the package manager front-end via the CUDF format. +We have now several CUDF-compatible solvers, developed by a variety of research teams during the MISC competitions run yearly from 2010 to 2012:

+ + +

Each of these competitions led to improving the preferences language, by allowing the user progressively more flexibility.

+

As of today, the preferences language described in the previous section, which corresponds to the one used in the 2010 competition, should be supported by all external solvers, but if you happen to use as external solver one of the entrants of the 2012 competition, like recent versions of aspcud, then you have access to a more sophisticated set of preferences, described in the 2012 MISC competition rules. +For example, you could use

+

-count(removed), -count(down),-sum(solution,installedsize),-notuptodate(solution),-count(changed)

+

to instruct a solver to minimise downgrades, and mininise the installed size, among other criteria.

+

The aspcud solver supports this extended language starting from its version 1.8.0, which unfortunately is not the version shipped by default with Ubuntu precise or Debian Wheezy.

+

News in aspcud 1.9.x

+

Starting from version 1.9.0, aspcud adds support for three extra selectors, that are particularly useful to perform local upgrades. Here they are:

+ + +

Using this extended set of package selector, it is now finally possible to specify user preferences that describe optimisations to be applied only to the packages explicitly mentioned in the request. For example, -notuptodate(request),-count(changed) would find a solution that tries to bring all packages mentioned in the request to their latest version, while leaving all the rest as untouched as possible.

+

And if we have added to each package a priority value, we could also play with preferences like +sum(upgraderequest,priority),-count(changed) to get the packages mentioned in the upgrade request to the version with the highest possible priority, while leaving all the rest as untouched as possible.

+

Preferences only work with the external solvers

+

For portability reasons, opam also embarks an ad-hoc solver module that is built by wrapping a set of heuristics around the code of the SAT-solver which is used in the Dose Library for detecting broken packages. This solver module has no support for user preferences, and is not able to manage correctly large package repositories: it is highly recommended that you install an external CUDF solver (aspcud is the one best supported today).

+

Using external solvers in the Cloud

+

Thanks to support from Irill, it is now possible to use an external solver for opam on any platform, over the network. See the CUDF solver farm for instructions. +The latest version of the solver is on the farm, so you can use the full preferences language with it.