method
binding_requirements_for_conflict
ruby latest stable - Class:
Bundler::Molinillo::Resolver::Resolution
Method not available on this version
This method is only available on newer versions. The first available version (v2_6_3) is shown here.
binding_requirements_for_conflict(conflict)private
@param [Conflict] conflict @return [Array] minimal array of requirements that would cause the passed
conflict to occur.
# File lib/bundler/vendor/molinillo/lib/molinillo/resolution.rb, line 522
def binding_requirements_for_conflict(conflict)
return [conflict.requirement] if conflict.possibility.nil?
possible_binding_requirements = conflict.requirements.values.flatten(1).uniq
# When thereâs a `CircularDependency` error the conflicting requirement
# (the one causing the circular) wonât be `conflict.requirement`
# (which wonât be for the right state, because we wonât have created it,
# because itâs circular).
# We need to make sure we have that requirement in the conflictâs list,
# otherwise we wonât be able to unwind properly, so we just return all
# the requirements for the conflict.
return possible_binding_requirements if conflict.underlying_error
possibilities = search_for(conflict.requirement)
# If all the requirements together don't filter out all possibilities,
# then the only two requirements we need to consider are the initial one
# (where the dependency's version was first chosen) and the last
if binding_requirement_in_set?(nil, possible_binding_requirements, possibilities)
return [conflict.requirement, requirement_for_existing_name(name_for(conflict.requirement))].compact
end
# Loop through the possible binding requirements, removing each one
# that doesn't bind. Use a `reverse_each` as we want the earliest set of
# binding requirements, and don't use `reject!` as we wish to refine the
# array *on each iteration*.
binding_requirements = possible_binding_requirements.dup
possible_binding_requirements.reverse_each do |req|
next if req == conflict.requirement
unless binding_requirement_in_set?(req, binding_requirements, possibilities)
binding_requirements -= [req]
end
end
binding_requirements
end Related methods
- Instance methods
- resolve
- Class methods
- new
- Private methods
-
activate_new_spec -
attempt_to_activate -
attempt_to_filter_existing_spec -
binding_requirement_in_set? -
binding_requirements_for_conflict -
build_details_for_unwind -
conflict_fixing_possibilities? -
create_conflict -
debug -
end_resolution -
filter_possibilities_after_unwind -
filter_possibilities_for_parent_unwind -
filter_possibilities_for_primary_unwind -
filtered_possibility_set -
find_state_for -
group_possibilities -
handle_missing_or_push_dependency_state -
indicate_progress -
initial_state -
locked_requirement_named -
locked_requirement_possibility_set -
parent_of -
possibilities_for_requirement -
possibility -
possibility_satisfies_requirements? -
process_topmost_state -
push_state_for_requirements -
raise_error_unless_state -
require_nested_dependencies_for -
requirement_for_existing_name -
requirement_tree_for -
requirement_trees -
resolve_activated_specs -
start_resolution -
state -
unwind_for_conflict -
unwind_options_for_requirements