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

build tag to exclude mainnet genesis from prysmctl #12244

Merged
merged 3 commits into from
Apr 6, 2023

Conversation

kasey
Copy link
Contributor

@kasey kasey commented Apr 6, 2023

What type of PR is this?

Feature

What does this PR do? Why is it needed?

This is one small step to reducing the binary size of prysmctl. We'll get much bigger benefits from excluding validator web ui data, but since those are generated files it will take some more work to figure out how to accomplish that through bazel.

@kasey kasey requested a review from a team as a code owner April 6, 2023 00:56
Copy link
Member

@prestonvanloon prestonvanloon left a comment

Choose a reason for hiding this comment

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

Tested this locally

Before: 65334646 bytes
After: 65336792 bytes

Appears to be larger somehow. Did it work for you with bazel?

@kasey
Copy link
Contributor Author

kasey commented Apr 6, 2023

@prestonvanloon

Tested this locally

Before: 65334646 bytes After: 65336792 bytes

Appears to be larger somehow. Did it work for you with bazel?

[kasey@poblano prysm]$ grep noMainnet cmd/prysmctl/BUILD.bazel 
    #gotags = ["noMainnetGenesis"],
[kasey@poblano prysm]$ bazel build //cmd/prysmctl
DEBUG: /opt/bazel/_bazel_kasey/e28cd52451c4ead1ba09bfd91293b70f/external/io_bazel_rules_go/extras/embed_data.bzl:43:10: Embedding is now better handled by using rules_go's built-in embedding functionality (https://github.com/bazelbuild/rules_go/blob/master/docs/go/core/rules.md#go_library-embedsrcs). The `go_embed_data` rule is deprecated and will be removed in rules_go version 0.39.
INFO: Analyzed target //cmd/prysmctl:prysmctl (926 packages loaded, 19133 targets configured).
INFO: Found 1 target...
Target //cmd/prysmctl:prysmctl up-to-date:
  bazel-bin/cmd/prysmctl/prysmctl_/prysmctl
INFO: Elapsed time: 7.211s, Critical Path: 2.46s
INFO: 3 processes: 1 internal, 2 linux-sandbox.
INFO: Build completed successfully, 3 total actions
[kasey@poblano prysm]$ ls -al bazel-bin/cmd/prysmctl/prysmctl_/prysmctl
-r-xr-xr-x 1 kasey kasey 67144200 Apr  6 10:15 bazel-bin/cmd/prysmctl/prysmctl_/prysmctl
[kasey@poblano prysm]$ grep noMainnet cmd/prysmctl/BUILD.bazel 
    gotags = ["noMainnetGenesis"],
[kasey@poblano prysm]$ bazel build //cmd/prysmctl
DEBUG: /opt/bazel/_bazel_kasey/e28cd52451c4ead1ba09bfd91293b70f/external/io_bazel_rules_go/extras/embed_data.bzl:43:10: Embedding is now better handled by using rules_go's built-in embedding functionality (https://github.com/bazelbuild/rules_go/blob/master/docs/go/core/rules.md#go_library-embedsrcs). The `go_embed_data` rule is deprecated and will be removed in rules_go version 0.39.
INFO: Analyzed target //cmd/prysmctl:prysmctl (1 packages loaded, 5073 targets configured).
INFO: Found 1 target...
Target //cmd/prysmctl:prysmctl up-to-date:
  bazel-bin/cmd/prysmctl/prysmctl_/prysmctl
INFO: Elapsed time: 3.834s, Critical Path: 2.22s
INFO: 3 processes: 1 internal, 2 linux-sandbox.
INFO: Build completed successfully, 3 total actions
[kasey@poblano prysm]$ ls -al bazel-bin/cmd/prysmctl/prysmctl_/prysmctl
-r-xr-xr-x 1 kasey kasey 65336099 Apr  6 10:16 bazel-bin/cmd/prysmctl/prysmctl_/prysmct

Copy link
Member

@prestonvanloon prestonvanloon left a comment

Choose a reason for hiding this comment

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

Not sure what my issues were locally. I believe that your changes would work. Looks good to me

@prylabs-bulldozer prylabs-bulldozer bot merged commit f4307a9 into develop Apr 6, 2023
@delete-merged-branch delete-merged-branch bot deleted the lil-prysmctl branch April 6, 2023 19:45
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.

3 participants