ocaml / opam

opam is a source-based package manager. It supports multiple simultaneous compiler installations, flexible package constraints, and a Git-friendly development workflow.
https://opam.ocaml.org
Other
1.25k stars 360 forks source link

ocamlfind: Package X is already installed ... #773

Closed hhugo closed 11 years ago

hhugo commented 11 years ago

I often get the 2 following errors during updates.

ocamlfind: Package X is already installed
ocamlfind: Conflict with another package: Library dllX.so is already installed

I'm running opam from https://github.com/OCamlPro/opam/commit/544caf4819e3492879e0028174deeff8feda99b9 but I remember having this issue with previous version.

I don't know if this a bug or if it is due to an old broken version of opam.

It could be nice to have a --force mode. Also, errors during upgrade make you "loose" part of your universe. Could be nice to be able to recover from it.

As an exemple, here is a trace of my latest opam upgrade involving ocamlfind upgrade

opam upgrade
The following actions will be performed:
 - upgrade ocamlfind.1.3.3 to 1.4.0
 - recompile batteries.2.1.0 [use ocamlfind]
 - recompile calendar.2.03.2 [use ocamlfind]
 - recompile camlzip.1.05+003 [use ocamlfind]
 - recompile cmdliner.0.9.2 [use ocamlfind]
 - recompile cryptokit.1.7 [use ocamlfind]
 - recompile csv.1.3.1 [use ocamlfind]
 - recompile easy-format.1.0.1.1 [use ocamlfind]
 - recompile extlib.1.5.4 [use ocamlfind]
 - recompile imagemagick.0.34 [use ocamlfind]
 - recompile lablgtk.2.16.0 [use ocamlfind]
 - recompile menhir.20130116 [use ocamlfind]
 - recompile ocaml-text.0.6 [use ocamlfind]
 - recompile ocamlgraph.1.8.3 [use ocamlfind]
 - recompile ocamlify.0.0.1 [use ocamlfind]
 - recompile omake.0.9.8.6-0.rc1 [use ocamlfind]
 - recompile optcomp.1.4 [use ocamlfind]
 - recompile ounit.1.1.2 [use ocamlfind]
 - recompile pcre-ocaml.7.0.2 [use ocamlfind]
 - recompile re.1.2.1 [use ocamlfind]
 - recompile react.0.9.4 [use ocamlfind]
 - recompile safepass.1.2 [use ocamlfind]
 - recompile sqlite3-ocaml.2.0.4 [use ocamlfind]
 - recompile ssl.0.4.6 [use ocamlfind]
 - recompile type_conv.109.28.00 [use ocamlfind]
 - recompile typerex.1.99.6-beta [use ocamlfind]
 - recompile ulex.1.1 [use ocamlfind]
 - recompile xml-light.3.1a [use ocamlfind]
 - recompile xmlm.1.1.1 [use ocamlfind]
 - recompile biniou.1.0.8.1 [use ocamlfind]
 - recompile leveldb.0.3 [use ocamlfind]
 - recompile fileutils.0.4.4 [use ocamlfind]
 - recompile pgocaml.1.7.1 [use ocamlfind]
 - recompile uri.1.3.8 [use ocamlfind]
 - recompile ocamlnet.3.6.5 [use ocamlfind]
 - recompile deriving-ocsigen.0.5 [use ocamlfind]
 - recompile dyntype.0.9.0 [use ocamlfind]
 - recompile ocaml-data-notation.0.0.10 [use ocamlfind]
 - recompile ocp-build.1.99.6-beta [use ocamlfind]
 - recompile ccss.1.3 [use ocamlfind]
 - recompile yojson.1.1.7.1 [use ocamlfind]
 - recompile ocamlmod.0.0.4 [use ocamlfind]
 - recompile macaque.0.6.1 [use ocamlfind]
 - recompile tyxml.pinned
 - recompile cow.0.6.2 [use ocamlfind]
 - recompile cudf.0.6.2 [use ocamlfind]
 - recompile ocp-indent.1.3.2 [use ocamlfind]
 - recompile ocp-index.0.3.0 [use ocamlfind]
 - recompile merlin.1.3.1 [use ocamlfind]
 - recompile oasis.0.3.0 [use ocamlfind]
 - recompile dose.3.1.2 [use ocamlfind]
 - recompile ocaml-top.1.1.0 [use ocamlfind]
 - recompile aliases.0.0.4 [use ocamlfind]
 - recompile lwt.2.4.3+besport1 [use ocamlfind]
 - recompile oasis2opam.0.3.1 [use ocamlfind]
 - recompile ocsigenserver.2.2.0+besport5 [use ocamlfind]
 - recompile aws.0.0.2.2 [use ocamlfind]
