apache / datafusion

Apache DataFusion SQL Query Engine
https://datafusion.apache.org/
Apache License 2.0
6.37k stars 1.2k forks source link

Cannot build in ubuntu 22.04 #13391

Closed waynexia closed 1 week ago

waynexia commented 1 week ago

Describe the bug

cargo clippy --workspace gives this error:

error: failed to run custom build command for `substrait v0.47.2`

Caused by:
  process didn't exit successfully: `/data/arrow-datafusion/target/debug/build/substrait-937ed85a0c6c1eba/build-script-build` (exit status: 1)
  --- stdout
  cargo:rerun-if-env-changed=FORCE_REBUILD
  cargo:rerun-if-changed=substrait
  cargo:rerun-if-changed=substrait/text/simple_extensions_schema.yaml
  cargo:rerun-if-changed=substrait/proto/substrait/algebra.proto
  cargo:rerun-if-changed=substrait/proto/substrait/capabilities.proto
  cargo:rerun-if-changed=substrait/proto/substrait/extended_expression.proto
  cargo:rerun-if-changed=substrait/proto/substrait/extensions/extensions.proto
  cargo:rerun-if-changed=substrait/proto/substrait/function.proto
  cargo:rerun-if-changed=substrait/proto/substrait/parameterized_types.proto
  cargo:rerun-if-changed=substrait/proto/substrait/plan.proto
  cargo:rerun-if-changed=substrait/proto/substrait/type.proto
  cargo:rerun-if-changed=substrait/proto/substrait/type_expressions.proto

  --- stderr
  Error: Custom { kind: Other, error: "protoc failed: substrait/algebra.proto: This file contains proto3 optional fields, but --experimental_allow_proto3_optional was not set.\n" }

To Reproduce

cargo clippy --workspace

Expected behavior

Build successfully

Additional context

protoc libprotoc 3.12.4 rustc stable rustc 1.82.0 OS Ubuntu 22.04.5 LTS x86_64

waynexia commented 1 week ago

I don't have this issue on my arch linux with libprotoc 28.2. This is likely caused by the optional keyword in proto, which as I remember requires protoc version > 3.15.

This is not a typical bug. One possible solution is stating somewhere to require our user to use protoc > 3.15 as well.

Omega359 commented 1 week ago

It is documented: https://datafusion.apache.org/contributor-guide/getting_started.html#protoc-installation

waynexia commented 1 week ago

That's great 😃 thanks for your information