Internal enhancements to Solution and Dependency states (#429)
* Remove obsolete Alire.Dependencies.Unavailable
This fake dependency was used in the old Ada index to store an unavailable
dependency. There is no longer any use for this constant.
* Image functions for newly tagged Alire.Milestones
Make the type tagged to gain dot notation, and add [TTY_]Image subprograms for
simpler printing elsewhere.
* New Alire.Dependencies.States type
This type is used to store the actual way in which a dependency was solved. All
possibilities are stored, which allows to properly cache a solution, and detect
changes in solutions across operations that modify the solution: pinning,
withing, updating...
* New Alire.Dependencies.States.Maps
A crate name -> dep state mapping which is at the core of the cached Solution,
with a couple of functional-style modifiers for use in expression functions.
* Remove pinning info from Releases
This information is now stored in the dependency State where it better belongs.
This way it doesn't matter if the solution contains a release for the pinned
dependency; the pinning information is always preserved.
* Reworked Solution internals to use States
(Doesn't build.) Changes to Alire.Solutions to use the new dependency states.
With these changes there is no loss of information when going from a valid to
an invalid solution (information about partial solutions is stored the same as
for complete solutions), which enables down the road better feedback to users
and simpler implementation of other improvements, like pinning of crates to
local folders.
* Solver improvements based on new dependency states
(Only alire-solver.adb builds.) With these changes, the solver needs not to
check the complete validity of a solution once all dependencies are processed
(which is an expensive test), because validity is guaranteed for any partial
solution (that is, no incompatible release can make into the solution). Also,
while the solver was previously complete in regard to valid solutions (with
releases or hints), now it is also complete for invalid solutions (those
missing releases and hints for some dependency). This means that the solver
will return the "best" incomplete solution when a complete one cannot be found.
* Tweaks to achieve build with new Solution
A few minor changes due to changes in the Solution public methods are needed
here and there, without functional implications.
* Tweaks for testsuite compliance
A few changes are needed to ensure the same output as before is produced, or to
adapt a few tests to minimal output changes caused by the homogenization of
dependency images.
* Make Alire.Crate_Name a proper private type
Our Dynamic_Predicate in the publicly defined Crate_Name as new String is
rejected by GNAT 9, and I couldn't find a workaround short of making all of
Alire.* non-preelaborable. Defining privately Crate_Name as new String in turn
caused numerous errors in child packages due to some mixing between the public
and private views. In the end, making it a record was the simplest change
without introducing the risk of missing checks (as if we had made it simply a
subtype of String).
So, given the change, I bit the bullet to make it tagged and provide a couple
of convenience functions.