0 to install | 56 to reinstall | 1 to upgrade | 0 to downgrade | 0 to remove
Do you want to continue ? [Y/n]

=-=-= Removing Packages =-=-=
Removing lablgtk.2.16.0.
  ocamlfind remove lablgtk2
Removing ocp-index.0.3.0.
  ocp-build -init
  ocp-build uninstall -install-lib /Users/hugo/.opam/4.00.1/lib/ocp-index ocp-index-lib ocp-index
  rm /Users/hugo/.opam/4.00.1/man/man1/ocp-index.1
Removing dyntype.0.9.0.
  ocamlfind remove dyntype
Removing extlib.1.5.4.
  ocamlfind remove extlib
Removing uri.1.3.8.
  ocamlfind remove uri
Removing lwt.2.4.3+besport1.
  ocamlfind remove lwt
Removing yojson.1.1.7.1.
  ocamlfind remove yojson
Removing react.0.9.4.
  ocamlfind remove react
Removing biniou.1.0.8.1.
  ocamlfind remove biniou
Removing ocp-indent.1.3.2.
  ./configure --prefix /Users/hugo/.opam/4.00.1
  make uninstall
Removing cmdliner.0.9.2.
  ocamlfind remove cmdliner
Removing ssl.0.4.6.
  ocamlfind remove ssl
Removing ocamlify.0.0.1.
Removing calendar.2.03.2.
  ocamlfind remove calendar
Removing leveldb.0.3.
  ocamlfind remove leveldb
Removing cudf.0.6.2.
Removing ccss.1.3.
  rm /Users/hugo/.opam/4.00.1/bin/ccss
Removing optcomp.1.4.
  ocamlfind remove optcomp
  rm /Users/hugo/.opam/4.00.1/bin/optcomp-o
  rm /Users/hugo/.opam/4.00.1/bin/optcomp-r
Removing ocaml-text.0.6.
  ocamlfind remove text
Removing ocamlfind.1.3.3.
Removing cryptokit.1.7.
  ocamlfind remove cryptokit
Removing aws.0.0.2.2.
  ocamlfind remove aws
Removing re.1.2.1.
  ocamlfind remove re
Removing camlzip.1.05+003.
  ocamlfind remove zip
Removing deriving-ocsigen.0.5.
  ocamlfind remove deriving-ocsigen
Removing ocaml-top.1.1.0.
  ./configure -install-bin /Users/hugo/.opam/4.00.1/bin -install-lib /Users/hugo/.opam/4.00.1/lib -install-doc /Users/hugo/.opam/4.00.1/doc/ocaml-top -install-data /Users/hugo/.opam/4.00.1/share/ocaml-top
  make uninstall
Warning: failure in package uninstall script, some files may remain:
# opam-version    1.1.0 (70f9716427bef58aef5bb40b3900e19b9deb7b05)
# os              darwin
# command         make uninstall
# path            /Users/hugo/.opam/4.00.1/build/ocaml-top.1.1.0
# compiler        4.00.1
# exit-code       2
# env-file        /Users/hugo/.opam/4.00.1/build/ocaml-top.1.1.0/ocaml-top-16850-42737e.env
# stdout-file     /Users/hugo/.opam/4.00.1/build/ocaml-top.1.1.0/ocaml-top-16850-42737e.out
# stderr-file     /Users/hugo/.opam/4.00.1/build/ocaml-top.1.1.0/ocaml-top-16850-42737e.err
### stdout ###
ocp-build -query-has ocaml-top
### stderr ###
Error: no package "ocaml-top"
make: *** [uninstall] Error 2

WARNING: /Users/hugo/.opam/4.00.1/share/ocaml-top is not empty. We keep its contents for future installations.
Removing macaque.0.6.1.
  ocamlfind remove macaque
Removing menhir.20130116.
  ocamlfind remove menhirLib
Removing ounit.1.1.2.
  ocamlfind remove oUnit
Removing fileutils.0.4.4.
  ocamlfind remove fileutils
Removing sqlite3-ocaml.2.0.4.
  ocamlfind remove sqlite3
Removing safepass.1.2.
  ocamlfind remove safepass
Removing ocaml-data-notation.0.0.10.
  ocamlfind remove odn
Removing xmlm.1.1.1.
  ocamlfind remove xmlm
Removing oasis2opam.0.3.1.
Removing merlin.1.3.1.
  make uninstall
Removing oasis.0.3.0.
  ocamlfind remove plugin-loader
  ocamlfind remove userconf
  ocamlfind remove oasis
Removing batteries.2.1.0.
  ocamlfind remove batteries
Removing ocamlgraph.1.8.3.
  ocamlfind remove ocamlgraph
