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

Allow for more cyclic cases with file dependencies #10475

Conversation

stuhood
Copy link
Sponsor Member

@stuhood stuhood commented Jul 27, 2020

Problem

We'd like to allow cycles via file addresses, but not all cases are considered: see #10471.

Solution

Don't report a cycle if there is a file address anywhere in the cyclic portion.

Result

Fixes #10471. Performance is unchanged.

[ci skip-rust-tests]

# Rust tests will be skipped. Delete if not intended.
[ci skip-rust-tests]
@stuhood stuhood changed the title Allow for more cyclic cases. See #10471. Allow for more cyclic cases with file dependencies Jul 27, 2020
@@ -161,11 +161,31 @@ def _detect_cycles(
path_stack: OrderedSet[Address] = OrderedSet()
visited: Set[Address] = set()

def maybe_report_cycle(address: Address) -> None:
Copy link
Contributor

Choose a reason for hiding this comment

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

Nit: report is a polite way of saying raise hehe. No need to change though.

@stuhood
Copy link
Sponsor Member Author

stuhood commented Jul 28, 2020

Only test failure is a newly skipped test. Merging.

@stuhood stuhood merged commit b9468b3 into pantsbuild:master Jul 28, 2020
@stuhood stuhood deleted the stuhood/allow-file-address-anywhere-in-cyclic-path branch July 28, 2020 00:01
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

Cycles involving file addresses not always permitted
2 participants