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

panic "git exited with error code: Some(128)" #153

Closed
cyberbono3 opened this issue Nov 4, 2021 · 8 comments
Closed

panic "git exited with error code: Some(128)" #153

cyberbono3 opened this issue Nov 4, 2021 · 8 comments

Comments

@cyberbono3
Copy link

Hello,

I was able to build repo successfully.
Can you assist me to fix a panic ?

cargo run
    Blocking waiting for file lock on build directory
    Finished dev [unoptimized + debuginfo] target(s) in 3.83s
     Running `target/debug/proto-build`
[info] Updating cosmos/cosmos-sdk submodule...
fatal: cannot change to '../cosmos-sdk-go': No such file or directory
thread 'main' panicked at 'git exited with error code: Some(128)', proto-build/src/main.rs:134:9
note: run with `RUST_BACKTRACE=1` environment variable to display a backtrace

proto-build/src/main.rs:134:9

 if !exit_status.success() {
        panic!("git exited with error code: {:?}", exit_status.code());
    }

rustc 1.56.0 (09c42c458 2021-10-18)

@cyberbono3 cyberbono3 changed the title panic "git exited with error code: Some(128)" #152 panic "git exited with error code: Some(128)" Nov 4, 2021
@tony-iqlusion
Copy link
Member

It looks like #138 added -C arguments to git to change the directory without first checking that those directories exist /cc @ChristianBorst

The solution is to create the respective directoires for cosmos-sdk-go, ibc-go, and wasmd if they don't already exist.

@cyberbono3
Copy link
Author

@tony-iqlusion Thanks for prompt response. I have deleted these 3 directories and recreated them in repo . Additionally, I have set the proper rights. The problem still exists. I would be grateful for tips how to fix it.

cargo run
    Blocking waiting for file lock on build directory
    Finished dev [unoptimized + debuginfo] target(s) in 43.67s
     Running `target/debug/proto-build`
