This is an automated email from the ASF dual-hosted git repository. alamb pushed a commit to branch main in repository https://gitbox.apache.org/repos/asf/arrow-rs.git
The following commit(s) were added to refs/heads/main by this push: new c628435f9f chore: Add rust-toolchain.toml to ensure consistent toolchain version (#7972) c628435f9f is described below commit c628435f9f14abc645fb546442132974d3d380ca Author: Cheng-Yang Chou <yphbchou0...@gmail.com> AuthorDate: Wed Aug 13 05:38:03 2025 +0800 chore: Add rust-toolchain.toml to ensure consistent toolchain version (#7972) # Which issue does this PR close? None. # Rationale for this change Without a fixed toolchain, contributors may use different Rust versions, leading to inconsistent Clippy lints or build errors (e.g., from renamed lints). This change ensures that the project builds consistently across environments. # What changes are included in this PR? - Add a `rust-toolchain.toml` file to pin the Rust toolchain to the `stable` channel. # Are these changes tested? This change affects toolchain configuration and does not modify runtime code. Behavior is implicitly tested via CI builds, which will now consistently use the pinned toolchain. # Are there any user-facing changes? No. --------- Signed-off-by: Cheng-Yang Chou <yphbchou0...@gmail.com> Co-authored-by: Andrew Lamb <and...@nerdnetworks.org> --- .github/actions/setup-builder/action.yaml | 18 +++--------------- .github/workflows/arrow.yml | 6 ++++-- .github/workflows/docs.yml | 12 ++++-------- .github/workflows/parquet.yml | 6 ++++-- rust-toolchain.toml | 20 ++++++++++++++++++++ 5 files changed, 35 insertions(+), 27 deletions(-) diff --git a/.github/actions/setup-builder/action.yaml b/.github/actions/setup-builder/action.yaml index 20da777ec0..f73f7abf9b 100644 --- a/.github/actions/setup-builder/action.yaml +++ b/.github/actions/setup-builder/action.yaml @@ -17,15 +17,6 @@ name: Prepare Rust Builder description: 'Prepare Rust Build Environment' -inputs: - rust-version: - description: 'version of rust to install (e.g. stable)' - required: false - default: 'stable' - target: - description: 'target architecture(s)' - required: false - default: 'x86_64-unknown-linux-gnu' runs: using: "composite" steps: @@ -43,6 +34,9 @@ runs: /usr/local/cargo/git/db/ key: cargo-cache3-${{ hashFiles('**/Cargo.toml') }} restore-keys: cargo-cache3- + - name: Setup Rust toolchain + shell: bash + run: rustup install - name: Generate lockfile shell: bash run: cargo fetch @@ -51,12 +45,6 @@ runs: 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 }} --target ${{ inputs.target }} - rustup default ${{ inputs.rust-version }} - name: Disable debuginfo generation # Disable full debug symbol generation to speed up CI build and keep memory down # "1" means line tables only, which is useful for panic tracebacks. diff --git a/.github/workflows/arrow.yml b/.github/workflows/arrow.yml index 7c412d7960..9b81473261 100644 --- a/.github/workflows/arrow.yml +++ b/.github/workflows/arrow.yml @@ -148,8 +148,10 @@ jobs: submodules: true - name: Setup Rust toolchain uses: ./.github/actions/setup-builder - with: - target: wasm32-unknown-unknown,wasm32-wasip1 + - name: Install wasm32 targets + run: | + rustup target add wasm32-unknown-unknown + rustup target add wasm32-wasip1 - name: Build wasm32-unknown-unknown run: cargo build -p arrow --no-default-features --features=json,csv,ipc,ffi --target wasm32-unknown-unknown - name: Build wasm32-wasip1 diff --git a/.github/workflows/docs.yml b/.github/workflows/docs.yml index 00f92135bb..9ffafb92b4 100644 --- a/.github/workflows/docs.yml +++ b/.github/workflows/docs.yml @@ -34,12 +34,8 @@ jobs: docs: name: Rustdocs are clean runs-on: ubuntu-latest - strategy: - matrix: - arch: [ amd64 ] - rust: [ nightly ] container: - image: ${{ matrix.arch }}/rust + image: amd64/rust env: RUSTDOCFLAGS: "-Dwarnings --enable-index-page -Zunstable-options" steps: @@ -52,10 +48,10 @@ jobs: apt install -y libpython3.11-dev - name: Setup Rust toolchain uses: ./.github/actions/setup-builder - with: - rust-version: ${{ matrix.rust }} + - name: Install Nightly Rust + run: rustup install nightly - name: Run cargo doc - run: cargo doc --document-private-items --no-deps --workspace --all-features + run: cargo +nightly doc --document-private-items --no-deps --workspace --all-features - name: Fix file permissions shell: sh run: | diff --git a/.github/workflows/parquet.yml b/.github/workflows/parquet.yml index 5cc0df6fca..8a2301acd9 100644 --- a/.github/workflows/parquet.yml +++ b/.github/workflows/parquet.yml @@ -133,8 +133,10 @@ jobs: submodules: true - name: Setup Rust toolchain uses: ./.github/actions/setup-builder - with: - target: wasm32-unknown-unknown,wasm32-wasip1 + - name: Install wasm32 targets + run: | + rustup target add wasm32-unknown-unknown + rustup target add wasm32-wasip1 - name: Install clang # Needed for zlib compilation run: apt-get update && apt-get install -y clang gcc-multilib - name: Build wasm32-unknown-unknown diff --git a/rust-toolchain.toml b/rust-toolchain.toml new file mode 100644 index 0000000000..4ac629d201 --- /dev/null +++ b/rust-toolchain.toml @@ -0,0 +1,20 @@ +# 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. + +[toolchain] +channel = "1.89" +components = ["rustfmt", "clippy"]