Removing tyxml.2.2.0+besport9.
  ocamlfind remove tyxml
Removing pcre-ocaml.7.0.2.
  ocamlfind remove pcre
Removing type_conv.109.28.00.
  ocamlfind remove type_conv
Removing xml-light.3.1a.
  make uninstall
Warning: failure in package uninstall script, some files may remain:
# opam-version    1.1.0 (70f9716427bef58aef5bb40b3900e19b9deb7b05)
# os              darwin
# command         make uninstall
# path            /Users/hugo/.opam/4.00.1/build/xml-light.3.1a
# compiler        4.00.1
# exit-code       2
# env-file        /Users/hugo/.opam/4.00.1/build/xml-light.3.1a/xml-light-16850-5dd0bd.env
# stdout-file     /Users/hugo/.opam/4.00.1/build/xml-light.3.1a/xml-light-16850-5dd0bd.out
# stderr-file     /Users/hugo/.opam/4.00.1/build/xml-light.3.1a/xml-light-16850-5dd0bd.err
### stderr ###
make: *** No rule to make target `uninstall'.  Stop.

Removing easy-format.1.0.1.1.
  ocamlfind remove easy-format
Removing pgocaml.1.7.1.
  ocamlfind remove pgocaml
Removing aliases.0.0.4.
  ocamlfind remove aliases
Removing ocp-build.1.99.6-beta.
Removing cow.0.6.2.
  ocamlfind remove cow
Removing csv.1.3.1.
  ocamlfind remove csv
Removing dose.3.1.2.
  ocamlfind remove dose
  ocamlfind remove dose3
Removing ocamlnet.3.6.5.
  ocamlfind remove equeue
  ocamlfind remove equeue-gtk2
  ocamlfind remove equeue-ssl
  ocamlfind remove netcamlbox
  ocamlfind remove netcgi2
  ocamlfind remove netcgi2-plex
  ocamlfind remove netclient
  ocamlfind remove netgssapi
  ocamlfind remove nethttpd
  ocamlfind remove nethttpd-for-netcgi2
  ocamlfind remove netmech-scram
  ocamlfind remove netmulticore
  ocamlfind remove netplex
  ocamlfind remove netshm
  ocamlfind remove netstring
  ocamlfind remove netstring-pcre
  ocamlfind remove netsys
  ocamlfind remove netzip
  ocamlfind remove pop
  ocamlfind remove rpc
  ocamlfind remove rpc-auth-local
  ocamlfind remove rpc-generator
  ocamlfind remove rpc-ssl
  ocamlfind remove shell
  ocamlfind remove smtp
Removing typerex.1.99.6-beta.
  ocp-build -uninstall typerex
WARNING: /Users/hugo/.opam/4.00.1/share/typerex is not empty. We keep its contents for future installations.
Removing omake.0.9.8.6-0.rc1.
Removing imagemagick.0.34.
  ocamlfind remove magick
Removing ulex.1.1.
  ocamlfind remove ulex
Removing ocsigenserver.2.2.0+besport5.
Copying /Users/hugo/.opam/packages/ocsigenserver/ocsigenserver.2.2.0+besport5/files/ocsigenserver.install to /Users/hugo/.opam/4.00.1/build/ocsigenserver.2.2.0+besport5/
  rm -rf /Users/hugo/.opam/4.00.1/lib/ocsigenserver
Removing ocamlmod.0.0.4.

=-=-= Installing ocamlfind.1.4.0 =-=-=
...
=-=-= Installing batteries.2.1.0 =-=-=
...
=-=-= Installing calendar.2.03.2 =-=-=
...
=-=-= Installing camlzip.1.05+003 =-=-=
camlzip.1.05+003 Downloading http://forge.ocamlcore.org/frs/download.php/1037/camlzip-1.05.tar.gz
Copying /Users/hugo/.opam/packages/camlzip/camlzip.1.05+003/files/fix-install.patch to /Users/hugo/.opam/4.00.1/build/camlzip.1.05+003/
Applying fix-install.patch.
Building camlzip.1.05+003:
  make all
  make allopt
  make install-findlib
The compilation of camlzip.1.05+003 failed.
Removing camlzip.1.05+003.
  ocamlfind remove zip

=-=-= Installing cmdliner.0.9.2 =-=-=
...
=-=-= Installing cryptokit.1.7 =-=-=
Building cryptokit.1.7:
  make
  make install
The compilation of cryptokit.1.7 failed.
Removing cryptokit.1.7.
  ocamlfind remove cryptokit

=-=-= Installing csv.1.3.1 =-=-=
...
=-=-= Installing easy-format.1.0.1.1 =-=-=
...
=-=-= Installing extlib.1.5.4 =-=-=
...
=-=-= Installing imagemagick.0.34 =-=-=
Building imagemagick.0.34:
  make
  make find_install
The compilation of imagemagick.0.34 failed.
Removing imagemagick.0.34.
  ocamlfind remove magick

=-=-= Installing lablgtk.2.16.0 =-=-=
...
=-=-= Installing menhir.20130116 =-=-=
Building menhir.20130116:
  make install PREFIX=/Users/hugo/.opam/4.00.1 docdir=/Users/hugo/.opam/4.00.1/doc/menhir libdir=/Users/hugo/.opam/4.00.1/lib/menhir mandir=/Users/hugo/.opam/4.00.1/man/man1
The compilation of menhir.20130116 failed.
Removing menhir.20130116.
  ocamlfind remove menhirLib

=-=-= Installing ocaml-text.0.6 =-=-=
...
=-=-= Installing ocamlgraph.1.8.3 =-=-=
...
=-=-= Installing ocamlify.0.0.1 =-=-=
...
=-=-= Installing omake.0.9.8.6-0.rc1 =-=-=
...
=-=-= Installing optcomp.1.4 =-=-=
...
=-=-= Installing ounit.1.1.2 =-=-=
...
=-=-= Installing pcre-ocaml.7.0.2 =-=-=
Building pcre-ocaml.7.0.2:
  make
  make install
The compilation of pcre-ocaml.7.0.2 failed.
Removing pcre-ocaml.7.0.2.
  ocamlfind remove pcre

=-=-= Installing re.1.2.1 =-=-=
...
=-=-= Installing react.0.9.4 =-=-=
...
=-=-= Installing safepass.1.2 =-=-=
Building safepass.1.2:
  make
  make install
The compilation of safepass.1.2 failed.
Removing safepass.1.2.
  ocamlfind remove safepass

=-=-= Installing sqlite3-ocaml.2.0.4 =-=-=
Building sqlite3-ocaml.2.0.4:
  ocaml setup.ml -configure
  ocaml setup.ml -build
  ocaml setup.ml -install
The compilation of sqlite3-ocaml.2.0.4 failed.
Removing sqlite3-ocaml.2.0.4.
  ocamlfind remove sqlite3

=-=-= Installing ssl.0.4.6 =-=-=
...
=-=-= Installing type_conv.109.28.00 =-=-=
...
=-=-= Installing typerex.1.99.6-beta =-=-=
...
=-=-= Installing ulex.1.1 =-=-=
...
=-=-= Installing xml-light.3.1a =-=-=
...
=-=-= Installing xmlm.1.1.1 =-=-=
...
=-=-= Installing biniou.1.0.8.1 =-=-=
...
=-=-= Installing deriving-ocsigen.0.5 =-=-=
...
=-=-= Installing dyntype.0.9.0 =-=-=
...
=-=-= Installing fileutils.0.4.4 =-=-=
...
=-=-= Installing leveldb.0.3 =-=-=
...
=-=-= Installing ocaml-data-notation.0.0.10 =-=-=
Building ocaml-data-notation.0.0.10:
  make
  make install
The compilation of ocaml-data-notation.0.0.10 failed.
Removing ocaml-data-notation.0.0.10.
  ocamlfind remove odn

=-=-= Installing ocp-build.1.99.6-beta =-=-=
...
=-=-= Installing uri.1.3.8 =-=-=
...
=-=-= Installing cow.0.6.2 =-=-=
...
=-=-= Installing cudf.0.6.2 =-=-=
Building cudf.0.6.2:
  ocp-build -init -scan cudf -v 0
The compilation of cudf.0.6.2 failed.
Removing cudf.0.6.2.

=-=-= Installing ocamlmod.0.0.4 =-=-=
...
=-=-= Installing ocp-indent.1.3.2 =-=-=
...
=-=-= Installing ocp-index.0.3.0 =-=-=
...
=-=-= Installing yojson.1.1.7.1 =-=-=
...
=-=-= Installing ocaml-top.1.1.0 =-=-=
...

Due to some errors while processing { camlzip.1.05+003, cryptokit.1.7, cudf.0.6.2, imagemagick.0.34, menhir.20130116, ocaml-data-notation.0.0.10, pcre-ocaml.7.0.2, safepass.1.2, sqlite3-ocaml.2.0.4 }, the following actions will NOT be proceeded:
 - recompile dose.3.1.2
 - recompile ocamlnet.3.6.5
 - recompile merlin.1.3.1
 - recompile oasis.0.3.0
 - recompile lwt.2.4.3+besport1
 - recompile pgocaml.1.7.1
 - recompile aliases.0.0.4
 - recompile oasis2opam.0.3.1
 - recompile ccss.1.3
 - recompile tyxml.2.2.0+besport9
 - recompile aws.0.0.2.2
 - recompile macaque.0.6.1
 - recompile ocsigenserver.2.2.0+besport5

==== ERROR [while recompiling camlzip.1.05+003] ====
# opam-version    1.1.0 (70f9716427bef58aef5bb40b3900e19b9deb7b05)
# os              darwin
# command         make install-findlib
# path            /Users/hugo/.opam/4.00.1/build/camlzip.1.05+003
# compiler        4.00.1
# exit-code       2
# env-file        /Users/hugo/.opam/4.00.1/build/camlzip.1.05+003/camlzip-19714-c55063.env
# stdout-file     /Users/hugo/.opam/4.00.1/build/camlzip.1.05+003/camlzip-19714-c55063.out
# stderr-file     /Users/hugo/.opam/4.00.1/build/camlzip.1.05+003/camlzip-19714-c55063.err
### stdout ###
ocamlfind install zip META *.mli *.a *.cmi *.cma zip.cmxa zip.cmxs dllcamlzip.so
### stderr ###
ocamlfind: Package zip is already installed
 - (file /Users/hugo/.opam/4.00.1/lib/zip/META already exists)
make: *** [install-findlib] Error 2

==== ERROR [while recompiling cryptokit.1.7] ====
# opam-version    1.1.0 (70f9716427bef58aef5bb40b3900e19b9deb7b05)
# os              darwin
# command         make install
# path            /Users/hugo/.opam/4.00.1/build/cryptokit.1.7
# compiler        4.00.1
# exit-code       2
# env-file        /Users/hugo/.opam/4.00.1/build/cryptokit.1.7/cryptokit-19988-8cb833.env
# stdout-file     /Users/hugo/.opam/4.00.1/build/cryptokit.1.7/cryptokit-19988-8cb833.out
# stderr-file     /Users/hugo/.opam/4.00.1/build/cryptokit.1.7/cryptokit-19988-8cb833.err
### stdout ###
ocaml setup.ml -install
### stderr ###
ocamlfind: Conflict with another package: Library dllcryptokit_stubs.so is already installed
E: Failure("Command ''/Users/hugo/.opam/4.00.1/bin/ocamlfind' install cryptokit src/META _build/src/cryptokit.cmx _build/src/cryptokit.cmi _build/src/cryptokit.cmxs _build/src/cryptokit.a _build/src/cryptokit.cmxa _build/src/cryptokit.cma _build/src/dllcryptokit_stubs.so _build/src/libcryptokit_stubs.a src/cryptokit.mli' terminated with error code 2")
make: *** [install] Error 1

==== ERROR [while recompiling cudf.0.6.2] ====
# opam-version    1.1.0 (70f9716427bef58aef5bb40b3900e19b9deb7b05)
# os              darwin
# command         ocp-build -init -scan cudf -v 0
# path            /Users/hugo/.opam/4.00.1/build/cudf.0.6.2
# compiler        4.00.1
# exit-code       2
# env-file        /Users/hugo/.opam/4.00.1/build/cudf.0.6.2/cudf-36026-c0ceac.env
# stdout-file     /Users/hugo/.opam/4.00.1/build/cudf.0.6.2/cudf-36026-c0ceac.out
# stderr-file     /Users/hugo/.opam/4.00.1/build/cudf.0.6.2/cudf-36026-c0ceac.err
### stderr ###
Updating ocp-build.root
Warning: 11 incomplete packages (will not be built):
  Hidden: 11 incomplete packages in META files (use -print-incomplete-meta).
ocp-build: Fatal Exception Unix_error(No such file or directory, lstat, /Users/hugo/.opam/4.00.1/lib/dose3/../dose)

Fatal error: exception Unix.Unix_error(20, "lstat", "/Users/hugo/.opam/4.00.1/lib/dose3/../dose")

==== ERROR [while recompiling imagemagick.0.34] ====
# opam-version    1.1.0 (70f9716427bef58aef5bb40b3900e19b9deb7b05)
# os              darwin
# command         make find_install
# path            /Users/hugo/.opam/4.00.1/build/imagemagick.0.34
# compiler        4.00.1
# exit-code       2
# env-file        /Users/hugo/.opam/4.00.1/build/imagemagick.0.34/imagemagick-20589-f9e6ac.env
# stdout-file     /Users/hugo/.opam/4.00.1/build/imagemagick.0.34/imagemagick-20589-f9e6ac.out
# stderr-file     /Users/hugo/.opam/4.00.1/build/imagemagick.0.34/imagemagick-20589-f9e6ac.err
### stdout ###
ocamlfind install magick META \
        magick.mli  \
        magick.cmi  \
        magick.cma  \
        magick.cmxa \
        magick.cmxs \
        magick.a    \
        dllimagemagick_stubs.so \
        libimagemagick_stubs.a
### stderr ###
ocamlfind: Package magick is already installed
 - (file /Users/hugo/.opam/4.00.1/lib/magick/META already exists)
make: *** [find_install] Error 2

==== ERROR [while recompiling menhir.20130116] ====
# opam-version    1.1.0 (70f9716427bef58aef5bb40b3900e19b9deb7b05)
# os              darwin
# command         make install PREFIX=/Users/hugo/.opam/4.00.1 docdir=/Users/hugo/.opam/4.00.1/doc/menhir libdir=/Users/hugo/.opam/4.00.1/lib/menhir mandir=/Users/hugo/.opam/4.00.1/man/man1
# path            /Users/hugo/.opam/4.00.1/build/menhir.20130116
# compiler        4.00.1
# exit-code       2
# env-file        /Users/hugo/.opam/4.00.1/build/menhir.20130116/menhir-21893-f9e6ac.env
# stdout-file     /Users/hugo/.opam/4.00.1/build/menhir.20130116/menhir-21893-f9e6ac.out
# stderr-file     /Users/hugo/.opam/4.00.1/build/menhir.20130116/menhir-21893-f9e6ac.err
### stdout ###
...[truncated]
make[1]: `menhirLib.o' is up to date.
mkdir -p /Users/hugo/.opam/4.00.1/bin
mkdir -p /Users/hugo/.opam/4.00.1/lib/menhir
mkdir -p /Users/hugo/.opam/4.00.1/doc/menhir
mkdir -p /Users/hugo/.opam/4.00.1/man/man1
install src/menhir /Users/hugo/.opam/4.00.1/bin
install -m 644 src/standard.mly /Users/hugo/.opam/4.00.1/lib/menhir
cp -r manual.pdf demos /Users/hugo/.opam/4.00.1/doc/menhir
cp -r menhir.1 /Users/hugo/.opam/4.00.1/man/man1
Installing MenhirLib via ocamlfind.
### stderr ###
...[truncated]
25 out of 60 symbols keep track of their start position.
20 out of 60 symbols keep track of their end position.
56 out of 129 states have a default reduction.
33 out of 84 productions exploit shiftreduce optimization.
20 out of 129 states can peek at an error.
13 out of 129 states can do error recovery.
452 functions before inlining, 116 functions after inlining.
ocamlfind: Package menhirLib is already installed
 - (file /Users/hugo/.opam/4.00.1/lib/menhirLib/META already exists)
