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

Refactor proto-compiler as a proper CLI app #365

Merged
merged 8 commits into from
Nov 5, 2020
Merged

Conversation

romac
Copy link
Member

@romac romac commented Nov 5, 2020

Closes: cosmos/ibc-proto-rs#17

Description

  • Refactor the proto-compiler crate into a proper CLI app
  • Allow specifying the commit of the Cosmos SDK to check out
  • Expose the version (commit hash) of the SDK used when generating the proto library as a constant.

Screen Shot 2020-11-05 at 19 08 00

ibc-proto-compiler

Usage: ibc-proto-compiler <command> [<args>]

App

Options:
  --help            display usage information

Commands:
  clone-sdk         Clone
  compile           Compile

ibc-proto-compiler clone-sdk

Usage: ibc-proto-compiler clone-sdk [-c <commit>] -o <path>

Clone

Options:
  -c, --commit      commit to checkout
  -o, --path        where to checkout the repository
  --help            display usage information

ibc-proto-compiler compile

Usage: ibc-proto-compiler compile -s <sdk> -o <out>

Compile

Options:
  -s, --sdk         path to the Cosmos SDK
  -o, --out         path to output the generated Rust sources into
  --help            display usage information

For contributor use:

  • Updated the Unreleased section of CHANGELOG.md with the issue.
  • If applicable: Unit tests written, added test to CI.
  • Linked to Github issue with discussion and accepted design OR link to spec that describes this work.
  • Updated relevant documentation (docs/) and code comments.
  • Re-reviewed Files changed in the Github PR explorer.

@romac romac requested a review from ancazamfir as a code owner November 5, 2020 17:27
@romac romac requested a review from greg-szabo November 5, 2020 17:27
@romac romac marked this pull request as draft November 5, 2020 17:36
@romac romac marked this pull request as ready for review November 5, 2020 17:47
@informalsystems informalsystems deleted a comment from codecov-io Nov 5, 2020
Copy link
Collaborator

@ancazamfir ancazamfir left a comment

Choose a reason for hiding this comment

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

Looks great! Thanks Romain!

@ancazamfir
Copy link
Collaborator

ancazamfir commented Nov 5, 2020

Great UX :)
It would be nice to also have the [-t <tag>] option for clone-sdk so we can point to tags/ releases. I hope commit hashes become an exception.

@ancazamfir
Copy link
Collaborator

Great UX :)
It would be nice to also have the [-t <tag>] option for clone-sdk so we can point to tags/ releases. I hope commit hashes become an exception.

Actually, the cosmos-sdk for stargate-4 is at v0.40.0-rc0. But we can lookup the commit for now and merge this as this.

@romac
Copy link
Member Author

romac commented Nov 5, 2020

It would be nice to also have the [-t ] option for clone-sdk so we can point to tags/ releases. I hope commit hashes become an exception.

Agreed! Let's do that in a follow-up PR so that we unblock #361 already.

@romac romac merged commit dc41a0c into master Nov 5, 2020
@romac romac deleted the romac/pin-protos branch November 5, 2020 19:01
hu55a1n1 pushed a commit to hu55a1n1/hermes that referenced this pull request Sep 13, 2022
* Refactor proto-compiler into a proper CLI app

* Allow specifying the commit to checkout the SDK at

* Do a proper checkout of the given commit

* Update README

* Emit Cosmos SDK version (commit hash) to a file and expose it in the lib

* Change SDK version to <unknown> for now

* Update changelog
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