From 4001d79e4b8cabd0ccf9518595e1f799314ee90d Mon Sep 17 00:00:00 2001 From: l Date: Mon, 7 Apr 2025 21:42:10 +0000 Subject: [PATCH] ci: upgrade Rust from 1.84.1 to 1.86.0 (#6784) --- .github/workflows/ci.yml | 33 ++++++++++++++++++++++---------- deltachat-ffi/src/lib.rs | 8 ++++---- deltachat-jsonrpc/src/api.rs | 8 ++++++-- scripts/coredeps/install-rust.sh | 2 +- 4 files changed, 34 insertions(+), 17 deletions(-) diff --git a/.github/workflows/ci.yml b/.github/workflows/ci.yml index 57820c300..32639413f 100644 --- a/.github/workflows/ci.yml +++ b/.github/workflows/ci.yml @@ -20,20 +20,22 @@ permissions: {} env: RUSTFLAGS: -Dwarnings + RUST_VERSION: 1.86.0 + + # Minimum Supported Rust Version + MSRV: 1.81.0 jobs: lint_rust: name: Lint Rust runs-on: ubuntu-latest - env: - RUSTUP_TOOLCHAIN: 1.84.1 steps: - uses: actions/checkout@v4 with: show-progress: false persist-credentials: false - name: Install rustfmt and clippy - run: rustup toolchain install $RUSTUP_TOOLCHAIN --profile minimal --component rustfmt --component clippy + run: rustup toolchain install $RUST_VERSION --profile minimal --component rustfmt --component clippy - name: Cache rust cargo artifacts uses: swatinem/rust-cache@v2 - name: Run rustfmt @@ -91,25 +93,36 @@ jobs: matrix: include: - os: ubuntu-latest - rust: 1.84.1 + rust: latest - os: windows-latest - rust: 1.84.1 + rust: latest - os: macos-latest - rust: 1.84.1 + rust: latest - # Minimum Supported Rust Version = 1.81.0 + # Minimum Supported Rust Version - os: ubuntu-latest - rust: 1.81.0 + rust: minimum runs-on: ${{ matrix.os }} steps: + - run: + echo "RUSTUP_TOOLCHAIN=$MSRV" >> $GITHUB_ENV + shell: bash + if: matrix.rust == 'minimum' + - run: + echo "RUSTUP_TOOLCHAIN=$RUST_VERSION" >> $GITHUB_ENV + shell: bash + if: matrix.rust == 'latest' + - uses: actions/checkout@v4 with: show-progress: false persist-credentials: false - name: Install Rust ${{ matrix.rust }} - run: rustup toolchain install --profile minimal ${{ matrix.rust }} - - run: rustup override set ${{ matrix.rust }} + run: rustup toolchain install --profile minimal $RUSTUP_TOOLCHAIN + shell: bash + - run: rustup override set $RUSTUP_TOOLCHAIN + shell: bash - name: Cache rust cargo artifacts uses: swatinem/rust-cache@v2 diff --git a/deltachat-ffi/src/lib.rs b/deltachat-ffi/src/lib.rs index 0e31a9f40..8f55d00ce 100644 --- a/deltachat-ffi/src/lib.rs +++ b/deltachat-ffi/src/lib.rs @@ -536,7 +536,7 @@ pub unsafe extern "C" fn dc_event_get_id(event: *mut dc_event_t) -> libc::c_int EventType::IncomingReaction { .. } => 2002, EventType::IncomingWebxdcNotify { .. } => 2003, EventType::IncomingMsg { .. } => 2005, - EventType::IncomingMsgBunch { .. } => 2006, + EventType::IncomingMsgBunch => 2006, EventType::MsgsNoticed { .. } => 2008, EventType::MsgDelivered { .. } => 2010, EventType::MsgFailed { .. } => 2012, @@ -594,7 +594,7 @@ pub unsafe extern "C" fn dc_event_get_data1_int(event: *mut dc_event_t) -> libc: | EventType::ConnectivityChanged | EventType::SelfavatarChanged | EventType::ConfigSynced { .. } - | EventType::IncomingMsgBunch { .. } + | EventType::IncomingMsgBunch | EventType::ErrorSelfNotInGroup(_) | EventType::AccountsBackgroundFetchDone | EventType::ChatlistChanged @@ -669,7 +669,7 @@ pub unsafe extern "C" fn dc_event_get_data2_int(event: *mut dc_event_t) -> libc: | EventType::MsgsNoticed(_) | EventType::ConnectivityChanged | EventType::WebxdcInstanceDeleted { .. } - | EventType::IncomingMsgBunch { .. } + | EventType::IncomingMsgBunch | EventType::SelfavatarChanged | EventType::AccountsBackgroundFetchDone | EventType::ChatlistChanged @@ -771,7 +771,7 @@ pub unsafe extern "C" fn dc_event_get_data2_str(event: *mut dc_event_t) -> *mut | EventType::AccountsBackgroundFetchDone | EventType::ChatEphemeralTimerModified { .. } | EventType::ChatDeleted { .. } - | EventType::IncomingMsgBunch { .. } + | EventType::IncomingMsgBunch | EventType::ChatlistItemChanged { .. } | EventType::ChatlistChanged | EventType::AccountsChanged diff --git a/deltachat-jsonrpc/src/api.rs b/deltachat-jsonrpc/src/api.rs index 2ab1f4fad..4ad331cff 100644 --- a/deltachat-jsonrpc/src/api.rs +++ b/deltachat-jsonrpc/src/api.rs @@ -327,8 +327,12 @@ impl CommandApi { .get_config_bool(deltachat::config::Config::ProxyEnabled) .await?; - let provider_info = - get_provider_info(&ctx, email.split('@').last().unwrap_or(""), proxy_enabled).await; + let provider_info = get_provider_info( + &ctx, + email.split('@').next_back().unwrap_or(""), + proxy_enabled, + ) + .await; Ok(ProviderInfo::from_dc_type(provider_info)) } diff --git a/scripts/coredeps/install-rust.sh b/scripts/coredeps/install-rust.sh index 7e3c75872..69e4ab10c 100755 --- a/scripts/coredeps/install-rust.sh +++ b/scripts/coredeps/install-rust.sh @@ -7,7 +7,7 @@ set -euo pipefail # # Avoid using rustup here as it depends on reading /proc/self/exe and # has problems running under QEMU. -RUST_VERSION=1.84.1 +RUST_VERSION=1.86.0 ARCH="$(uname -m)" test -f "/lib/libc.musl-$ARCH.so.1" && LIBC=musl || LIBC=gnu