make: *** [install] Error 2

==== ERROR [while recompiling ocaml-data-notation.0.0.10] ====
# opam-version    1.1.0 (70f9716427bef58aef5bb40b3900e19b9deb7b05)
# os              darwin
# command         make install
# path            /Users/hugo/.opam/4.00.1/build/ocaml-data-notation.0.0.10
# compiler        4.00.1
# exit-code       2
# env-file        /Users/hugo/.opam/4.00.1/build/ocaml-data-notation.0.0.10/ocaml-data-notation-35103-616e65.env
# stdout-file     /Users/hugo/.opam/4.00.1/build/ocaml-data-notation.0.0.10/ocaml-data-notation-35103-616e65.out
# stderr-file     /Users/hugo/.opam/4.00.1/build/ocaml-data-notation.0.0.10/ocaml-data-notation-35103-616e65.err
### stdout ###
ocaml setup.ml -install
### stderr ###
ocamlfind: Package odn is already installed
 - (file /Users/hugo/.opam/4.00.1/lib/odn/META already exists)
E: Failure("Command ''/Users/hugo/.opam/4.00.1/bin/ocamlfind' install odn src/META _build/src/pa_odn.cmi _build/src/pa_odn.cma src/pa_odn.ml _build/src/pa_noodn.cmi _build/src/pa_noodn.cma src/pa_noodn.ml _build/src/ODN.cmx _build/src/ODN.cmi _build/src/odn.cmxs _build/src/odn.a _build/src/odn.cmxa _build/src/odn.cma src/ODN.ml' terminated with error code 2")
make: *** [install] Error 1

