-
-
Notifications
You must be signed in to change notification settings - Fork 632
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
Remove the BuildGraph reference from Target #5668
Comments
That sounds reasonable to me. |
same |
Two thoughts here:
|
pants/src/python/pants/build_graph/target.py Line 328 in 5ee0e81
weakref .
|
For instance, following code snippet
would throw this error: But I was hoping |
@stuhood: Thanks. It's confirmed by using
but with The graph of random samples of 500 objects doesn't always include |
### Problem As described in #5668 ### Solution Use weakref to remove the BuildGraph reference from Target.
While the reference still exists, the cycle no longer does. Resolving. |
There has been a very long lived object graph cycle between
BuildGraph
andTarget
: each references the other.While our ambition with tickets like #4769 is to eventually do away with the
BuildGraph
entirely, we may want to start executing deprecations that will allow us to remove this reference sooner.One (relatively straightforward?) strategy would be to deprecate all methods on
Target
that deal with dependees (telling people to directly consumeself.context.build_graph
instead), and then convertTarget
objects directly into a graph of references to one another in order to fillTarget.dependencies
and other similar methods that walk down the graph.The text was updated successfully, but these errors were encountered: