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

Only download JDK repositories that are needed #12846

Closed
wants to merge 3 commits into from

Conversation

comius
Copy link
Contributor

@comius comius commented Jan 18, 2021

The problem were selects that pointed to remote repos, which causes all the remote repos to be downloaded. Inserting an alias in between prevents this download.

Fixes #12778

@comius comius requested a review from c-mita January 18, 2021 11:37
@google-cla google-cla bot added the cla: yes label Jan 18, 2021
@Wyverald
Copy link
Member

Sorry for randomly jumping in, but this seems rather surprising to me. I would've expected that with select("true":"@A//:thing", "false":"@B//:thing"), the repo B should not be fetched at all. Is there a valid reason why B is fetched in this case? If not, can we fix this spurious loading instead?

@comius
Copy link
Contributor Author

comius commented Jan 18, 2021

Sorry for randomly jumping in, but this seems rather surprising to me. I would've expected that with select("true":"@A//:thing", "false":"@B//:thing"), the repo B should not be fetched at all. Is there a valid reason why B is fetched in this case? If not, can we fix this spurious loading instead?

I can confirm this is the behaviour, but I don't know the reason.
@katre ?

@comius comius self-assigned this Jan 18, 2021
@jin jin added the team-Rules-Java Issues for Java rules label Jan 19, 2021
@katre
Copy link
Member

katre commented Jan 19, 2021

I believe this behavior is due to how a target is loaded: all of the labels referenced in a target need to be loaded (unless the attribute is declared as LABEL_NODEP).

An example of why this is needed is that in the example you gave, if @B//:thing didn't exist, the error would never be reported.

I may be mistaken, however, so I'll tag in @gregestren to see if that matches his understanding.

@Wyverald
Copy link
Member

An example of why this is needed is that in the example you gave, if @B//:thing didn't exist, the error would never be reported.

I'd argue that's WAI. In fact, for part of the external deps overhaul, I was banking on the fact that B is allowed to not exist in this case -- imagine that B is a repo produced by a Windows executable only, and is completely missing when the user is running on other platforms.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
cla: yes team-Rules-Java Issues for Java rules
Projects
None yet
Development

Successfully merging this pull request may close these issues.

bazel test //... on Linux is downloading JDKs for Windows, Mac Os and Linux ppc64le
4 participants