Skip to content

chore(hermes): Remove git from build, vendor WH & Google protos #2097

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

Merged
merged 4 commits into from
Nov 6, 2024

Conversation

tejasbadadare
Copy link
Contributor

@tejasbadadare tejasbadadare commented Nov 5, 2024

The Hermes build.rs currently pulls the wormhole and googleapis git repositories in order to get the WH protobuf definitions. (The WH protos depend on googleapi protos, so those are downloaded as well.)

Aside from a slow build, this causes some issues with LSP. TLDR: The build doesn't clean up the .git lock which breaks incremental builds, since subsequent builds fail to git init. On my machine, this manifests as cargo watch and rust-analyzer not working since they continuously and incrementally build.

Talking to @ali-bahjati , we concluded that vendoring in the required protobufs is preferable to constantly downloading them from git, which is what this PR does.

Both repos are Apache 2.0 licensed (as are we) so we should be good to include them directly.
The build is much faster now :)

Notes:

  • Not all google protos from the repo are included, just the ones specified in service.proto. This works fine as the WH protos only depend on a select few google ones.
  • Added the protos dir to the precommit exclusions and cleaned up the regex

Copy link

vercel bot commented Nov 5, 2024

The latest updates on your projects. Learn more about Vercel for Git ↗︎

Name Status Preview Comments Updated (UTC)
api-reference ✅ Ready (Inspect) Visit Preview 💬 Add feedback Nov 6, 2024 6:29pm
proposals ✅ Ready (Inspect) Visit Preview 💬 Add feedback Nov 6, 2024 6:29pm
staking ✅ Ready (Inspect) Visit Preview 💬 Add feedback Nov 6, 2024 6:29pm
2 Skipped Deployments
Name Status Preview Comments Updated (UTC)
component-library ⬜️ Ignored (Inspect) Visit Preview Nov 6, 2024 6:29pm
insights ⬜️ Ignored (Inspect) Visit Preview Nov 6, 2024 6:29pm

@tejasbadadare tejasbadadare requested review from ali-behjati and cprussin and removed request for ali-behjati November 5, 2024 23:23
Comment on lines +13 to +14
To be honest, we probably open sourced way too much of this (basically by
accident). There are a couple files in here you are most likely to be
Copy link
Contributor Author

Choose a reason for hiding this comment

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

lmaoo

@@ -7,4 +7,6 @@ src/network/p2p.proto
tools/

# Ignore Wormhole cloned repo
# (Legacy -- we no longer clone the Wormhole repo, the proto files are included in this project under `proto/vendor`.
Copy link
Collaborator

Choose a reason for hiding this comment

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

let's remove it entirely.

(?x)^(
target_chains/sui/vendor/|
patches/|
apps/hermes/server/proto/
Copy link
Collaborator

Choose a reason for hiding this comment

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

probably make it /proto/vendor

@tejasbadadare tejasbadadare merged commit d3cc7df into main Nov 6, 2024
3 of 8 checks passed
@tejasbadadare tejasbadadare deleted the tb/hermes/remove_git_from_build branch November 6, 2024 18:14
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.

2 participants