fix some issues writing the constraints file during bootstrap #534
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
We're seeing some cases downstream where fromager
fails with an exception because it tries to remove
something from the unresolved dependency list when
the item isn't in the list. This seems to be
caused by having multiple candidate versions for a
package where both versions could be used by all
consumers.
This change resolves the issue by stopping the
resolution loop when we find a version of a
package that can work for all consumers. The loop
now iterates from the newest version to the
oldest, to ensure we choose the newest package
that works.
There is also some error handling in case this fix
is not sufficient to eliminate the original
ValueError.
I also noticed that a log message that we supposed
to print debug info about the candidate versions
was using the wrong list variable so it was always
printing the same values, regardless of the
package. I cleaned that up and added additional
debug logging.