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

v1.0-dev (the current working branch) fails to build from source #1712

Open
coolaj86 opened this issue Feb 23, 2024 · 3 comments
Open

v1.0-dev (the current working branch) fails to build from source #1712

coolaj86 opened this issue Feb 23, 2024 · 3 comments
Labels
bug Something isn't working

Comments

@coolaj86
Copy link

coolaj86 commented Feb 23, 2024

v1.0-dev fails to build from source

This part of the error may be particularly important:

This file contains proto3 optional fields, but --experimental_allow_proto3_optional was not set.

Related: #1535

Expected Behavior

The latest commit on the main working branch should correctly reference working versions of dependencies and build without issues.

Current Behavior

Compiling predicates-tree v1.0.9
error: failed to run custom build command for `tenderdash-proto v0.14.0-dev.6 (https://github.com/dashpay/rs-tenderdash-abci#8b5afe6b)`

Caused by:
  process didn't exit successfully: `/home/app/dash-drive/target/debug/build/tenderdash-proto-d79eced1ac4d88fb/build-script-build` (exit status: 101)
  --- stdout
  [info] => Fetching https://github.com/dashpay/tenderdash at v0.14.0-dev.2 into "/home/app/.cargo/git/checkouts/rs-tenderdash-abci-3da7e285d64883ec/8b5afe6/proto-compiler/../target/tenderdash"
    [info] => Downloading and extracting https://github.com/dashpay/tenderdash/archive/v0.14.0-dev.2.zip into /home/app/.cargo/git/checkouts/rs-tenderdash-abci-3da7e285d64883ec/8b5afe6/proto-compiler/../target/tenderdash
      [info] => Download and extract tenderdash sources, attempt 1/2
        [info] => Downloading https://github.com/dashpay/tenderdash/archive/v0.14.0-dev.2.zip
        [info] => Extracting downloaded archive /home/app/.cargo/git/checkouts/rs-tenderdash-abci-3da7e285d64883ec/8b5afe6/proto-compiler/../target/tenderdash-v0.14.0-dev.2.zip
        [info] => Extracted tenderdash sources to /tmp/.tmpa0Ikms
  [info] => Determining ABCI protocol version.
  [info] => Creating structs.

  --- stderr
  thread 'main' panicked at /home/app/.cargo/git/checkouts/rs-tenderdash-abci-3da7e285d64883ec/8b5afe6/proto-compiler/src/lib.rs:100:55:
  called `Result::unwrap()` on an `Err` value: Custom { kind: Other, error: "protoc failed: tendermint/abci/types.proto: This file contains proto3 optional fields, but --experimental_allow_proto3_optional was not set.\n" }
  note: run with `RUST_BACKTRACE=1` environment variable to display a backtrace
warning: build failed, waiting for other jobs to finish...
error: failed to run custom build command for `tenderdash-proto v0.14.0-dev.6 (https://github.com/dashpay/rs-tenderdash-abci?tag=v0.14.0-dev.6#701ba0fa)`

Caused by:
  process didn't exit successfully: `/home/app/dash-drive/target/debug/build/tenderdash-proto-69deebc203305415/build-script-build` (exit status: 101)
  --- stdout
  [info] => Fetching https://github.com/dashpay/tenderdash at v0.14.0-dev.2 into "/home/app/.cargo/git/checkouts/rs-tenderdash-abci-3da7e285d64883ec/701ba0f/proto-compiler/../target/tenderdash"
    [info] => Downloading and extracting https://github.com/dashpay/tenderdash/archive/v0.14.0-dev.2.zip into /home/app/.cargo/git/checkouts/rs-tenderdash-abci-3da7e285d64883ec/701ba0f/proto-compiler/../target/tenderdash
      [info] => Download and extract tenderdash sources, attempt 1/2
        [info] => Downloading https://github.com/dashpay/tenderdash/archive/v0.14.0-dev.2.zip
        [info] => Extracting downloaded archive /home/app/.cargo/git/checkouts/rs-tenderdash-abci-3da7e285d64883ec/701ba0f/proto-compiler/../target/tenderdash-v0.14.0-dev.2.zip
        [info] => Extracted tenderdash sources to /tmp/.tmp1gLOdt
  [info] => Determining ABCI protocol version.
  [info] => Creating structs.

  --- stderr
  thread 'main' panicked at /home/app/.cargo/git/checkouts/rs-tenderdash-abci-3da7e285d64883ec/701ba0f/proto-compiler/src/lib.rs:100:55:
  called `Result::unwrap()` on an `Err` value: Custom { kind: Other, error: "protoc failed: tendermint/abci/types.proto: This file contains proto3 optional fields, but --experimental_allow_proto3_optional was not set.\n" }
  note: run with `RUST_BACKTRACE=1` environment variable to display a backtrace
    Building [======================>  ] 510/554: librocksdb-sys(build)

