OCaml Forge

Detail: [#758] `make uninstall` doesn't work after `make distclean`

Bugs: Browse | Download .csv | Monitor

[#758] `make uninstall` doesn't work after `make distclean`

2010-09-22 15:59
Submitted by:
ygrek (ygrek)
Assigned to:
Sylvain Le Gall (gildor-admin)
Due in version:
Awaiting Response
Operating System:
`make uninstall` doesn't work after `make distclean`

Detailed description
$ cat > _oasis
OASISFormat: 0.1
Name: test
Version: 0.0.1
Synopsis: test
Authors: me
License: BSD3
Plugins: DevFiles, META
BuildTools: ocamlbuild

Library test
Path: .
Modules: Test

$ cat > test.ml
let test = print_endline

$ OASIS setup

$ ./configure

$ make install
ocaml setup.ml -install
W: Nothing to install for findlib library 'test'

$ ocamlfind list | grep test

$ make && make install && make distclean

$ ocamlfind list | grep test
test (version: 0.0.1)

$ make uninstall
ocaml setup.ml -uninstall

$ ocamlfind list | grep test
test (version: 0.0.1)

i.e. make uninstall doesn't remove the library.

(Note that install target doesn't depend on build target - this is probably not a bug but a feature wish)


Date: 2016-06-19 14:14
Sender: Sylvain Le Gall

Extra comment from P. Chambart (#779)

install/reinstall doesn't work when installation log unavailable.

Detailed description
This can happen when you installed a library using a downloaded .tar.gz and you want to install the darcs version for instance, and you removed the old directory.

The problem is that ocamlfind doesn't allow to replace the old version. In case it happens, setup.ml should run "ocamlfind remove" and then retry "ocamlfind install".
Date: 2010-09-23 17:06
Sender: ygrek

Date: 2010-09-23 08:48
Sender: Sylvain Le Gall

A lot of things that are installed are computed at runtime and registered in setup.log.

E.g. when installing documentation or extra data, we evaluate a glob pattern (e.g. DataFiles: src/*.csv) and register the result of installation. So basically we know that /usr/share/doc/mylib/toto.csv has been installed by the program.

How can we revert this using a force-uninstall?

I don't think removing "/usr/share/doc/mylib/*.csv" is a very good idea (esp. done with root rights).

Right now the best option I can propose to you is to issue a more explicit error when you run make uninstall after distclean.

$ make uninstall
ocaml setup.ml -uninstall
E: Cannot find setup.log installation events, either you don't have yet installed or you called distclean before
I: Based only on _oasis data, you can run try to run "ocamlfind remove test"

This way, you know what to do (simple copy and paste) and you get warned about running 'distclean'.

Is it ok for you?
Date: 2010-09-23 07:43
Sender: ygrek

I see.. Maybe it makes sense to have force-uninstall target to uninstall all stuff described in _oasis without looking into setup.data?
Date: 2010-09-22 16:19
Sender: Sylvain Le Gall

There is a difference between "make clean" and "make distclean". The first one doesn't remove setup.log/setup.data.

OASIS cannot randomly remove thing that he doesn't have installed, so whenever you "make distclean", you make it lose its memory (setup.log). So he doesn't know what has been installed.

I think the ./configure -> make build -> make install -> make clean -> make uninstall should work in your case.

"make distclean" is reserved to go back to pristine source (e.g. for debian packager).

Attached Files:


Field Old Value Date By
assigned_tonone2010-09-22 16:19gildor-admin
ResolutionNone2010-09-22 16:19gildor-admin