opam is a source-based package manager. It supports multiple simultaneous compiler installations, flexible package constraints, and a Git-friendly development workflow.
the scenario I had was as follows (using opam 1.2.2):
opam update in the working directory /tmp/foo
rm -rf /tmp/foo in a different terminal
I was surprised that during the update (while opam was downloading), opam complained about "no such file or directory" -- which I then discovered was related to the current working directory which got lost.
--> why does opam need to investigate its cwd (and check existance) while it is downloading things to ~/.opam?
Probably not the best approach, but the reason boils down to this:
many operations rely on chdir (here it's probably command execution, but even directory normalisation does)
opam always attempts to replace itself in its original cwd, in case it may need to lookup stuff from there. The issue is that it fails if the directory does not exist. I've already caught this in a few places, but not everywhere it seems.
the scenario I had was as follows (using opam 1.2.2):
opam update
in the working directory/tmp/foo
rm -rf /tmp/foo
in a different terminalI was surprised that during the update (while opam was downloading), opam complained about "no such file or directory" -- which I then discovered was related to the current working directory which got lost.
--> why does opam need to investigate its cwd (and check existance) while it is downloading things to
~/.opam
?