Possible Solution

Not sure.

I suspect that the either the generated protobuf file was not committed (and is not being generated during the build), or the dependency is linked to the wrong verison.

Steps to Reproduce (for bugs)

Taken from #1696

  1. Install Build Dependencies
    sudo apt update
    sudo apt install -y \
        build-essential \
        clang \
        cmake
    sudo apt install -y \
        protobuf-compiler
    curl https://webi.sh/rust | sh
    source ~/.config/envman/PATH.env
  2. Clone Source (latest commit only)
    IMPORTANT
    Check https://github.com/dashpay/platform to see whether it's actually master or something else, like v1.0-dev, that's the current working "main" branch.
    git clone --depth 1 --single-branch --branch 'v1.0-dev' \
        https://github.com/dashpay/platform.git \
        ./dash-drive/
  3. Build from Source \
    pushd ./dash-drive/packages/rs-drive-abci/
    
    cargo build
    ls -lAhF ../target/debug/drive-abci
    
    cargo build --release
    ls -lAhF ../target/release/drive-abci
    
    popd

Context

Just trying to build the binaries in the simplest way possible (fewest layers of abstraction, most direct from source on a Linux system).

Your Environment

cat /etc/issue
Ubuntu 22.04 LTS \n \l
uname -srm
Linux 5.15.131-2-pve x86_64
@coolaj86 coolaj86 added the bug Something isn't working label Feb 23, 2024
@coolaj86
Copy link
Author

It looks like rerunning the build gives a different, perhaps more informative set of errors:

error: failed to run custom build command for `dapi-grpc v1.0.0-dev.5 (/home/app/dash-drive_v1.0-dev_2024-02-22/packages/dapi-grpc)`

Caused by:
  process didn't exit successfully: `/home/app/dash-drive_v1.0-dev_2024-02-22/target/debug/build/dapi-grpc-3c70640056dd9fe0/build-script-build` (exit status: 101)
  --- stdout
  cargo:rerun-if-changed=/home/app/dash-drive/packages/dapi-grpc/protos/core/v0/core.proto
  cargo:rerun-if-changed=/home/app/dash-drive/packages/dapi-grpc/protos

  --- stderr
  thread 'main' panicked at packages/dapi-grpc/build.rs:15:10:
  generate core proto: Custom { kind: Other, error: "protoc failed: Could not make proto path relative: /home/app/dash-drive/packages/dapi-grpc/protos/core/v0/core.proto: No such file or directory\n" }
  note: run with `RUST_BACKTRACE=1` environment variable to display a backtrace
warning: build failed, waiting for other jobs to finish...
error: failed to run custom build command for `tenderdash-proto v0.14.0-dev.6 (https://github.com/dashpay/rs-tenderdash-abci#8b5afe6b)`

Caused by:
  process didn't exit successfully: `/home/app/dash-drive_v1.0-dev_2024-02-22/target/debug/build/tenderdash-proto-d79eced1ac4d88fb/build-script-build` (exit status: 101)
  --- stdout
  [info] => Fetching https://github.com/dashpay/tenderdash at v0.14.0-dev.2 into "/home/app/.cargo/git/checkouts/rs-tenderdash-abci-3da7e285d64883ec/8b5afe6/proto-compiler/../target/tenderdash"
    [info] => Downloading and extracting https://github.com/dashpay/tenderdash/archive/v0.14.0-dev.2.zip into /home/app/.cargo/git/checkouts/rs-tenderdash-abci-3da7e285d64883ec/8b5afe6/proto-compiler/../target/tenderdash
      [info] => Download and extract tenderdash sources, attempt 1/2
        [info] => Archive file /home/app/.cargo/git/checkouts/rs-tenderdash-abci-3da7e285d64883ec/8b5afe6/proto-compiler/../target/tenderdash-v0.14.0-dev.2.zip already exists, skipping download
        [info] => Extracting downloaded archive /home/app/.cargo/git/checkouts/rs-tenderdash-abci-3da7e285d64883ec/8b5afe6/proto-compiler/../target/tenderdash-v0.14.0-dev.2.zip
        [info] => Extracted tenderdash sources to /tmp/.tmpfVJZvs
  [info] => Determining ABCI protocol version.
  [info] => Creating structs.

  --- stderr
  thread 'main' panicked at /home/app/.cargo/git/checkouts/rs-tenderdash-abci-3da7e285d64883ec/8b5afe6/proto-compiler/src/lib.rs:100:55:
  called `Result::unwrap()` on an `Err` value: Custom { kind: Other, error: "protoc failed: tendermint/abci/types.proto: This file contains proto3 optional fields, but --experimental_allow_proto3_optional was not set.\n" }
  note: run with `RUST_BACKTRACE=1` environment variable to display a backtrace
