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
Fix memory leak in ./pants changed
#5011
Fix memory leak in ./pants changed
#5011
Conversation
… just need to handle missing/optional specs correctly.
…their declaration conditional.
…rces are handled via concrete targets created in macros.
This is now reviewable. It's possible that this could go further and refactor |
./pants changed
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
) | ||
for dep in transitive_set: | ||
yield dep | ||
|
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
seems like it's possible for this to emit duplicate entries. would it make sense to dedupe either here or in the callsite below (in the if changed_request.include_dependees == 'direct'
block)?
With regard to #4010 and #3563: those should both have been fixed by Benjy's change to generate synthetic resource targets as part of the |
yeah, seems stale. since they test master commit over commit, I'd guess that #4010 was ultimately the first cause of failures of these tests in master and so they got skipped with a pointer there that has since become irrelevant. so probably good to simply re-enable them would be my guess. |
### Problem #5011 introduced a failure in an integration test which was missed due to #5019. ### Solution Fix the test by moving the decision between using custom Javac and using the `tools.jar` out of `JavacPlugin` and into the `ProvideToolsJar` task (which runs after `bootstrap-jvm-tools`). ### Result Fixes #5020.
* master: (305 commits) Add configurable message when missing-deps-suggest doesn't have suggestions (pantsbuild#5036) Use split_whitespace for parsing of cflags. (pantsbuild#5038) Add documentation about strict deps (pantsbuild#5025) Fix JarCreate invalidation in the presence of changing resources. (pantsbuild#5030) Prepare the 1.4.0dev18 release. (pantsbuild#5034) Use the script verified identity when signing. (pantsbuild#5032) Dedup dependencies output (pantsbuild#5029) Have twine use the previously established pgp key during release. (pantsbuild#5031) [simple-code-gen] extension point for injecting extra exports (pantsbuild#4976) Prepare the 1.4.0dev17 release. (pantsbuild#5028) Content-addressable {file,directory} store and utility (pantsbuild#5012) [pantsd] Launch the daemon via a subprocess call. (pantsbuild#5021) Use the service deps if the target declares an exception. (pantsbuild#5017) Fix support for custom javac definitions (pantsbuild#5024) Pass references to Paths (pantsbuild#5022) Replace Blake2 with Sha256 (pantsbuild#5014) Revert pytest successful test caching in CI. (pantsbuild#5016) Fingerprint has from_hex_string, as_bytes, Display, and Debug (pantsbuild#5013) Fix memory leak in `./pants changed` (pantsbuild#5011) Move confluence related things to contrib (pantsbuild#4986) ...
### Problem Before @kwlzn fixed pantsbuild#4508 by introducing `compute_dependency_specs`, there was no way to get the "implicit" dependencies of a Target without constructing it. So pantsbuild#4424 switched to using a full `BuildGraph` to compute the dependents in changed. While that fixed the bug, it also introduced a memory leak, because instantiating a Target causes a cycle with the BuildGraph that owns it. ### Solution Now that pantsbuild#4508 is fixed, restore the codepaths that were replaced in pantsbuild#4424, and use `compute_dependency_specs` to compute the "implicit" dependencies of Targets in the graph. Additionally, cleans up the `tool.jar`/`javac` split in the Java subsystem to remove the requirement that `def injectables` has been called before requesting injectable specs. ### Result Fixes pantsbuild#4494.
Problem
Before @kwlzn fixed #4508 by introducing
compute_dependency_specs
, there was no way to get the "implicit" dependencies of a Target without constructing it. So #4424 switched to using a fullBuildGraph
to compute the dependents in changed. While that fixed the bug, it also introduced a memory leak, because instantiating a Target causes a cycle with the BuildGraph that owns it.Solution
Now that #4508 is fixed, restore the codepaths that were replaced in #4424, and use
compute_dependency_specs
to compute the "implicit" dependencies of Targets in the graph. Additionally, cleans up thetool.jar
/javac
split in the Java subsystem to remove the requirement thatdef injectables
has been called before requesting injectable specs.Result
Fixes #4494.