Skip to content
Permalink
Browse files
chore: Update prost, prost-derive and prost-types to 0.10, `ton…
…ic`, and `tonic-build` to `0.7` (#1510)

* chore: Update prost, prost-derive and prost-types to 0.10

* Update tonic requirement from 0.6 to 0.7

Updates the requirements on [tonic](https://github.com/hyperium/tonic) to permit the latest version.
- [Release notes](https://github.com/hyperium/tonic/releases)
- [Changelog](https://github.com/hyperium/tonic/blob/master/CHANGELOG.md)
- [Commits](hyperium/tonic@v0.6.0...v0.7.0)

---
updated-dependencies:
- dependency-name: tonic
  dependency-type: direct:production
...

Signed-off-by: dependabot[bot] <support@github.com>

* Update tonic-build requirement from 0.6 to 0.7

Updates the requirements on [tonic-build](https://github.com/hyperium/tonic) to permit the latest version.
- [Release notes](https://github.com/hyperium/tonic/releases)
- [Changelog](https://github.com/hyperium/tonic/blob/master/CHANGELOG.md)
- [Commits](hyperium/tonic@v0.6.0...v0.7.0)

---
updated-dependencies:
- dependency-name: tonic-build
  dependency-type: direct:production
...

Signed-off-by: dependabot[bot] <support@github.com>

* Update generated code

* Try installing cmake dependencies for flight

* install cmake and protobuf

* Use --experimental_allow_proto3_optional flag

* fix apt-install

* try to install just protobuf compiler

* Add action to configure workspace

* Use prost enabled toolchain

* fixes

* fixups

* fix clippy

Co-authored-by: dependabot[bot] <49699333+dependabot[bot]@users.noreply.github.com>
  • Loading branch information
alamb and dependabot[bot] committed Apr 7, 2022
1 parent b9c4b39 commit c7c7af6a50665ed1f5e06e72916b15893ffced47
Show file tree
Hide file tree
Showing 7 changed files with 532 additions and 465 deletions.
@@ -0,0 +1,39 @@
# Licensed to the Apache Software Foundation (ASF) under one
# or more contributor license agreements. See the NOTICE file
# distributed with this work for additional information
# regarding copyright ownership. The ASF licenses this file
# to you under the Apache License, Version 2.0 (the
# "License"); you may not use this file except in compliance
# with the License. You may obtain a copy of the License at
#
# http://www.apache.org/licenses/LICENSE-2.0
#
# Unless required by applicable law or agreed to in writing,
# software distributed under the License is distributed on an
# "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
# KIND, either express or implied. See the License for the
# specific language governing permissions and limitations
# under the License.

name: Prepare Rust Builder
description: 'Prepare Rust Build Environment'
inputs:
rust-version:
description: 'version of rust to install (e.g. stable)'
required: true
default: 'stable'
runs:
using: "composite"
steps:
- name: Install Build Dependencies
shell: bash
run: |
apt-get update
apt-get install -y protobuf-compiler
- name: Setup Rust toolchain
shell: bash
run: |
echo "Installing ${{ inputs.rust-version }}"
rustup toolchain install ${{ inputs.rust-version }}
rustup default ${{ inputs.rust-version }}
rustup component add rustfmt
@@ -55,11 +55,9 @@ jobs:
path: /github/home/target
key: ${{ runner.os }}-${{ matrix.arch }}-target-cache3-${{ matrix.rust }}-
- name: Setup Rust toolchain
run: |
rustup toolchain install ${{ matrix.rust }}
rustup default ${{ matrix.rust }}
rustup component add rustfmt
uses: ./.github/actions/setup-builder
with:
rust-version: ${{ matrix.rust }}
- name: Build Workspace
run: |
export CARGO_HOME="/github/home/.cargo"
@@ -100,10 +98,9 @@ jobs:
# this key equals the ones on `linux-build-lib` for re-use
key: ${{ runner.os }}-${{ matrix.arch }}-target-cache3-${{ matrix.rust }}
- name: Setup Rust toolchain
run: |
rustup toolchain install ${{ matrix.rust }}
rustup default ${{ matrix.rust }}
rustup component add rustfmt
uses: ./.github/actions/setup-builder
with:
rust-version: ${{ matrix.rust }}
- name: Run tests
run: |
export CARGO_HOME="/github/home/.cargo"
@@ -165,10 +162,9 @@ jobs:
path: /github/home/target
key: ${{ runner.os }}-${{ matrix.arch }}-target-nightly-cache3-${{ matrix.rust }}
- name: Setup Rust toolchain
run: |
rustup toolchain install ${{ matrix.rust }}
rustup default ${{ matrix.rust }}
rustup component add rustfmt
uses: ./.github/actions/setup-builder
with:
rust-version: ${{ matrix.rust }}
- name: Run tests
run: |
export CARGO_HOME="/github/home/.cargo"
@@ -240,9 +236,11 @@ jobs:
# this key equals the ones on `linux-build-lib` for re-use
key: ${{ runner.os }}-${{ matrix.arch }}-target-cache3-${{ matrix.rust }}
- name: Setup Rust toolchain
uses: ./.github/actions/setup-builder
with:
rust-version: ${{ matrix.rust }}
- name: Setup Clippy
run: |
rustup toolchain install ${{ matrix.rust }}
rustup default ${{ matrix.rust }}
rustup component add rustfmt clippy
- name: Run clippy
run: |
@@ -280,10 +278,9 @@ jobs:
# this key equals the ones on `linux-build-lib` for re-use
key: ${{ runner.os }}-${{ matrix.arch }}-target-cache3-${{ matrix.rust }}
- name: Setup Rust toolchain
run: |
rustup toolchain install ${{ matrix.rust }}
rustup default ${{ matrix.rust }}
rustup component add rustfmt clippy
uses: ./.github/actions/setup-builder
with:
rust-version: ${{ matrix.rust }}
- name: Check benchmarks
run: |
export CARGO_HOME="/github/home/.cargo"
@@ -379,7 +376,7 @@ jobs:
with:
path: /github/home/target
key: ${{ runner.os }}-${{ matrix.arch }}-target-wasm32-cache3-${{ matrix.rust }}
- name: Setup Rust toolchain
- name: Setup Rust toolchain for WASM
run: |
rustup toolchain install ${{ matrix.rust }}
rustup override set ${{ matrix.rust }}
@@ -427,10 +424,9 @@ jobs:
path: /github/home/target
key: ${{ runner.os }}-${{ matrix.arch }}-target-nightly-cache3-${{ matrix.rust }}
- name: Setup Rust toolchain
run: |
rustup toolchain install ${{ matrix.rust }}
rustup default ${{ matrix.rust }}
rustup component add rustfmt
uses: ./.github/actions/setup-builder
with:
rust-version: ${{ matrix.rust }}
- name: Run cargo doc
run: |
export CARGO_HOME="/github/home/.cargo"
@@ -467,10 +463,9 @@ jobs:
# this key equals the ones on `linux-build-lib` for re-use
key: ${{ runner.os }}-${{ matrix.arch }}-target-cache3-${{ matrix.rust }}
- name: Setup Rust toolchain
run: |
rustup toolchain install ${{ matrix.rust }}
rustup override set ${{ matrix.rust }}
rustup component add rustfmt
uses: ./.github/actions/setup-builder
with:
rust-version: ${{ matrix.rust }}
- name: Arrow Build with default features
run: |
export CARGO_HOME="/github/home/.cargo"
@@ -29,11 +29,11 @@ license = "Apache-2.0"
[dependencies]
arrow = { path = "../arrow", version = "11.1.0" }
base64 = "0.13"
tonic = "0.6"
tonic = "0.7"
bytes = "1"
prost = "0.9"
prost-types = { version = "0.9.0", optional = true }
prost-derive = "0.9"
prost = "0.10"
prost-types = { version = "0.10.0", optional = true }
prost-derive = "0.10"
tokio = { version = "1.0", features = ["macros", "rt", "rt-multi-thread"] }
futures = { version = "0.3", default-features = false, features = ["alloc"]}

@@ -44,7 +44,7 @@ flight-sql-experimental = ["prost-types"]
[dev-dependencies]

[build-dependencies]
tonic-build = "0.6"
tonic-build = "0.7"
# Pin specific version of the tonic-build dependencies to avoid auto-generated
# (and checked in) arrow.flight.protocol.rs from changing
proc-macro2 = ">1.0.30"
@@ -33,7 +33,14 @@ fn main() -> Result<(), Box<dyn std::error::Error>> {
// avoid rerunning build if the file has not changed
println!("cargo:rerun-if-changed=../format/Flight.proto");

tonic_build::compile_protos("../format/Flight.proto")?;
let proto_dir = Path::new("../format");
let proto_path = Path::new("../format/Flight.proto");

tonic_build::configure()
// protoc in unbuntu builder needs this option
.protoc_arg("--experimental_allow_proto3_optional")
.compile(&[proto_path], &[proto_dir])?;

// read file contents to string
let mut file = OpenOptions::new()
.read(true)
@@ -58,7 +65,14 @@ fn main() -> Result<(), Box<dyn std::error::Error>> {
// avoid rerunning build if the file has not changed
println!("cargo:rerun-if-changed=../format/FlightSql.proto");

tonic_build::compile_protos("../format/FlightSql.proto")?;
let proto_dir = Path::new("../format");
let proto_path = Path::new("../format/FlightSql.proto");

tonic_build::configure()
// protoc in unbuntu builder needs this option
.protoc_arg("--experimental_allow_proto3_optional")
.compile(&[proto_path], &[proto_dir])?;

// read file contents to string
let mut file = OpenOptions::new()
.read(true)

0 comments on commit c7c7af6

Please sign in to comment.