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

Associates or friends leak the internals of their compile classpath #1021

Open
Bencodes opened this issue Aug 31, 2023 · 2 comments
Open

Associates or friends leak the internals of their compile classpath #1021

Bencodes opened this issue Aug 31, 2023 · 2 comments

Comments

@Bencodes
Copy link
Collaborator

The flatten jar macro currently collects the entire compilation classpath of any target passed is as an associate which gives access to all of the Kotlin internal functions of not just the direct associate dependencies, but all of the compile time jars provided by the associate dependencies.

def _flatten_jars(nested_jars_depset):
"""Returns a list of strings containing the compile_jars for depset of targets.
This ends up unwinding the nesting of depsets, since compile_jars contains depsets inside
the nested_jars targets, which themselves are depsets. This function is intended to be called
lazily form within Args.add_all(map_each) as it collapses depsets.
"""
compile_jars_depsets = [
target[JavaInfo].compile_jars
for target in nested_jars_depset.to_list()
if target[JavaInfo].compile_jars
]
return [file.path for file in depset(transitive = compile_jars_depsets).to_list()]

@Bencodes
Copy link
Collaborator Author

Assuming this is not the intended behavior, replacing the JavaInfo#compile_jars with just the direct outputs will likely be a breaking change for some people and need to be feature flagged and gradually rolled out.

@restingbull
Copy link
Collaborator

This is implementing strict associates. Flag it?

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

No branches or pull requests

2 participants