==== ERROR [while recompiling pcre-ocaml.7.0.2] ====
# opam-version    1.1.0 (70f9716427bef58aef5bb40b3900e19b9deb7b05)
# os              darwin
# command         make install
# path            /Users/hugo/.opam/4.00.1/build/pcre-ocaml.7.0.2
# compiler        4.00.1
# exit-code       2
# env-file        /Users/hugo/.opam/4.00.1/build/pcre-ocaml.7.0.2/pcre-ocaml-29723-442377.env
# stdout-file     /Users/hugo/.opam/4.00.1/build/pcre-ocaml.7.0.2/pcre-ocaml-29723-442377.out
# stderr-file     /Users/hugo/.opam/4.00.1/build/pcre-ocaml.7.0.2/pcre-ocaml-29723-442377.err
### stdout ###
ocaml setup.ml -install
### stderr ###
ocamlfind: Package pcre is already installed
 - (file /Users/hugo/.opam/4.00.1/lib/pcre/META already exists)
E: Failure("Command ''/Users/hugo/.opam/4.00.1/bin/ocamlfind' install pcre lib/META _build/lib/pcre.cmx _build/lib/pcre.cmi _build/lib/pcre.cmxs _build/lib/pcre.a _build/lib/pcre.cmxa _build/lib/pcre.cma _build/lib/dllpcre_stubs.so _build/lib/libpcre_stubs.a lib/pcre.mli' terminated with error code 2")
make: *** [install] Error 1

