Closed hhugo closed 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.
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.
@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.
Seems that they are missing:
depends: [ "ocamlfind" ]
So OPAM doesn't know there is a dependency, and thus cannot guaranty the removal order.
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?
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.
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
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 ?
@dbuenzli as long as your install/remove all the eventual dll*.so
files (using the stublibs
field), yes you are fine.
@dbuenzli If you install META files, then why not rely on ocamlfind
to perform (un)installation of packages?
Well since I don't use ocamlfind
to install why use ocamlfind
to uninstall ?
@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).
@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.
I often get the 2 following errors during updates.
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