Skip to content

Commit

Permalink
Merge pull request #1567 from OCamlPro/1.2.0-beta3
Browse files Browse the repository at this point in the history
Update doc, CHANGES and advertise as ~beta3
  • Loading branch information
AltGr committed Aug 5, 2014
2 parents a4a7dc1 + 41429d9 commit 87a0197
Show file tree
Hide file tree
Showing 15 changed files with 644 additions and 16 deletions.
3 changes: 2 additions & 1 deletion CHANGES
Original file line number Diff line number Diff line change
Expand Up @@ -22,7 +22,7 @@
* Enable packagers to specify mirrors in url files (#807)
* Cleaned up the command-line interface (#1250, #1170, #1472). Incompatible
changes:
- 'opam switch exec': takes command args directly rather than as a string (use
- 'opam config exec': takes command args directly rather than as a string (use
-- for command arguments)
- 'opam switch import|export': now have a mandatory FILE argument. '-f' no
longer accepted.
Expand Down Expand Up @@ -58,6 +58,7 @@
* Added an 'install' field in opam files, to separate from build
* Added the 'build', 'test' and 'doc' dependency flags to limit the scope
of some dependencies
* Added Check for common dependencies at init time
* Hundreds of smaller fixes and UI improvements

1.1.2
Expand Down
18 changes: 9 additions & 9 deletions configure
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
#! /bin/sh
# Guess values for system-dependent variables and create Makefiles.
# Generated by GNU Autoconf 2.69 for opam 1.2.0.
# Generated by GNU Autoconf 2.69 for opam 1.2.0~beta3.
#
#
# Copyright (C) 1992-1996, 1998-2012 Free Software Foundation, Inc.
Expand Down Expand Up @@ -578,8 +578,8 @@ MAKEFLAGS=
# Identity of this package.
PACKAGE_NAME='opam'
PACKAGE_TARNAME='opam'
PACKAGE_VERSION='1.2.0'
PACKAGE_STRING='opam 1.2.0'
PACKAGE_VERSION='1.2.0~beta3'
PACKAGE_STRING='opam 1.2.0~beta3'
PACKAGE_BUGREPORT=''
PACKAGE_URL=''

Expand Down Expand Up @@ -1219,7 +1219,7 @@ if test "$ac_init_help" = "long"; then
# Omit some internal or obsolete options to make the list less imposing.
# This message is too long to be a string in the A/UX 3.1 sh.
cat <<_ACEOF
\`configure' configures opam 1.2.0 to adapt to many kinds of systems.
\`configure' configures opam 1.2.0~beta3 to adapt to many kinds of systems.
Usage: $0 [OPTION]... [VAR=VALUE]...
Expand Down Expand Up @@ -1280,7 +1280,7 @@ fi

if test -n "$ac_init_help"; then
case $ac_init_help in
short | recursive ) echo "Configuration of opam 1.2.0:";;
short | recursive ) echo "Configuration of opam 1.2.0~beta3:";;
esac
cat <<\_ACEOF
Expand Down Expand Up @@ -1370,7 +1370,7 @@ fi
test -n "$ac_init_help" && exit $ac_status
if $ac_init_version; then
cat <<\_ACEOF
opam configure 1.2.0
opam configure 1.2.0~beta3
generated by GNU Autoconf 2.69
Copyright (C) 2012 Free Software Foundation, Inc.
Expand Down Expand Up @@ -1427,7 +1427,7 @@ cat >config.log <<_ACEOF
This file contains any messages produced by compilers while
running configure, to aid debugging if configure makes a mistake.
It was created by opam $as_me 1.2.0, which was
It was created by opam $as_me 1.2.0~beta3, which was
generated by GNU Autoconf 2.69. Invocation command line was
$ $0 $@
Expand Down Expand Up @@ -5043,7 +5043,7 @@ cat >>$CONFIG_STATUS <<\_ACEOF || ac_write_fail=1
# report actual input values of CONFIG_FILES etc. instead of their
# values after options handling.
ac_log="
This file was extended by opam $as_me 1.2.0, which was
This file was extended by opam $as_me 1.2.0~beta3, which was
generated by GNU Autoconf 2.69. Invocation command line was
CONFIG_FILES = $CONFIG_FILES
Expand Down Expand Up @@ -5096,7 +5096,7 @@ _ACEOF
cat >>$CONFIG_STATUS <<_ACEOF || ac_write_fail=1
ac_cs_config="`$as_echo "$ac_configure_args" | sed 's/^ //; s/[\\""\`\$]/\\\\&/g'`"
ac_cs_version="\\
opam config.status 1.2.0
opam config.status 1.2.0~beta3
configured by $0, generated by GNU Autoconf 2.69,
with options \\"\$ac_cs_config\\"
Expand Down
2 changes: 1 addition & 1 deletion configure.ac
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
AC_INIT(opam,1.2.0)
AC_INIT(opam,1.2.0~beta3)
AC_COPYRIGHT(Copyright 2012-2014 OcamlPro SAS)

AC_CONFIG_MACRO_DIR([m4])
Expand Down
Binary file removed doc/tutorials/Advanced_Install.pdf
Binary file not shown.
87 changes: 87 additions & 0 deletions doc/tutorials/Advanced_Usage.html
Original file line number Diff line number Diff line change
@@ -0,0 +1,87 @@
<h1 id="UsingOPAM">Using OPAM</h1>
<p>This document covers most of the common OPAM features. If you&#39;re looking for a
quick introduction, check the <a href='Basic_Usage.html'>Basic Usage</a> tutorial first.</p>
<p>If you are a developper and want to get a project packaged or change an existing
package, see the step-by-step <a href='Packaging.html'>packaging guide</a></p>
<p>The full documentation is available inline, using</p>
<pre><code>opam --help
opam &lt;command&gt; --help</code></pre>
<p>This document is intended as a quicker overview, use the above to dig into the
details.</p>
<h3 id="opaminit">opam init</h3>
<p>OPAM needs to initialise its internal state in a <code>~/.opam</code> directory to work.
This command can also take care of installing a version of OCaml if needed.</p>
<p>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.</p>
<h3 id="opamupdate">opam update</h3>
<p>This command synchronises OPAM&#39;s database with the package repositories. The
lists of available packages and their details are stored into
<code>~/.opam/repo/&lt;name&gt;</code>. Remember to run this regularly if you want to keep
up-to-date, or if you are having trouble with a package.</p>
<h3 id="Lookinguppackages">Looking up packages</h3>
<p>There are three useful commands for that:</p>
<ul>
<li><code>opam list</code> List installed packages, or packages matching a pattern</li>
<li><code>opam search</code> Search in package descriptions</li>
<li><code>opam show</code> Print details on a given package.</li>
</ul>

<h3 id="opaminstall">opam install</h3>
<p>This command installs packages along with all their dependencies. You can
specify one or several packages, along with version constraints. E.g:</p>
<pre><code>opam install lwt
opam install ocp-indent ocp-index.1.0.2
opam install &quot;ocamlfind&gt;=1.4.0&quot;</code></pre>
<h3 id="opamupgrade">opam upgrade</h3>
<p>Will attempt to upgrade the installed packages to their newest versions. You
should run it after <code>opam update</code>, and may use <code>opam pin</code> to prevent specific
packages from being upgraded.</p>
<h3 id="opamswitch">opam switch</h3>
<p>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.</p>
<p>Use <code>opam switch &lt;version&gt;</code> to <em>switch</em> to a different OCaml version, or <code>opam
switch &lt;name&gt; --alias-of &lt;version&gt;</code> to name the new <em>switch</em> as you like. Don&#39;t
forget to run the advertised <code>eval $(opam config env)</code> to update your PATH
accordingly.</p>
<p>Creating a new switch requires re-compiling OCaml, unless you make it an alias
of the &quot;system&quot; switch, relying on the global OCaml installation.</p>
<p>There are a bunch of specific or experimental OCaml compiler definitions on the
official repository, list them all with <code>opan switch list --all</code>.</p>
<h3 id="opampin">opam pin</h3>
<p>This command allows to pin a package to a specific version, but in fact, as you
know if you&#39;ve read the <a href='Packaging.html'>Packaging guide</a>, it can do much more.</p>
<p>The syntax is</p>
<pre><code>opam pin add &lt;package name&gt; &lt;target&gt;</code></pre>
<p>Where <code>&lt;target&gt;</code> 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 <code>opam update</code> and when explicitely mentionned in a command, so that
you can simply run <code>opam upgrade &lt;package name&gt;</code> to re-compile it from its
upstream. If the upstream includes OPAM metadata, that will be used as well.</p>
<pre><code>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</code></pre>
<p>This can be used in conjunction with <code>opam source</code> to start and hack an existing
package before you know it:</p>
<pre><code>opam source &lt;package&gt; --dev-repo --pin
cd &lt;package&gt;; hack hack hack;
opam upgrade &lt;package&gt;</code></pre>
<h3 id="opamrepo">opam repo</h3>
<p>OPAM is configured by default to use the community&#39;s software repository at
<a href='https://opam.ocaml.org'>opam.ocaml.org</a>, but this can easily be
changed at <code>opam init</code> time or later.</p>
<p><code>opam repo add &lt;name&gt; &lt;address&gt;</code> will make OPAM use the definitions of any
package versions defined at <code>&lt;address&gt;</code>, falling back to the previously defined
repositories for those which aren&#39;t defined. The <code>&lt;address&gt;</code> may point to an
http, local or version-controlled repository.</p>
<p>Defining your own repository, either locally or online, is quite easy: you can
start off by cloning <a href='https://github.com/ocaml/opam-repository'>the official
repository</a> if you intend it as a
replacement, or just create a new directory with <code>packages</code> and <code>compilers</code>
sub-directories. See the <a href='Packaging.html'>packaging guide</a> if you need help on
the package format.</p>
<p>If your repository is going to be served over HTTP, you should generate an index
using the <code>opam-admin</code> tool.</p>
Binary file removed doc/tutorials/Advanced_Usage.pdf
Binary file not shown.
32 changes: 32 additions & 0 deletions doc/tutorials/Basic_Usage.html
Original file line number Diff line number Diff line change
@@ -0,0 +1,32 @@
<h1 id="LearntouseOPAMin2minutes">Learn to use OPAM in 2 minutes</h1>
<p>This short tutorial covers the very basic use cases to get you started with
OPAM. A more lengthy introduction can be found in the
<a href='Advanced_Usage.html'>Advanced Usage</a> guide.</p>
<h2 id="InitialisingOPAM">Initialising OPAM</h2>
<pre><code>opam init</code></pre>
<p>This will create the <code>~/.opam</code> directory, within which packages will be
installed and where OPAM will store its data.</p>
<h2 id="Browsingavailablepackages">Browsing available packages</h2>
<p>The following commands will enable you to obtain information on available
packages:</p>
<pre><code>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</code></pre>
<p>You may prefer to <a href='https://opam.ocaml.org/packages'>browse them online</a>. If you
find a package there but not on your computer, either it has been recently added
and you should simply run <code>opam update</code>, or it&#39;s not available on your system or
OCaml version -- <code>opam install PACKAGE</code> should give you the reason.</p>
<h2 id="Installingapackage">Installing a package</h2>
<p>The two commands you will probably use the most with OPAM are:</p>
<pre><code>opam update # Update the packages database
opam install PACKAGE # Download, build and install the latest version of PACKAGE</code></pre>
<h2 id="Upgradingyourinstalledpackages">Upgrading your installed packages</h2>
<p>You may want to regularly issue these commands to keep your packages up-to-date:</p>
<pre><code>opam update # Update the packages database
opam upgrade # Re-install packages that were updated since last upgrade</code></pre>
<h2 id="DomorewithOPAM">Do more with OPAM</h2>
<p>If you need more details and options, OPAM is self-documented through</p>
<pre><code>opam --help</code></pre>
<p>To learn how to use more advanced features of OPAM (package pinning, multiple
repositories, multiple compilers...), move on to the <a href='Advanced_Usage.html'>Advanced
Usage</a> guide, or the <a href='Packaging.html'>Packaging tutorial</a>.</p>
Binary file removed doc/tutorials/Basic_Usage.pdf
Binary file not shown.
Binary file removed doc/tutorials/Developing.pdf
Binary file not shown.
121 changes: 121 additions & 0 deletions doc/tutorials/FAQ.html
Original file line number Diff line number Diff line change
@@ -0,0 +1,121 @@
<h1 id="OPAMFAQ">OPAM FAQ</h1>
<h4 id="HowtogetinstallandupgradeOPAM">→ How to get, install and upgrade OPAM ?</h4>
<p>See the <a href='Quick_Install.html'>Quick install guide</a>.</p>
<h4 id="Whereisthemanual">→ Where is the manual ?</h4>
<p>OPAM has git-like, hierarchical manpages. Try <code>opam --help</code> for a starting point.</p>
<p>Get started with OPAM packages by reading the <a href='Packaging.html'>Packaging Howto</a>.</p>
<p>See the details on the file formats and more in the <a href='https://github.com/ocaml/opam/blob/master/doc/dev-manual/dev-manual.pdf?raw=true'>Developper
Guide</a>
(pdf).</p>
<h4 id="WhatchangesdoesOPAMdotomyfilesystem">→ What changes does OPAM do to my filesystem ?</h4>
<p>OPAM is designed to be run strictly as user (non-root), and apart for the
explicit options provided during <code>opam init</code>, only writes within <code>~/.opam</code> (and
<code>/tmp</code>). This directory -- the default &quot;OPAM root&quot; -- contains configuration,
various internal data, a cache of downloaded archives, and your OCaml
installations.</p>
<h4 id="Whydoesopaminitneedtoaddstufftomyinitscriptswhyisevalopamconfigenvneeded">→ Why does <code>opam init</code> need to add stuff to my init scripts / why is <code>eval $(opam config env)</code> needed ?</h4>
<p>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.</p>
<p>Of course, you may choose not to let OPAM change anything at <code>opam init</code>, and
run <code>eval $(opam config env)</code> yourself whenever you will be needing it.</p>
<h4 id="Whatisaquotswitchquot">→ What is a &quot;switch&quot; ?</h4>
<p>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 <a href='Advanced_Usage.html#opamswitch'>related
section</a> in the Advanced usage manual and
<code>opam switch --help</code>. The &quot;prefix&quot; for a given installation is simply
<code>~/.opam/&lt;switch-name&gt;</code>.</p>
<p>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.</p>
<h4 id="CanIworkondifferentswitchesatthesametimeindifferentshells">→ Can I work on different switches at the same time in different shells ?</h4>
<p>Yes. Use one of:</p>
<pre><code>eval $(opam config env --switch &lt;switch&gt;) # for the current shell
opam config exec --switch &lt;switch&gt; &lt;command&gt; # for one command</code></pre>
<p>This only affects the environment.</p>
<h4 id="CanIgetanewswitchwiththesamepackagesinstalled">→ Can I get a new switch with the same packages installed ?</h4>
<p>Yes. Use:</p>
<pre><code>opam switch export file.export # from the previous switch
opam switch &lt;new switch&gt;
opam switch import file.export</code></pre>
<p>OPAM might fail if you had packages installed that are not compatible with the
OCaml version in your new switch. In that case, you&#39;ll need to remove them from
the <code>file.export</code> file by hand (the format is straight-forward, one line per
package).</p>
<h4 id="IinstalledapackagebyhandusedocamlfindremovefiddledwiththeinstalledpackagesandOPAMisoutofsyncHelp">→ I installed a package by hand / used <code>ocamlfind remove</code> / fiddled with the installed packages and OPAM is out of sync. Help !</h4>
<p>Don&#39;t panic. OPAM assumes it&#39;s controlling what&#39;s below <code>~/.opam/&lt;switch&gt;</code>, but
there are several ways you can recover:</p>
<ul>
<li><code>opam remove --force</code> will attempt to uninstall even if not registered as
installed. Then <code>opam install</code></li>
<li><code>opam reinstall</code> will try to remove an installed package, but go on to
re-installing even if that fails.</li>
<li>If all else fails, you can re-install your current set of packages from
scratch using <code>opam switch reinstall</code></li>
<li>You can force OPAM to register an installation or removal <em>without actually
performing anything</em> using <code>opam install|remove --fake</code>. This is not
recommended though, as your manual install may not be exactly equivalent to
the one expected by other OPAM packages, and OPAM may later on trigger
reinstallations or upgrades of the package. Don&#39;t complain if you mess up your
installation using this! If you want to control how a package is installed or
modify it, the right way is <code>opam pin</code>.</li>
</ul>

<h4 id="Whataretheminimumrequirements">→ What are the minimum requirements ?</h4>
<p>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.</p>
<h4 id="Somepackagefailduringcompilationcomplainingaboutmissingdependenciesquotm4quotquotlibgtkquotetc">→ Some package fail during compilation, complaining about missing dependencies (&quot;m4&quot;, &quot;libgtk&quot;, etc.)</h4>
<p>They probably depend on system, non-OCaml libraries: you&#39;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:</p>
<ul>
<li>Check for hints printed by the failing package</li>
<li>Check the output of <code>opam list &lt;package&gt; --external</code></li>
<li>Lookup the development packages corresponding to the error in your system&#39;s
package repositories. If you got to this point and found the appropriate
packages, we&#39;d be glad if you could tell us your system details and the answer
in <a href='https://github.com/ocaml/opam-repository/issues'>the opam-repository
tracker</a>, to save the others
the trouble of searching. Thanks.</li>
</ul>

<h4 id="Ihaveweirdchecksumerrorswheredotheycomefrom">→ I have weird checksum errors: where do they come from ?</h4>
<p>First of all, you should make sure your repositories are up-to-date:</p>
<pre><code>opam update</code></pre>
<p>If this isn&#39;t enough, or if you get the checksum errors while running <code>opam
init</code>, this could be caused by a badly configured proxy cache that is serving
stale files. To clear your proxy cache, you can use <code>wget --no-cache
&lt;remote-file&gt;</code> and retry.</p>
<p>As a last resort, you can bypass the checksum checks using <code>--no-checksums</code>.</p>
<h4 id="OPAMispromptingmetoinstallorupgradepackagesthatIamnotinterestedinordoesn39tinstallthelatestversionbydefaultWhyWhatcanIdo">→ OPAM is prompting me to install or upgrade packages that I am not interested in, or doesn&#39;t install the latest version by default. Why ? What can I do ?</h4>
<ul>
<li>You can be more explicit in your request (<code>opam upgrade PACKAGES</code>, <code>opam
install &#39;PACKAGE&gt;=VERSION&#39; PACKAGE...</code>, etc.)</li>
<li>Action resolution in a package set is known to be a NP-complete problem; OPAM
uses state-of-the-art algorithms through an external, dedicated solver: make
sure you have the latest version of <a href='http://potassco.sourceforge.net/'>aspcud</a>
installed.</li>
<li>Another benefit of the external solvers is that they allow to be <a href='Specifying_Solver_Preferences.html'>quite
expressive</a> on your expectations.</li>
</ul>

<h4 id="WheredoIreportBugsIssuesandFeatureRequests">→ Where do I report Bugs, Issues and Feature Requests?</h4>
<ul>
<li><p>Bug reports and feature requests for the OPAM tool should be reported on
<a href='https://github.com/ocaml/opam/issues'>OPAM&#39;s issue-tracker</a>.</p>
</li>
<li><p>Packaging issues or requests for a new package can be reported on the
<a href='https://github.com/ocaml/opam-repository/issues'>official repository&#39;s
issue-tracker</a>.</p>
</li>
<li><p>General queries for both the tool and the packages can be addressed on the
<a href='http://lists.ocaml.org/listinfo/platform'>OCaml-platform mailing-list</a> and
insights and evolution of OPAM internals can discussed on the <a href='http://lists.ocaml.org/listinfo/opam-devel'>OPAM-devel
mailing-list</a>.</p>
</li>
<li><p>You may also try IRC channel <code>#opam</code> on Freenode.</p>
</li>
</ul>

0 comments on commit 87a0197

Please sign in to comment.