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

building and installing golem-cli from source fails because of outdated protobuf syntax #841

Closed
revosw opened this issue Aug 31, 2024 · 4 comments
Labels

Comments

@revosw
Copy link

revosw commented Aug 31, 2024

Trying to build golem-cli through cargo install as described in the quickstart.

cargo install --features universal golem-cloud-cli

Since I am on ubuntu, I had to do these prerequisites:
0) Update apt repositories

sudo apt update
  1. Install build-essential, OpenSSL, protobuf compiler v3 and pkg-config
sudo apt install build-essential protobuf-compiler libssl-dev pkg-config
  1. Install Rust
curl --proto '=https' --tlsv1.2 -sSf https://sh.rustup.rs | sh
rustup install stable
rustup default stable
  1. Run cargo install to compile golem-cli
cargo install --features universal golem-cloud-cli

cargo install fails on this step:

error: failed to run custom build command for `golem-wasm-ast v1.0.0`

Caused by:
  process didn't exit successfully: `/tmp/cargo-installyHmf5B/release/build/golem-wasm-ast-9b02091be0cf5add/build-script-build` (exit status: 1)
  --- stderr
  Error: Custom { kind: Other, error: "protoc failed: wasm/ast/type.proto:49:12: Explicit 'optional' labels are disallowed in the Proto3 syntax. To define 'optional' fields in Proto3, simply remove the 'optional' label, as fields are 'optional' by default.\nwasm/ast/type.proto:50:12: Explicit 'optional' labels are disallowed in the Proto3 syntax. To define 'optional' fields in Proto3, simply remove the 'optional' label, as fields are 'optional' by default.\nwasm/ast/type.proto:69:12: Explicit 'optional' labels are disallowed in the Proto3 syntax. To define 'optional' fields in Proto3, simply remove the 'optional' label, as fields are 'optional' by default.\n" }
warning: build failed, waiting for other jobs to finish...
error: failed to compile `golem-cloud-cli v1.0.5`, intermediate artifacts can be found at `/tmp/cargo-installyHmf5B`.
To reuse those artifacts with a future compilation, set the environment variable `CARGO_TARGET_DIR` to that path.
@justcoon
Copy link
Contributor

justcoon commented Aug 31, 2024

hello @revosw,
which version of protobuf-compiler do you have?

optional in proto3: https://protobuf.dev/programming-guides/field_presence/#how-to-enable-explicit-presence-in-proto3

if you have such error, probably you have older version of protoc compiler

@revosw
Copy link
Author

revosw commented Aug 31, 2024

I found a discrepancy between Ubuntu 20.04 and Ubuntu 24.04.

For Ubuntu 20.04, the latest version I can install through apt install protobuf-compiler is version 3.6.1

hackathon@User:~$ protoc --version
libprotoc 3.6.1

For Ubuntu 24.04, the latest version I can install through apt install protobuf-compiler is version 3.21.12

hackathon@User:~$ protoc --version
libprotoc 3.21.12

@vigoo
Copy link
Contributor

vigoo commented Sep 1, 2024

See also golemcloud/docs#34

@vigoo vigoo added the cli label Oct 21, 2024
@vigoo
Copy link
Contributor

vigoo commented Dec 6, 2024

Closed in favor of #744

@vigoo vigoo closed this as completed Dec 6, 2024
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Projects
None yet
Development

No branches or pull requests

3 participants