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

Fixes #1678: Optimize Bazel protobuf rules install [BLOCKED: #1634] #1679

Merged
merged 454 commits into from
Aug 22, 2020

Conversation

miaboloix
Copy link
Contributor

@miaboloix miaboloix commented Aug 19, 2020

Explanation

Fixes #1678: Optimize Bazel protobuf rules install.

Currently, http_rules in WORKSPACE are used to import rules_java and rules_proto, the external dependencies needed to run proto rules like proto_library and java_lite_proto_library in Bazel.

However, these http_archive rules bring in more than what is needed to use proto_library and java_lite_proto_library and some of these unused artifacts come with lengthly and expensive download times.

Thanks to @anandwana001, the following solution was found: https://github.com/google/startup-os/blob/master/WORKSPACE#L173. By replacing the http_archive rules with these bindings and removing the now unnecessary load() statements from model/BUILD, we are able to import only what is necessary.

Building app library from clean...

  • Before optimization: ~3min 45s
  • After optimization: ~2min 55s

Checklist

  • The PR title starts with "Fix #bugnum: ", followed by a short, clear summary of the changes. (If this PR fixes part of an issue, prefix the title with "Fix part of #bugnum: ...".)
  • The PR explanation includes the words "Fixes #bugnum: ..." (or "Fixes part of #bugnum" if the PR only partially fixes an issue).
  • The PR follows the style guide.
  • The PR does not contain any unnecessary auto-generated code from Android Studio.
  • The PR is made from a branch that's not called "develop".
  • The PR is made from a branch that is up-to-date with "develop".
  • The PR's branch is based on "develop" and not on any other branch.
  • The PR is assigned to an appropriate reviewer in both the Assignees and the Reviewers sections.

@miaboloix miaboloix changed the base branch from develop to introduce-robolctric-app-tests August 20, 2020 22:24
@miaboloix miaboloix assigned BenHenning and unassigned miaboloix Aug 20, 2020
Copy link
Sponsor Member

@BenHenning BenHenning left a comment

Choose a reason for hiding this comment

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

Following back up. Fantastic build time improvement! I still want to better understand whether this is the correct approach & why, and ensure that's documented before we go ahead with the solution.

WORKSPACE Outdated Show resolved Hide resolved
WORKSPACE Outdated Show resolved Hide resolved
WORKSPACE Show resolved Hide resolved
@BenHenning BenHenning assigned miaboloix and unassigned BenHenning Aug 20, 2020
@miaboloix miaboloix assigned BenHenning and unassigned miaboloix Aug 21, 2020
Copy link
Sponsor Member

@BenHenning BenHenning left a comment

Choose a reason for hiding this comment

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

Thanks @miaboloix!

WORKSPACE Show resolved Hide resolved
@BenHenning BenHenning assigned miaboloix and unassigned BenHenning Aug 21, 2020
@miaboloix miaboloix changed the title Fixes #1678: Optimize Bazel protobuf rules install Fixes #1678: Optimize Bazel protobuf rules install [BLOCKED: #1634] Aug 21, 2020
Base automatically changed from introduce-robolctric-app-tests to develop August 22, 2020 03:57
@miaboloix miaboloix merged commit 3093921 into develop Aug 22, 2020
@miaboloix miaboloix deleted the optimize-protos-install branch August 22, 2020 04:15
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.

Proto rules in WORKSPACE install unnecessary compilers
3 participants