Closed panglesd closed 1 year ago
That works for me. I do not expect that the libraries of the tools are used much and as we discussed before, they could be packaged separately to make the dependency more explicit.
For the pinned compilers, the constraint on the compiler added to the packages should cover that ?
For the pinned compilers, the constraint on the compiler added to the packages should cover that ?
I don't think we found a way to reliably detect (and differentiate) pinned compilers using opam language.
I think we have several options:
upgrade
, opam show
, etc, wrong.<switch-prefix>/_ocaml-platform
(even though this is not explicitly allowed by opam
)I am not sure what I prefer yet.
I'm not sure I understand. In the case of a pinned compiler, we install the packages from a temporary repository that is still removed when the installation is done. If our constraints are good, there shouldn't be any ambiguity ?
I think pinned compilers should have defined version numbers, right ? Cached packages have strong constraints on the compiler packages, that shouldn't match a pinned compiler.
The problem is that, if you remove the repository from which the tools were installed, the tools inherit from the opam file from another repository.
So, for instance, opam show ocamlformat
will have again all the constraints on the dependencies (such as odoc-parser
and all the annoying ones).
I see now! A subsequent install of ocamlformat will go back to using the released package, because the cached package is no longer defined. I don't think the dependencies are modified until then but the --with-dev-setup
will certainly trigger a re-install in this case.
Keeping the repository inside the switch prefix doesn't seem like a bad idea. There's <switch-prefix>/var/cache
, it's currently used by Odig at runtime and is not cleaned up when Odig is uninstalled.
Perhaps pinned packages could be used for this purpose ? It's might come with more edge cases, so I'd suggest prefix/var/cache
first.
I agree, let's go with this solution!
Closed by #140
When we started the project, we tried to be as invisible as possible:
However, this was in fact in contradiction with user experience:
ocamlformat
version #126,with-dev-tools
#128update
,upgrade
,remove
,reinstall
,opam show
is wrong...Since solving 1. and 2. has already made us go in the direction of more "intrusivity" for a better user experience, #127 and #134, I suggest continuing with 3. and keep the cache repo enabled after
ocaml-platform
has finished running.Running
ocaml-platform
would leave the switch modified.There is still the problem of pinned and variants compilers, where the cache is not kept. One possible solution would be to store a "switch-specific" cache it in some "switch-specific" folder (one that would be remove by opam in case the switch is removed, if possible).