opam
opam copied to clipboard
Specialise switch state write functions
from #6256
The origin of the bug is that for simulated pinning the pinned field in the switch state is not updated. As the switch state is written at the end of pinning process, we don't want to write it.
There is already functions that handle installed package addition our removal, we can have and use only specialised function for switch state writing (update pins, packages, roots), that updates only a subpart of the switch state file.
We can then have a switch state with more information and no longer not only update specific fields because they could be written.
related to #6530. As we update the whole switch, we end up with a case where we give the wrong information for an operation. It is another argument to this issue, we should indeed divide the state with the simulated parts and the lasting ones.