-
Notifications
You must be signed in to change notification settings - Fork 390
Stop opam package installation when a package install fails #4629
Description
Hi everyone,
I'm installing in a container a forest of dependencies with opam install -y --deps-only --with-test .. However, one of the dependencies fails to build. It super useful on an end-user device to keep building and installing packages, because each installed package is a win, but not so much when working with (e.g., Docker) containers: the command will fail and the cache layer will be discarded anyway.
It seems that there is no way to short-circuit the install as soon as one of the dependencies fails to be installed. Adding one would help saving time and energy in containers!
As suggested by a skilled hacker, one could (as a workaround?) monitor the subprocesses for failure and kill all remaining opam instances.
Although a bit early, I'd suggest a variation on "fail fast" for the name of this option (by analogy with CI terminology), another Opam ninja prefers --stop-on-error.