From 7480fe7196daff41c446f2379d954fa3670fc84e Mon Sep 17 00:00:00 2001 From: Alex Qyoun-ae <4062971+mazterqyou@users.noreply.github.com> Date: Thu, 3 Nov 2022 19:07:30 +0300 Subject: [PATCH] [WIP minimize me, bump to modern compiler, fix related to that issues] ci: Fix issues, lock Rust toolchain --- .github/workflows/miri.sh | 26 ---------- .github/workflows/miri.yaml | 47 ------------------- arrow-flight/src/arrow.flight.protocol.rs | 32 ++++++------- .../src/sql/arrow.flight.protocol.sql.rs | 36 +++++++------- dev/release/rat_exclude_files.txt | 1 + rust-toolchain | 1 + 6 files changed, 36 insertions(+), 107 deletions(-) delete mode 100755 .github/workflows/miri.sh delete mode 100644 .github/workflows/miri.yaml create mode 100644 rust-toolchain diff --git a/.github/workflows/miri.sh b/.github/workflows/miri.sh deleted file mode 100755 index 27c6f5eecc87..000000000000 --- a/.github/workflows/miri.sh +++ /dev/null @@ -1,26 +0,0 @@ -#!/bin/bash -# -# Script -# -# Must be run with nightly rust for example -# rustup default nightly - - -export MIRIFLAGS="-Zmiri-disable-isolation" -cargo miri setup -cargo clean - -run_miri() { - # Currently only the arrow crate is tested with miri - # IO related tests and some unsupported tests are skipped - cargo miri test -p arrow -- --skip csv --skip ipc --skip json -} - -# If MIRI fails, automatically retry -# Seems like miri is occasionally killed by the github runner -# https://github.com/apache/arrow-rs/issues/879 -for i in `seq 1 5`; do - echo "Starting Arrow MIRI run..." - run_miri && break - echo "foo" > /tmp/data.txt -done diff --git a/.github/workflows/miri.yaml b/.github/workflows/miri.yaml deleted file mode 100644 index 73dfc0092836..000000000000 --- a/.github/workflows/miri.yaml +++ /dev/null @@ -1,47 +0,0 @@ -# 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: Rust - -on: - # always trigger - push: - pull_request: - -jobs: - miri-checks: - name: MIRI - runs-on: ubuntu-latest - strategy: - matrix: - arch: [amd64] - rust: [nightly-2022-01-17] - steps: - - uses: actions/checkout@v2 - with: - submodules: true - - name: Setup Rust toolchain - run: | - rustup toolchain install ${{ matrix.rust }} - rustup default ${{ matrix.rust }} - rustup component add rustfmt clippy miri - - name: Run Miri Checks - env: - RUST_BACKTRACE: full - RUST_LOG: "trace" - run: | - bash .github/workflows/miri.sh diff --git a/arrow-flight/src/arrow.flight.protocol.rs b/arrow-flight/src/arrow.flight.protocol.rs index 3ee5e40d4cca..bbca033fda3b 100644 --- a/arrow-flight/src/arrow.flight.protocol.rs +++ b/arrow-flight/src/arrow.flight.protocol.rs @@ -2,7 +2,7 @@ /// /// The request that a client provides to a server on handshake. -#[derive(Clone, PartialEq, Eq, ::prost::Message)] +#[derive(Clone, PartialEq, ::prost::Message)] pub struct HandshakeRequest { /// /// A defined protocol version @@ -13,7 +13,7 @@ pub struct HandshakeRequest { #[prost(bytes="vec", tag="2")] pub payload: ::prost::alloc::vec::Vec, } -#[derive(Clone, PartialEq, Eq, ::prost::Message)] +#[derive(Clone, PartialEq, ::prost::Message)] pub struct HandshakeResponse { /// /// A defined protocol version @@ -26,20 +26,20 @@ pub struct HandshakeResponse { } /// /// A message for doing simple auth. -#[derive(Clone, PartialEq, Eq, ::prost::Message)] +#[derive(Clone, PartialEq, ::prost::Message)] pub struct BasicAuth { #[prost(string, tag="2")] pub username: ::prost::alloc::string::String, #[prost(string, tag="3")] pub password: ::prost::alloc::string::String, } -#[derive(Clone, PartialEq, Eq, ::prost::Message)] +#[derive(Clone, PartialEq, ::prost::Message)] pub struct Empty { } /// /// Describes an available action, including both the name used for execution /// along with a short description of the purpose of the action. -#[derive(Clone, PartialEq, Eq, ::prost::Message)] +#[derive(Clone, PartialEq, ::prost::Message)] pub struct ActionType { #[prost(string, tag="1")] pub r#type: ::prost::alloc::string::String, @@ -49,14 +49,14 @@ pub struct ActionType { /// /// A service specific expression that can be used to return a limited set /// of available Arrow Flight streams. -#[derive(Clone, PartialEq, Eq, ::prost::Message)] +#[derive(Clone, PartialEq, ::prost::Message)] pub struct Criteria { #[prost(bytes="vec", tag="1")] pub expression: ::prost::alloc::vec::Vec, } /// /// An opaque action specific for the service. -#[derive(Clone, PartialEq, Eq, ::prost::Message)] +#[derive(Clone, PartialEq, ::prost::Message)] pub struct Action { #[prost(string, tag="1")] pub r#type: ::prost::alloc::string::String, @@ -65,14 +65,14 @@ pub struct Action { } /// /// An opaque result returned after executing an action. -#[derive(Clone, PartialEq, Eq, ::prost::Message)] +#[derive(Clone, PartialEq, ::prost::Message)] pub struct Result { #[prost(bytes="vec", tag="1")] pub body: ::prost::alloc::vec::Vec, } /// /// Wrap the result of a getSchema call -#[derive(Clone, PartialEq, Eq, ::prost::Message)] +#[derive(Clone, PartialEq, ::prost::Message)] pub struct SchemaResult { /// schema of the dataset as described in Schema.fbs::Schema. #[prost(bytes="vec", tag="1")] @@ -81,7 +81,7 @@ pub struct SchemaResult { /// /// The name or tag for a Flight. May be used as a way to retrieve or generate /// a flight or be used to expose a set of previously defined flights. -#[derive(Clone, PartialEq, Eq, ::prost::Message)] +#[derive(Clone, PartialEq, ::prost::Message)] pub struct FlightDescriptor { #[prost(enumeration="flight_descriptor::DescriptorType", tag="1")] pub r#type: i32, @@ -118,7 +118,7 @@ pub mod flight_descriptor { /// /// The access coordinates for retrieval of a dataset. With a FlightInfo, a /// consumer is able to determine how to retrieve a dataset. -#[derive(Clone, PartialEq, Eq, ::prost::Message)] +#[derive(Clone, PartialEq, ::prost::Message)] pub struct FlightInfo { /// schema of the dataset as described in Schema.fbs::Schema. #[prost(bytes="vec", tag="1")] @@ -140,7 +140,7 @@ pub struct FlightInfo { } /// /// A particular stream or split associated with a flight. -#[derive(Clone, PartialEq, Eq, ::prost::Message)] +#[derive(Clone, PartialEq, ::prost::Message)] pub struct FlightEndpoint { /// /// Token used to retrieve this stream. @@ -156,7 +156,7 @@ pub struct FlightEndpoint { /// /// A location where a Flight service will accept retrieval of a particular /// stream given a ticket. -#[derive(Clone, PartialEq, Eq, ::prost::Message)] +#[derive(Clone, PartialEq, ::prost::Message)] pub struct Location { #[prost(string, tag="1")] pub uri: ::prost::alloc::string::String, @@ -164,14 +164,14 @@ pub struct Location { /// /// An opaque identifier that the service can use to retrieve a particular /// portion of a stream. -#[derive(Clone, PartialEq, Eq, ::prost::Message)] +#[derive(Clone, PartialEq, ::prost::Message)] pub struct Ticket { #[prost(bytes="vec", tag="1")] pub ticket: ::prost::alloc::vec::Vec, } /// /// A batch of Arrow data as part of a stream of batches. -#[derive(Clone, PartialEq, Eq, ::prost::Message)] +#[derive(Clone, PartialEq, ::prost::Message)] pub struct FlightData { /// /// The descriptor of the data. This is only relevant when a client is @@ -196,7 +196,7 @@ pub struct FlightData { } ///* /// The response message associated with the submission of a DoPut. -#[derive(Clone, PartialEq, Eq, ::prost::Message)] +#[derive(Clone, PartialEq, ::prost::Message)] pub struct PutResult { #[prost(bytes="vec", tag="1")] pub app_metadata: ::prost::alloc::vec::Vec, diff --git a/arrow-flight/src/sql/arrow.flight.protocol.sql.rs b/arrow-flight/src/sql/arrow.flight.protocol.sql.rs index bbdc607ade15..9e5d61355821 100644 --- a/arrow-flight/src/sql/arrow.flight.protocol.sql.rs +++ b/arrow-flight/src/sql/arrow.flight.protocol.sql.rs @@ -18,7 +18,7 @@ /// int32_to_int32_list_map: map> /// > /// where there is one row per requested piece of metadata information. -#[derive(Clone, PartialEq, Eq, ::prost::Message)] +#[derive(Clone, PartialEq, ::prost::Message)] pub struct CommandGetSqlInfo { /// /// Values are modelled after ODBC's SQLGetInfo() function. This information is intended to provide @@ -53,7 +53,7 @@ pub struct CommandGetSqlInfo { /// catalog_name: utf8 not null /// > /// The returned data should be ordered by catalog_name. -#[derive(Clone, PartialEq, Eq, ::prost::Message)] +#[derive(Clone, PartialEq, ::prost::Message)] pub struct CommandGetCatalogs { } /// @@ -69,7 +69,7 @@ pub struct CommandGetCatalogs { /// db_schema_name: utf8 not null /// > /// The returned data should be ordered by catalog_name, then db_schema_name. -#[derive(Clone, PartialEq, Eq, ::prost::Message)] +#[derive(Clone, PartialEq, ::prost::Message)] pub struct CommandGetDbSchemas { /// /// Specifies the Catalog to search for the tables. @@ -102,7 +102,7 @@ pub struct CommandGetDbSchemas { /// it is serialized as an IPC message.) /// > /// The returned data should be ordered by catalog_name, db_schema_name, table_name, then table_type, followed by table_schema if requested. -#[derive(Clone, PartialEq, Eq, ::prost::Message)] +#[derive(Clone, PartialEq, ::prost::Message)] pub struct CommandGetTables { /// /// Specifies the Catalog to search for the tables. @@ -149,7 +149,7 @@ pub struct CommandGetTables { /// table_type: utf8 not null /// > /// The returned data should be ordered by table_type. -#[derive(Clone, PartialEq, Eq, ::prost::Message)] +#[derive(Clone, PartialEq, ::prost::Message)] pub struct CommandGetTableTypes { } /// @@ -168,7 +168,7 @@ pub struct CommandGetTableTypes { /// key_sequence: int not null /// > /// The returned data should be ordered by catalog_name, db_schema_name, table_name, key_name, then key_sequence. -#[derive(Clone, PartialEq, Eq, ::prost::Message)] +#[derive(Clone, PartialEq, ::prost::Message)] pub struct CommandGetPrimaryKeys { /// /// Specifies the catalog to search for the table. @@ -211,7 +211,7 @@ pub struct CommandGetPrimaryKeys { /// > /// The returned data should be ordered by fk_catalog_name, fk_db_schema_name, fk_table_name, fk_key_name, then key_sequence. /// update_rule and delete_rule returns a byte that is equivalent to actions declared on UpdateDeleteRules enum. -#[derive(Clone, PartialEq, Eq, ::prost::Message)] +#[derive(Clone, PartialEq, ::prost::Message)] pub struct CommandGetExportedKeys { /// /// Specifies the catalog to search for the foreign key table. @@ -258,7 +258,7 @@ pub struct CommandGetExportedKeys { /// - 2 = SET NULL /// - 3 = NO ACTION /// - 4 = SET DEFAULT -#[derive(Clone, PartialEq, Eq, ::prost::Message)] +#[derive(Clone, PartialEq, ::prost::Message)] pub struct CommandGetImportedKeys { /// /// Specifies the catalog to search for the primary key table. @@ -307,7 +307,7 @@ pub struct CommandGetImportedKeys { /// - 2 = SET NULL /// - 3 = NO ACTION /// - 4 = SET DEFAULT -#[derive(Clone, PartialEq, Eq, ::prost::Message)] +#[derive(Clone, PartialEq, ::prost::Message)] pub struct CommandGetCrossReference { ///* /// The catalog name where the parent table is. @@ -346,7 +346,7 @@ pub struct CommandGetCrossReference { /// /// Request message for the "CreatePreparedStatement" action on a Flight SQL enabled backend. -#[derive(Clone, PartialEq, Eq, ::prost::Message)] +#[derive(Clone, PartialEq, ::prost::Message)] pub struct ActionCreatePreparedStatementRequest { /// The valid SQL string to create a prepared statement for. #[prost(string, tag="1")] @@ -358,7 +358,7 @@ pub struct ActionCreatePreparedStatementRequest { /// The resultant PreparedStatement can be closed either: /// - Manually, through the "ClosePreparedStatement" action; /// - Automatically, by a server timeout. -#[derive(Clone, PartialEq, Eq, ::prost::Message)] +#[derive(Clone, PartialEq, ::prost::Message)] pub struct ActionCreatePreparedStatementResult { /// Opaque handle for the prepared statement on the server. #[prost(bytes="vec", tag="1")] @@ -375,7 +375,7 @@ pub struct ActionCreatePreparedStatementResult { /// /// Request message for the "ClosePreparedStatement" action on a Flight SQL enabled backend. /// Closes server resources associated with the prepared statement handle. -#[derive(Clone, PartialEq, Eq, ::prost::Message)] +#[derive(Clone, PartialEq, ::prost::Message)] pub struct ActionClosePreparedStatementRequest { /// Opaque handle for the prepared statement on the server. #[prost(bytes="vec", tag="1")] @@ -388,7 +388,7 @@ pub struct ActionClosePreparedStatementRequest { /// for the following RPC calls: /// - GetSchema: return the Arrow schema of the query. /// - GetFlightInfo: execute the query. -#[derive(Clone, PartialEq, Eq, ::prost::Message)] +#[derive(Clone, PartialEq, ::prost::Message)] pub struct CommandStatementQuery { /// The SQL syntax. #[prost(string, tag="1")] @@ -397,7 +397,7 @@ pub struct CommandStatementQuery { ///* /// Represents a ticket resulting from GetFlightInfo with a CommandStatementQuery. /// This should be used only once and treated as an opaque value, that is, clients should not attempt to parse this. -#[derive(Clone, PartialEq, Eq, ::prost::Message)] +#[derive(Clone, PartialEq, ::prost::Message)] pub struct TicketStatementQuery { /// Unique identifier for the instance of the statement to execute. #[prost(bytes="vec", tag="1")] @@ -408,7 +408,7 @@ pub struct TicketStatementQuery { /// the following RPC calls: /// - DoPut: bind parameter values. All of the bound parameter sets will be executed as a single atomic execution. /// - GetFlightInfo: execute the prepared statement instance. -#[derive(Clone, PartialEq, Eq, ::prost::Message)] +#[derive(Clone, PartialEq, ::prost::Message)] pub struct CommandPreparedStatementQuery { /// Opaque handle for the prepared statement on the server. #[prost(bytes="vec", tag="1")] @@ -417,7 +417,7 @@ pub struct CommandPreparedStatementQuery { /// /// Represents a SQL update query. Used in the command member of FlightDescriptor /// for the the RPC call DoPut to cause the server to execute the included SQL update. -#[derive(Clone, PartialEq, Eq, ::prost::Message)] +#[derive(Clone, PartialEq, ::prost::Message)] pub struct CommandStatementUpdate { /// The SQL syntax. #[prost(string, tag="1")] @@ -427,7 +427,7 @@ pub struct CommandStatementUpdate { /// Represents a SQL update query. Used in the command member of FlightDescriptor /// for the the RPC call DoPut to cause the server to execute the included /// prepared statement handle as an update. -#[derive(Clone, PartialEq, Eq, ::prost::Message)] +#[derive(Clone, PartialEq, ::prost::Message)] pub struct CommandPreparedStatementUpdate { /// Opaque handle for the prepared statement on the server. #[prost(bytes="vec", tag="1")] @@ -437,7 +437,7 @@ pub struct CommandPreparedStatementUpdate { /// Returned from the RPC call DoPut when a CommandStatementUpdate /// CommandPreparedStatementUpdate was in the request, containing /// results from the update. -#[derive(Clone, PartialEq, Eq, ::prost::Message)] +#[derive(Clone, PartialEq, ::prost::Message)] pub struct DoPutUpdateResult { /// The number of records updated. A return value of -1 represents /// an unknown updated record count. diff --git a/dev/release/rat_exclude_files.txt b/dev/release/rat_exclude_files.txt index c7996a78af86..c7128474a02c 100644 --- a/dev/release/rat_exclude_files.txt +++ b/dev/release/rat_exclude_files.txt @@ -16,6 +16,7 @@ conbench/requirements.txt conbench/requirements-test.txt conbench/.flake8 conbench/.isort.cfg +rust-toolchain # auto-generated arrow-flight/src/arrow.flight.protocol.rs arrow-flight/src/sql/arrow.flight.protocol.sql.rs diff --git a/rust-toolchain b/rust-toolchain new file mode 100644 index 000000000000..f367a50f005e --- /dev/null +++ b/rust-toolchain @@ -0,0 +1 @@ +nightly-2022-03-08