error: failed to run custom build command for `tenderdash-proto v0.14.0-dev.6 (https://github.com/dashpay/rs-tenderdash-abci?tag=v0.14.0-dev.6#701ba0fa)`

Caused by:
  process didn't exit successfully: `/home/app/dash-drive_v1.0-dev_2024-02-22/target/debug/build/tenderdash-proto-69deebc203305415/build-script-build` (exit status: 101)
  --- stdout
  [info] => Fetching https://github.com/dashpay/tenderdash at v0.14.0-dev.2 into "/home/app/.cargo/git/checkouts/rs-tenderdash-abci-3da7e285d64883ec/701ba0f/proto-compiler/../target/tenderdash"
    [info] => Downloading and extracting https://github.com/dashpay/tenderdash/archive/v0.14.0-dev.2.zip into /home/app/.cargo/git/checkouts/rs-tenderdash-abci-3da7e285d64883ec/701ba0f/proto-compiler/../target/tenderdash
      [info] => Download and extract tenderdash sources, attempt 1/2
        [info] => Archive file /home/app/.cargo/git/checkouts/rs-tenderdash-abci-3da7e285d64883ec/701ba0f/proto-compiler/../target/tenderdash-v0.14.0-dev.2.zip already exists, skipping download
        [info] => Extracting downloaded archive /home/app/.cargo/git/checkouts/rs-tenderdash-abci-3da7e285d64883ec/701ba0f/proto-compiler/../target/tenderdash-v0.14.0-dev.2.zip
        [info] => Extracted tenderdash sources to /tmp/.tmpqBhy0Q
  [info] => Determining ABCI protocol version.
  [info] => Creating structs.

  --- stderr
  thread 'main' panicked at /home/app/.cargo/git/checkouts/rs-tenderdash-abci-3da7e285d64883ec/701ba0f/proto-compiler/src/lib.rs:100:55:
  called `Result::unwrap()` on an `Err` value: Custom { kind: Other, error: "protoc failed: tendermint/abci/types.proto: This file contains proto3 optional fields, but --experimental_allow_proto3_optional was not set.\n" }
  note: run with `RUST_BACKTRACE=1` environment variable to display a backtrace

@pshenmic
Copy link
Collaborator

pshenmic commented Feb 23, 2024

Reading your comments at #1696, have you been able to accomplish to build drive after all? It seems there are no issues for me:

pshenmic@Mikhails-MacBook-Pro rs-drive-abci % cargo build                        
warning: `drive-abci` (lib) generated 72 warnings (run `cargo fix --lib -p drive-abci` to apply 58 suggestions)
    Finished dev [unoptimized + debuginfo] target(s) in 3m 12s
pshenmic@Mikhails-MacBook-Pro rs-drive-abci % ls -lAhF ../../target/debug/drive-abci
-rwxr-xr-x  1 pshenmic  staff   113M Feb 23 13:34 ../../target/debug/drive-abci*
pshenmic@Mikhails-MacBook-Pro rs-drive-abci % ../../target/debug/drive-abci --version
drive-abci 1.0.0-dev.5

But probably I may have different versions of the toolsets

@coolaj86
Copy link
Author

coolaj86 commented Feb 23, 2024

@pshenmic Yeah. We'll need to add specific versions for protoc and llvm to the docs because LTS is out of date and doesn't work.

I'm not sure what the minimum versions are, but the current latest on GitHub Releases work:

  • protoc v25.3
    protoc --version
    libprotoc 25.3
    
  • clang v17.0.6
    clang --version
    clang version 17.0.6 (https://github.com/llvm/llvm-project 6009708b4367171ccdbf4b5905cb6a803753fe18)
    Target: x86_64-unknown-linux-gnu
    Thread model: posix
    InstalledDir: /home/app/.local/opt/clang+llvm/bin
    

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug Something isn't working
Projects
None yet
Development

No branches or pull requests

2 participants