Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

depgraph: Do not trigger rebuilds for some options #1310

Draft
wants to merge 1 commit into
base: master
Choose a base branch
from
Draft
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
8 changes: 6 additions & 2 deletions lib/_emerge/depgraph.py
Original file line number Diff line number Diff line change
Expand Up @@ -109,6 +109,8 @@
import _emerge.stdout_spinner.stdout_spinner


_NO_MERGE_OPTS = ("--buildpkgonly", "--fetchonly", "--fetch-all-uri")

# Exposes a depgraph interface to dep_check.
_dep_check_graph_interface = collections.namedtuple(
"_dep_check_graph_interface",
Expand Down Expand Up @@ -1942,7 +1944,9 @@ def _process_slot_conflicts(self):
for conflict in self._dynamic_config._package_tracker.slot_conflicts():
self._process_slot_conflict(conflict)

if self._dynamic_config._allow_backtracking:
if self._dynamic_config._allow_backtracking and not any(
opt in self._frozen_config.myopts for opt in _NO_MERGE_OPTS
):
self._slot_operator_trigger_reinstalls()
Copy link
Member Author

@zmedico zmedico Mar 20, 2024

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

It seems like --buildpkgonly needs to be in a class of its own here, since --fetch* should behave mostly like regular build commands in order to avoid prevent discrepancies in behavior (like the slot conflicts in https://bugs.gentoo.org/161422 though those would exist without --fetchonly you get the idea).


def _process_slot_conflict(self, conflict):
Expand Down Expand Up @@ -8967,7 +8971,7 @@ def _accept_blocker_conflicts(self):
if self._dynamic_config._allow_backtracking:
return False
acceptable = False
for x in ("--buildpkgonly", "--fetchonly", "--fetch-all-uri", "--nodeps"):
for x in _NO_MERGE_OPTS + ("--nodeps",):
if x in self._frozen_config.myopts:
acceptable = True
break
Expand Down