==== ERROR [while recompiling safepass.1.2] ====
# opam-version    1.1.0 (70f9716427bef58aef5bb40b3900e19b9deb7b05)
# os              darwin
# command         make install
# path            /Users/hugo/.opam/4.00.1/build/safepass.1.2
# compiler        4.00.1
# exit-code       2
# env-file        /Users/hugo/.opam/4.00.1/build/safepass.1.2/safepass-30375-462d2b.env
# stdout-file     /Users/hugo/.opam/4.00.1/build/safepass.1.2/safepass-30375-462d2b.out
# stderr-file     /Users/hugo/.opam/4.00.1/build/safepass.1.2/safepass-30375-462d2b.err
### stdout ###
ocaml setup.ml -install
### stderr ###
ocamlfind: Conflict with another package: Library dllsafepass_stubs.so is already installed
E: Failure("Command '/Users/hugo/.opam/4.00.1/bin/ocamlfind install safepass src/META _build/src/bcrypt.cmx _build/src/bcrypt.cmi _build/src/safepass.a _build/src/safepass.cmxa _build/src/safepass.cmxs _build/src/safepass.cma _build/src/dllsafepass_stubs.so _build/src/libsafepass_stubs.a src/bcrypt.mli' terminated with error code 2")
make: *** [install] Error 1

