build!: remove jsonrpc feature flag

It is enabled everywhere by default since some time now. Breaking, because existing build scripts might need to be adjusted.
This commit is contained in:
Simon Laux
2025-01-08 13:39:15 +01:00
committed by l
parent 6e8668e348
commit a9e177f1e7
9 changed files with 88 additions and 98 deletions

View File

@@ -152,7 +152,7 @@ jobs:
uses: swatinem/rust-cache@v2 uses: swatinem/rust-cache@v2
- name: Build C library - name: Build C library
run: cargo build -p deltachat_ffi --features jsonrpc run: cargo build -p deltachat_ffi
- name: Upload C library - name: Upload C library
uses: actions/upload-artifact@v4 uses: actions/upload-artifact@v4

View File

@@ -27,7 +27,7 @@ add_custom_command(
PREFIX=${CMAKE_INSTALL_PREFIX} PREFIX=${CMAKE_INSTALL_PREFIX}
LIBDIR=${CMAKE_INSTALL_FULL_LIBDIR} LIBDIR=${CMAKE_INSTALL_FULL_LIBDIR}
INCLUDEDIR=${CMAKE_INSTALL_FULL_INCLUDEDIR} INCLUDEDIR=${CMAKE_INSTALL_FULL_INCLUDEDIR}
${CARGO} build --target-dir=${CMAKE_BINARY_DIR}/target --release --features jsonrpc ${CARGO} build --target-dir=${CMAKE_BINARY_DIR}/target --release
WORKING_DIRECTORY ${CMAKE_CURRENT_SOURCE_DIR}/deltachat-ffi WORKING_DIRECTORY ${CMAKE_CURRENT_SOURCE_DIR}/deltachat-ffi
) )

View File

@@ -15,7 +15,7 @@ crate-type = ["cdylib", "staticlib"]
[dependencies] [dependencies]
deltachat = { workspace = true, default-features = false } deltachat = { workspace = true, default-features = false }
deltachat-jsonrpc = { workspace = true, optional = true } deltachat-jsonrpc = { workspace = true }
libc = { workspace = true } libc = { workspace = true }
human-panic = { version = "2", default-features = false } human-panic = { version = "2", default-features = false }
num-traits = { workspace = true } num-traits = { workspace = true }
@@ -30,5 +30,4 @@ yerpc = { workspace = true, features = ["anyhow_expose"] }
[features] [features]
default = ["vendored"] default = ["vendored"]
vendored = ["deltachat/vendored", "deltachat-jsonrpc/vendored"] vendored = ["deltachat/vendored", "deltachat-jsonrpc/vendored"]
jsonrpc = ["dep:deltachat-jsonrpc"]

View File

@@ -35,6 +35,8 @@ use deltachat::stock_str::StockMessage;
use deltachat::webxdc::StatusUpdateSerial; use deltachat::webxdc::StatusUpdateSerial;
use deltachat::*; use deltachat::*;
use deltachat::{accounts::Accounts, log::LogExt}; use deltachat::{accounts::Accounts, log::LogExt};
use deltachat_jsonrpc::api::CommandApi;
use deltachat_jsonrpc::yerpc::{OutReceiver, RpcClient, RpcSession};
use num_traits::{FromPrimitive, ToPrimitive}; use num_traits::{FromPrimitive, ToPrimitive};
use once_cell::sync::Lazy; use once_cell::sync::Lazy;
use rand::Rng; use rand::Rng;
@@ -4930,13 +4932,6 @@ pub unsafe extern "C" fn dc_accounts_get_event_emitter(
Box::into_raw(Box::new(emitter)) Box::into_raw(Box::new(emitter))
} }
#[cfg(feature = "jsonrpc")]
mod jsonrpc {
use deltachat_jsonrpc::api::CommandApi;
use deltachat_jsonrpc::yerpc::{OutReceiver, RpcClient, RpcSession};
use super::*;
pub struct dc_jsonrpc_instance_t { pub struct dc_jsonrpc_instance_t {
receiver: OutReceiver, receiver: OutReceiver,
handle: RpcSession<CommandApi>, handle: RpcSession<CommandApi>,
@@ -5031,4 +5026,3 @@ mod jsonrpc {
None => ptr::null_mut(), None => ptr::null_mut(),
} }
} }
}

View File

@@ -9,7 +9,7 @@ const buildArgs = [
'build', 'build',
'--release', '--release',
'--features', '--features',
'vendored,jsonrpc', 'vendored',
'-p', '-p',
'deltachat_ffi' 'deltachat_ffi'
] ]

View File

@@ -52,10 +52,7 @@ python3-venv` should give you a usable python installation.
First, build the core library:: First, build the core library::
cargo build --release -p deltachat_ffi --features jsonrpc cargo build --release -p deltachat_ffi
`jsonrpc` feature is required even if not used by the bindings
because `deltachat.h` includes JSON-RPC functions unconditionally.
Create the virtual environment and activate it:: Create the virtual environment and activate it::

View File

@@ -11,7 +11,7 @@ set -euo pipefail
export DCC_RS_TARGET=debug export DCC_RS_TARGET=debug
export DCC_RS_DEV="$PWD" export DCC_RS_DEV="$PWD"
cargo build -p deltachat_ffi --features jsonrpc cargo build -p deltachat_ffi
tox -c python -e py --devenv venv tox -c python -e py --devenv venv
venv/bin/pip install --upgrade pip venv/bin/pip install --upgrade pip

View File

@@ -12,7 +12,7 @@ export DCC_RS_DEV=`pwd`
cd python cd python
cargo build -p deltachat_ffi --features jsonrpc cargo build -p deltachat_ffi
# remove and inhibit writing PYC files # remove and inhibit writing PYC files
rm -rf tests/__pycache__ rm -rf tests/__pycache__

View File

@@ -8,7 +8,7 @@ set -e -x
# compile core lib # compile core lib
cargo build --release -p deltachat_ffi --features jsonrpc cargo build --release -p deltachat_ffi
# Statically link against libdeltachat.a. # Statically link against libdeltachat.a.
export DCC_RS_DEV="$PWD" export DCC_RS_DEV="$PWD"