substrait-io / substrait-validator

Apache License 2.0
8 stars 8 forks source link

build: update dependencies #282

Closed wackywendell closed 4 weeks ago

wackywendell commented 1 month ago

This PR updates the prost{-*}, pyo3, and cbindgen dependencies. pyo3 in particular was causing a build error in other PRs. This PR should now pass all CI.

Notes

In addition to updating the dependency versions and the code that calls it where necessary, I also found that protoc was missing in a number of CI jobs where it seemed to be needed. I'm not sure how this worked before; my best guess was that the generated code was cached and carried over, and updating prost changed that.

Build Error

in particular, this is intended to fix this error:

error: failed to run custom build command for `pyo3-ffi v0.21.2`

Caused by:
  process didn't exit successfully: `/Users/runner/work/substrait-validator/substrait-validator/target/debug/build/pyo3-ffi-77caf4a9541fc18e/build-script-build` (exit status: 1)
  --- stdout
  cargo:rerun-if-env-changed=PYO3_CROSS
  cargo:rerun-if-env-changed=PYO3_CROSS_LIB_DIR
  cargo:rerun-if-env-changed=PYO3_CROSS_PYTHON_VERSION
  cargo:rerun-if-env-changed=PYO3_CROSS_PYTHON_IMPLEMENTATION
  cargo:rerun-if-env-changed=PYO3_PRINT_CONFIG
  cargo:rerun-if-env-changed=PYO3_USE_ABI3_FORWARD_COMPATIBILITY

  --- stderr
  error: the configured Python interpreter version (3.13) is newer than PyO3's maximum supported version (3.12)
  = help: please check if an updated version of PyO3 is available. Current version: 0.21.2
  = help: set PYO3_USE_ABI3_FORWARD_COMPATIBILITY=1 to suppress this check and build anyway using the stable ABI
warning: build failed, waiting for other jobs to finish...
wackywendell commented 1 month ago

Ah! I just found a comment explaining why the protoc behavior changed:

In order to rely on as few external dependencies as possible, all protoc invocations by the various parts of the build invoke the protoc executable as found/compiled and exposed by prost-build. That is: this protoc is also abused to generate Python bindings. Unfortunately, prost-build is planning to remove the build logic for protoc at the time of writing (and who can blame them), so this will need to be done differently in the future.

Well, I'm doing it here! I'll add a commit updating that comment.