==== ERROR [while recompiling sqlite3-ocaml.2.0.4] ====
# opam-version    1.1.0 (70f9716427bef58aef5bb40b3900e19b9deb7b05)
# os              darwin
# command         ocaml setup.ml -install
# path            /Users/hugo/.opam/4.00.1/build/sqlite3-ocaml.2.0.4
# compiler        4.00.1
# exit-code       1
# env-file        /Users/hugo/.opam/4.00.1/build/sqlite3-ocaml.2.0.4/sqlite3-ocaml-30474-d6abbe.env
# stdout-file     /Users/hugo/.opam/4.00.1/build/sqlite3-ocaml.2.0.4/sqlite3-ocaml-30474-d6abbe.out
# stderr-file     /Users/hugo/.opam/4.00.1/build/sqlite3-ocaml.2.0.4/sqlite3-ocaml-30474-d6abbe.err
### stderr ###
ocamlfind: Package sqlite3 is already installed
 - (file /Users/hugo/.opam/4.00.1/lib/sqlite3/META already exists)
E: Failure("Command ''/Users/hugo/.opam/4.00.1/bin/ocamlfind' install sqlite3 lib/META _build/lib/sqlite3.cmx _build/lib/sqlite3.cmi _build/lib/sqlite3.cmxs _build/lib/sqlite3.a _build/lib/sqlite3.cmxa _build/lib/sqlite3.cma _build/lib/dllsqlite3_stubs.so _build/lib/libsqlite3_stubs.a lib/sqlite3.mli' terminated with error code 2")

'opam upgrade' failed.
samoht commented 11 years ago

Here is the culprit:

Removing ocamlfind.1.3.3.
Removing cryptokit.1.7.
Removing aws.0.0.2.2.
Removing re.1.2.1.
Removing camlzip.1.05+003.
Removing deriving-ocsigen.0.5.
Removing ocaml-top.1.1.0.
[...]

All the remaining packages do not depend explicitly on ocamlfind so their removal is broken. I guess this is an partly an issue in opam2oasis (CC: @Chris00 to double-check) and partly some packaging errors.

The --force would be nice, but I'm afraid this option does not exist in ocamlfind so we can't do much here.

samoht commented 11 years ago