[info] Updating cosmos/cosmos-sdk submodule...
Submodule 'cosmos-sdk' (https://github.com/cosmos/cosmos-sdk.git) registered for path 'cosmos-sdk-go'
Submodule 'ibc-go' (https://github.com/cosmos/ibc-go) registered for path 'ibc-go'
Submodule 'wasmd' (https://github.com/CosmWasm/wasmd.git) registered for path 'wasmd'
Cloning into '/home/ai/go/src/github.com/cosmos-rust/cosmos-sdk-go'...
Cloning into '/home/ai/go/src/github.com/cosmos-rust/ibc-go'...
Cloning into '/home/ai/go/src/github.com/cosmos-rust/wasmd'...
Submodule path 'cosmos-sdk-go': checked out '8a73b266f52e08f24738c93ef519b529cd35bbd8'
Submodule path 'ibc-go': checked out 'cea013a4a6fdcc970e06665b858a79d14db6eca9'
Submodule path 'wasmd': checked out 'd2e35c249e39e90c5a85e03e0b75800431612b20'
fatal: cannot change to '../cosmos-sdk-go': No such file or directory
thread 'main' panicked at 'git exited with error code: Some(128)', proto-build/src/main.rs:134:9
note: run with `RUST_BACKTRACE=1` environment variable to display a backtrace
ai@ai-ThinkPad-T450:~/go/src/github.com/cosmos-rust$ 

@tony-iqlusion
Copy link
Member

Oh, perhaps the problem is you're doing cargo run from outside the prost-build/ directory. It's pretty brittle right now and perhaps we should switch to something like cargo-xtask as the driver.

But yes, anyway, cd prost-build before doing cargo run.

@cyberbono3
Copy link
Author

cyberbono3 commented Nov 5, 2021

Thanks for your tip.

ai@ai-ThinkPad-T450:~/go/src/github.com/cosmos-rust/proto-build$ cargo run
   Compiling proto-build v0.1.0 (/home/ai/go/src/github.com/cosmos-rust/proto-build)
    Finished dev [unoptimized + debuginfo] target(s) in 2.77s
     Running `/home/ai/go/src/github.com/cosmos-rust/target/debug/proto-build`
[info] Updating cosmos/cosmos-sdk submodule...
HEAD is now at 8a73b266f chore: v0.44.1 release notes and changelog (#10261)
[info] Updating cosmos/ibc-go submodule...
HEAD is now at d059913 backport #344, #372, #375, #386  (#388)
[info] Updating wasmd submodule...
Submodule path '../ibc-go': checked out 'cea013a4a6fdcc970e06665b858a79d14db6eca9'
HEAD is now at d2e35c2 Merge pull request #521 from CosmWasm/changelog_v0.17
[info] Compiling cosmos-sdk .proto files to Rust into '/tmp/tmp-protobuf/'...
[info] Compiling proto definitions and clients for GRPC services!
[info] => Done!
[info] Compiling .proto files to Rust into '/tmp/tmp-protobuf/'...
[info] Compiling proto definitions and clients for GRPC services!
[info] => Done!
[info] Compiling .proto files to Rust into '/tmp/tmp-protobuf/'...
[info] Compiling wasmd proto clients for GRPC services!
[info] => Done!
[info] Copying generated files into '../cosmos-sdk-proto/src/prost/'...

and then execute cargo run from root directory. Does it sound good to you?

ai@ai-ThinkPad-T450:~/go/src/github.com/cosmos-rust$ cargo run
   Compiling cosmos-sdk-proto v0.8.0 (/home/ai/go/src/github.com/cosmos-rust/cosmos-sdk-proto)
error[E0428]: the name `Validators` is defined multiple times
   --> cosmos-sdk-proto/src/prost/cosmos.staking.v1beta1.rs:355:5
    |
349 |     pub struct Validators {
    |     --------------------- previous definition of the type `Validators` here
...
355 |     pub enum Validators {
    |     ^^^^^^^^^^^^^^^^^^^ `Validators` redefined here
    |
    = note: `Validators` must be defined only once in the type namespace of this module

error[E0119]: conflicting implementations of trait `std::clone::Clone` for type `cosmos::staking::v1beta1::stake_authorization::Validators`
   --> cosmos-sdk-proto/src/prost/cosmos.staking.v1beta1.rs:354:14
    |
348 |     #[derive(Clone, PartialEq, ::prost::Message)]
    |              ----- first implementation here
...
354 |     #[derive(Clone, PartialEq, ::prost::Oneof)]
    |              ^^^^^ conflicting implementation for `cosmos::staking::v1beta1::stake_authorization::Validators`
    |
    = note: this error originates in the derive macro `Clone` (in Nightly builds, run with -Z macro-backtrace for more info)

error[E0119]: conflicting implementations of trait `std::cmp::PartialEq` for type `cosmos::staking::v1beta1::stake_authorization::Validators`
   --> cosmos-sdk-proto/src/prost/cosmos.staking.v1beta1.rs:354:21
    |
348 |     #[derive(Clone, PartialEq, ::prost::Message)]
    |                     --------- first implementation here
...
354 |     #[derive(Clone, PartialEq, ::prost::Oneof)]
    |                     ^^^^^^^^^ conflicting implementation for `cosmos::staking::v1beta1::stake_authorization::Validators`
    |
    = note: this error originates in the derive macro `PartialEq` (in Nightly builds, run with -Z macro-backtrace for more info)

error[E0119]: conflicting implementations of trait `std::marker::StructuralPartialEq` for type `cosmos::staking::v1beta1::stake_authorization::Validators`
   --> cosmos-sdk-proto/src/prost/cosmos.staking.v1beta1.rs:354:21
    |
348 |     #[derive(Clone, PartialEq, ::prost::Message)]
    |                     --------- first implementation here
...
354 |     #[derive(Clone, PartialEq, ::prost::Oneof)]
    |                     ^^^^^^^^^ conflicting implementation for `cosmos::staking::v1beta1::stake_authorization::Validators`
    |
    = note: this error originates in the derive macro `PartialEq` (in Nightly builds, run with -Z macro-backtrace for more info)

error[E0119]: conflicting implementations of trait `std::fmt::Debug` for type `cosmos::staking::v1beta1::stake_authorization::Validators`
   --> cosmos-sdk-proto/src/prost/cosmos.staking.v1beta1.rs:354:32
    |
348 |     #[derive(Clone, PartialEq, ::prost::Message)]
    |                                ---------------- first implementation here
...
354 |     #[derive(Clone, PartialEq, ::prost::Oneof)]
    |                                ^^^^^^^^^^^^^^ conflicting implementation for `cosmos::staking::v1beta1::stake_authorization::Validators`
    |
    = note: this error originates in the derive macro `::prost::Oneof` (in Nightly builds, run with -Z macro-backtrace for more info)

Some errors have detailed explanations: E0119, E0428.
For more information about an error, try `rustc --explain E0119`.
error: could not compile `cosmos-sdk-proto` due to 5 previous errors

@tony-iqlusion
Copy link
Member

Yes, there's currently an issue with the name of that proto which requires hand-editing the result. Unfortunately we don't have an open tracking issue for that.

@cyberbono3
Copy link
Author

Do you plan to resolve this issue in the near future?

@tony-iqlusion
Copy link
Member

I believe there is an upstream ticket to fix this in the cosmos-sdk proper /cc @jkilpatr @ChristianBorst

@tony-iqlusion
Copy link
Member

I opened #154 to track the clashing Validator struct/enum names in the generated protos.

Otherwise I don't think there's anything else to do here, other than possibly migrating proto-build to something like cargo xtask to make it easier to use.

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

No branches or pull requests

2 participants