The recovery of errors after an upgrade is tracked in #587. The current plan for this feature is to do the equivalent of an opam switch export before the upgrade, and if something went wrong tell the user to run opam swich import < foo. That's clearly less powerful than a full snapshot/rollback behavior (because you can still have compile issues when you import) but at least it gives you a clear picture of what you had installed (and it's also easier for the bug reports). I don't think won't have time to implement this in 1.1, though.

Chris00 commented 11 years ago

@samoht Could you please be more specific about what the problem with oasis2opam may be? An "ocamlfind remove ..." is always included. For example, CSV seem to reinstall fine.

BTW, I noticed that the opam of sqlite3-ocaml.2.0.4 looks broken: there is no prefix in the configure step.

samoht commented 11 years ago

Seems that they are missing:

depends: [ "ocamlfind" ]

So OPAM doesn't know there is a dependency, and thus cannot guaranty the removal order.

Chris00 commented 11 years ago

I do not think they do. If one does, I'd be interested to know about it. Incidentally, I just did an opam upgrade and I got a similar error (for example for root1d):

==== ERROR [while recompiling root1d.0.3] ====
# opam-version    1.1.0 (a8b41acbbded7648f1684be0ffeda7db7855cd8b)
# os              linux
# command         ocaml setup.ml -install
# path            /home/trch/.opam/system/build/root1d.0.3
# compiler        system (3.12.1)
# exit-code       1
# env-file        /home/trch/.opam/system/build/root1d.0.3/root1d-28567-8a5d98.env
# stdout-file     /home/trch/.opam/system/build/root1d.0.3/root1d-28567-8a5d98.out
# stderr-file     /home/trch/.opam/system/build/root1d.0.3/root1d-28567-8a5d98.err
### stderr ###
ocamlfind: Package root1d is already installed
 - (file /home/trch/.opam/system/lib/root1d/META already exists)
E: Failure("Command ''/home/trch/.opam/system/bin/ocamlfind' install root1d src/META _build/src/root1D.cmx _build/src/root1D.cmi _build/src/root1d.cmxs _build/src/root1d.a _build/src/root1d.cmxa _build/src/root1d.cma src/root1D.mli' terminated with error code 2")

Note that the ocamlfind dependency is present in the package root1d. Also checking for the directory ~/.opam/system/lib/root1d/ after the failure reveals that it does not exist. Finally, issuing opam install root1d installs it without problem.

Isn't the problem here:

Removing ocamlfind.1.3.3.
Removing tyxml.2.2.0.
  ocamlfind remove tyxml
Removing xmlm.1.1.1.
  ocamlfind remove xmlm
Removing root1d.0.3.
  ocamlfind remove root1d

Removing ocamlfind before root1d means that the ocamlfind executable is not available to perform the removals?

samoht commented 11 years ago

Removing ocamlfind before root1d means that the ocamlfind executable is not available to perform the removals?

Yes, that's indeed the issue. Don't really understand why this is came back. @AltGr any idea (maybe related to your recent changes ?). btw, I'm writing a small script to fix the missing ocamlfind dependencies, will fix at least that problem shortly.

samoht commented 11 years ago

I do not think they do.

You are right, I think I need some sleep :p anyway, I've written a small script to test such things, might be useful to others: https://gist.github.com/samoht/6346885

dbuenzli commented 11 years ago

Just want to check that, in my own packaging scheme (see here and here) I'm using .install files to handle installation/uninstallation of the META file. This module having no dependencies I don't need ocamlfind to build it, am I correct thinking that I don't need to depend on ocamlfind in that case ?

samoht commented 11 years ago

@dbuenzli as long as your install/remove all the eventual dll*.so files (using the stublibs field), yes you are fine.

Chris00 commented 11 years ago

@dbuenzli If you install META files, then why not rely on ocamlfind to perform (un)installation of packages?

dbuenzli commented 11 years ago

Well since I don't use ocamlfind to install why use ocamlfind to uninstall ?

Chris00 commented 11 years ago

@dbuenzli Precisely! If you install a META file, why don't you use ocamlfind to perform the installation? It seems to me that, in order to avoid ocamlfind you must re-implement part of its logic (OK, may not feel like a big deal but I do not see the point).

dbuenzli commented 11 years ago

@Chris00 I install a META file so that people can use either ocamlfind, ocamlfind+ocamlbuild or a build system that understands META files natively like obuild or ocp-build to easily use the package.

However I don't install via ocamlfind because an .install opam file allows me to specify much more than a META file can express like things to put in man, bin, doc, share, etc., see section 2.2.3 of the developer manual. Since I need that to install the readme, release notes etc. I prefer to do everything using a single mechanism. A properly generated .install file provides a complete manifest of what is/needs to be installed/removed by the package which could also be eventually useful for e.g. debian packaging.

You can read more about that approach in this and this message.