From 432297e79ba4d6c5bf5110099ff94d1af0804f3c Mon Sep 17 00:00:00 2001 From: Elena Gantner Date: Wed, 20 May 2026 14:54:27 +0200 Subject: [PATCH 01/14] Add bazel build config Signed-off-by: Elena Gantner --- .bazelrc | 42 +++++++++ .github/workflows/bazel.yml | 54 ++++++++++++ .gitignore | 7 ++ BUILD.bazel | 44 ++++++++++ MODULE.bazel | 90 +++++++++++++++++++ README.md | 14 +++ bazel/workspace_status.sh | 26 ++++++ cda-build/BUILD.bazel | 24 +++++ cda-comm-doip/BUILD.bazel | 47 ++++++++++ cda-comm-uds/BUILD.bazel | 33 +++++++ cda-core/BUILD.bazel | 33 +++++++ cda-database/BUILD.bazel | 50 +++++++++++ cda-extra/BUILD.bazel | 25 ++++++ cda-health/BUILD.bazel | 36 ++++++++ cda-interfaces/BUILD.bazel | 38 ++++++++ cda-main/BUILD.bazel | 92 ++++++++++++++++++++ cda-plugin-security/BUILD.bazel | 39 +++++++++ cda-sovd-interfaces/BUILD.bazel | 29 ++++++ cda-sovd/BUILD.bazel | 57 ++++++++++++ cda-tracing/BUILD.bazel | 48 ++++++++++ comm-mbedtls/mbedtls-rs/BUILD.bazel | 31 +++++++ comm-mbedtls/mbedtls-sys/BUILD.bazel | 67 ++++++++++++++ comm-mbedtls/mbedtls-sys/build.rs | 77 +++++++++++++--- comm-mbedtls/mbedtls-sys/patches/BUILD.bazel | 18 ++++ opensovd-axum-extra/BUILD.bazel | 33 +++++++ third_party/BUILD.bazel | 11 +++ third_party/mbedtls/BUILD.bazel | 56 ++++++++++++ third_party/mbedtls/overlay/BUILD.bazel | 21 +++++ 28 files changed, 1128 insertions(+), 14 deletions(-) create mode 100644 .bazelrc create mode 100644 .github/workflows/bazel.yml create mode 100644 BUILD.bazel create mode 100644 MODULE.bazel create mode 100755 bazel/workspace_status.sh create mode 100644 cda-build/BUILD.bazel create mode 100644 cda-comm-doip/BUILD.bazel create mode 100644 cda-comm-uds/BUILD.bazel create mode 100644 cda-core/BUILD.bazel create mode 100644 cda-database/BUILD.bazel create mode 100644 cda-extra/BUILD.bazel create mode 100644 cda-health/BUILD.bazel create mode 100644 cda-interfaces/BUILD.bazel create mode 100644 cda-main/BUILD.bazel create mode 100644 cda-plugin-security/BUILD.bazel create mode 100644 cda-sovd-interfaces/BUILD.bazel create mode 100644 cda-sovd/BUILD.bazel create mode 100644 cda-tracing/BUILD.bazel create mode 100644 comm-mbedtls/mbedtls-rs/BUILD.bazel create mode 100644 comm-mbedtls/mbedtls-sys/BUILD.bazel create mode 100644 comm-mbedtls/mbedtls-sys/patches/BUILD.bazel create mode 100644 opensovd-axum-extra/BUILD.bazel create mode 100644 third_party/BUILD.bazel create mode 100644 third_party/mbedtls/BUILD.bazel create mode 100644 third_party/mbedtls/overlay/BUILD.bazel diff --git a/.bazelrc b/.bazelrc new file mode 100644 index 000000000..7b20e7a7d --- /dev/null +++ b/.bazelrc @@ -0,0 +1,42 @@ +# SPDX-License-Identifier: Apache-2.0 +# SPDX-FileCopyrightText: 2025 The Contributors to Eclipse OpenSOVD (see CONTRIBUTORS) +# +# See the NOTICE file(s) distributed with this work for additional +# information regarding copyright ownership. +# +# This program and the accompanying materials are made available under the +# terms of the Apache License Version 2.0 which is available at +# https://www.apache.org/licenses/LICENSE-2.0 + +# Classic Diagnostic Adapter - Bazel Configuration +# +# Usage: +# bazel build //:opensovd-cda # build with OpenSSL (default) +# bazel build --config=mbedtls //:opensovd-cda # build with mbedtls + +# --- Common settings --- +common --enable_bzlmod +build --incompatible_enable_cc_toolchain_resolution + +# --- TLS backend selection --- +# Default: OpenSSL +build --//:tls_backend=openssl + +# Switch to mbedtls: bazel build --config=mbedtls //... +build:mbedtls --//:tls_backend=mbedtls + +# Explicit openssl config (same as default, for clarity) +build:openssl --//:tls_backend=openssl + +# --- Git metadata for cda-main build.rs --- +build --workspace_status_command=bazel/workspace_status.sh + +# --- Performance --- +build --jobs=auto + +# --- Convenience aliases --- +# Build everything except integration tests +build:all --build_tag_filters=-integration + +# Test everything except integration tests +test:all --test_tag_filters=-integration diff --git a/.github/workflows/bazel.yml b/.github/workflows/bazel.yml new file mode 100644 index 000000000..1371fc83a --- /dev/null +++ b/.github/workflows/bazel.yml @@ -0,0 +1,54 @@ +# SPDX-License-Identifier: Apache-2.0 +# SPDX-FileCopyrightText: 2025 The Contributors to Eclipse OpenSOVD (see CONTRIBUTORS) +# +# See the NOTICE file(s) distributed with this work for additional +# information regarding copyright ownership. +# +# This program and the accompanying materials are made available under the +# terms of the Apache License Version 2.0 which is available at +# https://www.apache.org/licenses/LICENSE-2.0 + +name: Bazel Build + +on: + push: + branches: + - main + pull_request: + workflow_dispatch: + +permissions: + contents: read + +concurrency: + group: ${{ github.workflow }}-${{ github.ref_name }}-${{ github.event.pull_request.number || github.sha }} + cancel-in-progress: true + +jobs: + bazel_build: + runs-on: ubuntu-latest + + steps: + - name: Checkout repository + uses: actions/checkout@v4 + with: + submodules: false + + - name: Cache Bazel repository and build artifacts + uses: actions/cache@v4 + with: + path: | + ~/.cache/bazel + ~/.cache/bazelisk + key: bazel-${{ runner.os }}-${{ hashFiles('MODULE.bazel', 'MODULE.bazel.lock') }} + restore-keys: | + bazel-${{ runner.os }}- + + - name: Build with OpenSSL (default) + run: bazel build //:opensovd-cda + + - name: Build with mbedtls + run: bazel build --config=mbedtls //:opensovd-cda + + - name: Verify binary runs + run: bazel-bin/cda-main/opensovd-cda --version diff --git a/.gitignore b/.gitignore index 752f95dc6..f91d2ea63 100644 --- a/.gitignore +++ b/.gitignore @@ -37,6 +37,13 @@ mbedtls-4* # binary files (used in integration tests) *.bin +# Bazel convenience symlinks and generated files +/bazel-bin +/bazel-out +/bazel-testlogs +/bazel-classic-diagnostic-adapter +MODULE.bazel.lock + # macOS metadata .DS_Store diff --git a/BUILD.bazel b/BUILD.bazel new file mode 100644 index 000000000..f72403ad6 --- /dev/null +++ b/BUILD.bazel @@ -0,0 +1,44 @@ +# SPDX-License-Identifier: Apache-2.0 +# SPDX-FileCopyrightText: 2025 The Contributors to Eclipse OpenSOVD (see CONTRIBUTORS) +# +# See the NOTICE file(s) distributed with this work for additional +# information regarding copyright ownership. +# +# This program and the accompanying materials are made available under the +# terms of the Apache License Version 2.0 which is available at +# https://www.apache.org/licenses/LICENSE-2.0 + +# Root BUILD file for Classic Diagnostic Adapter. +# Defines TLS backend config settings and a top-level binary alias. + +load("@bazel_skylib//rules:common_settings.bzl", "string_flag") + +package(default_visibility = ["//visibility:public"]) + +# --- TLS backend selection --- +# Controlled via .bazelrc: --//:tls_backend=openssl|mbedtls + +string_flag( + name = "tls_backend", + build_setting_default = "openssl", + values = [ + "openssl", + "mbedtls", + ], +) + +config_setting( + name = "use_openssl", + flag_values = {":tls_backend": "openssl"}, +) + +config_setting( + name = "use_mbedtls", + flag_values = {":tls_backend": "mbedtls"}, +) + +# --- Top-level alias to the CDA binary --- +alias( + name = "opensovd-cda", + actual = "//cda-main:opensovd-cda", +) diff --git a/MODULE.bazel b/MODULE.bazel new file mode 100644 index 000000000..440a56c2d --- /dev/null +++ b/MODULE.bazel @@ -0,0 +1,90 @@ +# SPDX-License-Identifier: Apache-2.0 +# SPDX-FileCopyrightText: 2025 The Contributors to Eclipse OpenSOVD (see CONTRIBUTORS) +# +# See the NOTICE file(s) distributed with this work for additional +# information regarding copyright ownership. +# +# This program and the accompanying materials are made available under the +# terms of the Apache License Version 2.0 which is available at +# https://www.apache.org/licenses/LICENSE-2.0 + +# Bazel module definition for Classic Diagnostic Adapter (CDA). +# +# Build commands: +# bazel build //:opensovd-cda # default (OpenSSL) +# bazel build --config=mbedtls //:opensovd-cda # mbedtls backend + +module( + name = "classic-diagnostic-adapter", + version = "0.1.0", +) + +# --- Bazel rule dependencies --- +bazel_dep(name = "rules_rust", version = "0.70.0") +bazel_dep(name = "rules_cc", version = "0.2.17") +bazel_dep(name = "rules_foreign_cc", version = "0.15.1") +bazel_dep(name = "platforms", version = "1.0.0") +bazel_dep(name = "bazel_skylib", version = "1.8.2") + +# --- Rust toolchain --- +rust = use_extension("@rules_rust//rust:extensions.bzl", "rust") +rust.toolchain( + edition = "2024", + versions = ["1.88.0"], +) +use_repo(rust, "rust_toolchains") + +register_toolchains("@rust_toolchains//:all") + +# --- Pre-fetch mbedtls 4.0.0 source (patched by Bazel, built via rules_foreign_cc) --- +http_archive = use_repo_rule("@bazel_tools//tools/build_defs/repo:http.bzl", "http_archive") + +http_archive( + name = "mbedtls", + build_file = "//third_party/mbedtls:overlay/BUILD.bazel", + patch_args = ["-p2"], + patches = [ + "//comm-mbedtls/mbedtls-sys/patches:record-size-limit-tls12.patch", + "//comm-mbedtls/mbedtls-sys/patches:ed25519-psa-driver.patch", + ], + sha256 = "2f3a47f7b3a541ddef450e4867eeecb7ce2ef7776093f3a11d6d43ead6bf2827", + strip_prefix = "mbedtls-4.0.0", + url = "https://github.com/Mbed-TLS/mbedtls/releases/download/mbedtls-4.0.0/mbedtls-4.0.0.tar.bz2", +) + +# --- crate_universe: auto-generate Bazel targets for external Cargo dependencies --- +crate = use_extension("@rules_rust//crate_universe:extensions.bzl", "crate") + +crate.from_cargo( + name = "crate_index", + cargo_lockfile = "//:Cargo.lock", + manifests = ["//:Cargo.toml"], +) + +# mbedtls-sys: point build.rs at pre-fetched + pre-patched source, skip native build +crate.annotation( + crate = "mbedtls-sys", + build_script_data = [ + "@mbedtls//:all_srcs", + ], + build_script_env = { + "MBEDTLS_DIR": "$(execpath @mbedtls//:CMakeLists.txt)", + "MBEDTLS_SKIP_BUILD": "1", + "MBEDTLS_SKIP_PATCH": "1", + }, + build_script_data_glob = [ + "csrc/**", + "wrapper.h", + ], +) + +# opensovd-cda (cda-main): provide deterministic build metadata for build.rs +crate.annotation( + crate = "opensovd-cda", + build_script_env = { + "SOURCE_DATE_EPOCH": "0", + "SOURCE_GIT_SHA": "bazel", + }, +) + +use_repo(crate, "crate_index") diff --git a/README.md b/README.md index d4067e04c..db854d2f2 100644 --- a/README.md +++ b/README.md @@ -112,6 +112,20 @@ $env:OPENSSL_LIB_DIR="C:\Program Files\OpenSSL-Win64\lib\VC\x64\MD" $env:OPENSSL_INCLUDE_DIR="C:\Program Files\OpenSSL-Win64\include" ``` +### building with Bazel + +As an alternative to Cargo, the project can be built with [Bazel](https://bazel.build/) (via [Bazelisk](https://github.com/bazelbuild/bazelisk)). + +```shell +# Build with OpenSSL (default TLS backend) +bazel build //:opensovd-cda + +# Build with mbedtls TLS backend +bazel build --config=mbedtls //:opensovd-cda +``` + +The resulting binary is located at `bazel-bin/cda-main/opensovd-cda`. + ## developing ### pre commit diff --git a/bazel/workspace_status.sh b/bazel/workspace_status.sh new file mode 100755 index 000000000..45e294e9f --- /dev/null +++ b/bazel/workspace_status.sh @@ -0,0 +1,26 @@ +#!/usr/bin/env bash +# SPDX-License-Identifier: Apache-2.0 +# SPDX-FileCopyrightText: 2025 The Contributors to Eclipse OpenSOVD (see CONTRIBUTORS) +# +# See the NOTICE file(s) distributed with this work for additional +# information regarding copyright ownership. +# +# This program and the accompanying materials are made available under the +# terms of the Apache License Version 2.0 which is available at +# https://www.apache.org/licenses/LICENSE-2.0 + +# Workspace status script for Bazel. +# Provides git metadata used by the cda-main build.rs (via SOURCE_DATE_EPOCH / SOURCE_GIT_SHA). +# +# Bazel calls this script before each build (--workspace_status_command). +# The output is available via ctx.info_file / ctx.version_file in Starlark. + +set -euo pipefail + +# Stable keys (changes cause a rebuild of targets that depend on them) +echo "STABLE_GIT_COMMIT $(git rev-parse --short HEAD 2>/dev/null || echo 'unknown')" + +# Volatile keys (changes do NOT cause a rebuild) +echo "GIT_COMMIT_FULL $(git rev-parse HEAD 2>/dev/null || echo 'unknown')" +echo "BUILD_TIMESTAMP $(date +%s)" +echo "GIT_DATE $(git log -1 --format=%aI 2>/dev/null || echo '1970-01-01T00:00:00+00:00')" diff --git a/cda-build/BUILD.bazel b/cda-build/BUILD.bazel new file mode 100644 index 000000000..6ac95c46e --- /dev/null +++ b/cda-build/BUILD.bazel @@ -0,0 +1,24 @@ +# SPDX-License-Identifier: Apache-2.0 +# SPDX-FileCopyrightText: 2025 The Contributors to Eclipse OpenSOVD (see CONTRIBUTORS) +# +# See the NOTICE file(s) distributed with this work for additional +# information regarding copyright ownership. +# +# This program and the accompanying materials are made available under the +# terms of the Apache License Version 2.0 which is available at +# https://www.apache.org/licenses/LICENSE-2.0 + +# cda-build: Common build-time utilities (nightly detection). + +load("@rules_rust//rust:defs.bzl", "rust_library") + +package(default_visibility = ["//visibility:public"]) + +rust_library( + name = "cda-build", + srcs = glob(["src/**/*.rs"]), + crate_name = "cda_build", + proc_macro_deps = [ + "@crate_index//:rustversion", + ], +) diff --git a/cda-comm-doip/BUILD.bazel b/cda-comm-doip/BUILD.bazel new file mode 100644 index 000000000..2e16bb5e0 --- /dev/null +++ b/cda-comm-doip/BUILD.bazel @@ -0,0 +1,47 @@ +# SPDX-License-Identifier: Apache-2.0 +# SPDX-FileCopyrightText: 2025 The Contributors to Eclipse OpenSOVD (see CONTRIBUTORS) +# +# See the NOTICE file(s) distributed with this work for additional +# information regarding copyright ownership. +# +# This program and the accompanying materials are made available under the +# terms of the Apache License Version 2.0 which is available at +# https://www.apache.org/licenses/LICENSE-2.0 + +# cda-comm-doip: DoIP (Diagnostics over IP) communication transport. +# TLS backend is selected via //:tls_backend config flag (openssl or mbedtls). + +load("@rules_rust//rust:defs.bzl", "rust_library") + +package(default_visibility = ["//visibility:public"]) + +rust_library( + name = "cda-comm-doip", + srcs = glob(["src/**/*.rs"]), + crate_features = select({ + "//:use_openssl": ["openssl"], + "//:use_mbedtls": ["mbedtls"], + }), + crate_name = "cda_comm_doip", + deps = [ + "//cda-interfaces", + "@crate_index//:doip-codec", + "@crate_index//:doip-definitions", + "@crate_index//:futures", + "@crate_index//:schemars", + "@crate_index//:serde", + "@crate_index//:socket2", + "@crate_index//:thiserror", + "@crate_index//:tokio", + "@crate_index//:tokio-util", + "@crate_index//:tracing", + ] + select({ + "//:use_openssl": [ + "@crate_index//:openssl", + "@crate_index//:tokio-openssl", + ], + "//:use_mbedtls": [ + "//comm-mbedtls/mbedtls-rs", + ], + }), +) diff --git a/cda-comm-uds/BUILD.bazel b/cda-comm-uds/BUILD.bazel new file mode 100644 index 000000000..c7ecd7b91 --- /dev/null +++ b/cda-comm-uds/BUILD.bazel @@ -0,0 +1,33 @@ +# SPDX-License-Identifier: Apache-2.0 +# SPDX-FileCopyrightText: 2025 The Contributors to Eclipse OpenSOVD (see CONTRIBUTORS) +# +# See the NOTICE file(s) distributed with this work for additional +# information regarding copyright ownership. +# +# This program and the accompanying materials are made available under the +# terms of the Apache License Version 2.0 which is available at +# https://www.apache.org/licenses/LICENSE-2.0 + +# cda-comm-uds: UDS (Unified Diagnostic Services) messaging layer. + +load("@rules_rust//rust:defs.bzl", "rust_library") + +package(default_visibility = ["//visibility:public"]) + +rust_library( + name = "cda-comm-uds", + srcs = glob(["src/**/*.rs"]), + crate_name = "cda_comm_uds", + deps = [ + "//cda-interfaces", + "@crate_index//:futures", + "@crate_index//:serde_json", + "@crate_index//:socket2", + "@crate_index//:strum", + "@crate_index//:tokio", + "@crate_index//:tracing", + ], + proc_macro_deps = [ + "@crate_index//:async-trait", + ], +) diff --git a/cda-core/BUILD.bazel b/cda-core/BUILD.bazel new file mode 100644 index 000000000..4147b9f8c --- /dev/null +++ b/cda-core/BUILD.bazel @@ -0,0 +1,33 @@ +# SPDX-License-Identifier: Apache-2.0 +# SPDX-FileCopyrightText: 2025 The Contributors to Eclipse OpenSOVD (see CONTRIBUTORS) +# +# See the NOTICE file(s) distributed with this work for additional +# information regarding copyright ownership. +# +# This program and the accompanying materials are made available under the +# terms of the Apache License Version 2.0 which is available at +# https://www.apache.org/licenses/LICENSE-2.0 + +# cda-core: Diagnostic core logic and orchestration. + +load("@rules_rust//rust:defs.bzl", "rust_library") + +package(default_visibility = ["//visibility:public"]) + +rust_library( + name = "cda-core", + srcs = glob(["src/**/*.rs"]), + crate_name = "cda_core", + deps = [ + "//cda-database", + "//cda-interfaces", + "//cda-plugin-security", + "@crate_index//:num-traits", + "@crate_index//:parking_lot", + "@crate_index//:schemars", + "@crate_index//:serde", + "@crate_index//:serde_json", + "@crate_index//:tokio", + "@crate_index//:tracing", + ], +) diff --git a/cda-database/BUILD.bazel b/cda-database/BUILD.bazel new file mode 100644 index 000000000..0db20b9ce --- /dev/null +++ b/cda-database/BUILD.bazel @@ -0,0 +1,50 @@ +# SPDX-License-Identifier: Apache-2.0 +# SPDX-FileCopyrightText: 2025 The Contributors to Eclipse OpenSOVD (see CONTRIBUTORS) +# +# See the NOTICE file(s) distributed with this work for additional +# information regarding copyright ownership. +# +# This program and the accompanying materials are made available under the +# terms of the Apache License Version 2.0 which is available at +# https://www.apache.org/licenses/LICENSE-2.0 + +# cda-database: ECU database layer for loading/querying diagnostic data (ODX/PDX). + +load("@rules_rust//cargo:defs.bzl", "cargo_build_script") +load("@rules_rust//rust:defs.bzl", "rust_library") + +package(default_visibility = ["//visibility:public"]) + +cargo_build_script( + name = "build_script", + srcs = ["build.rs"], + deps = [ + "//cda-build", + "@crate_index//:cargo_toml", + "@crate_index//:prost-build", + "@crate_index//:toml", + ], +) + +rust_library( + name = "cda-database", + srcs = glob(["src/**/*.rs"]), + crate_name = "cda_database", + deps = [ + ":build_script", + "//cda-interfaces", + "@crate_index//:bytes", + "@crate_index//:flatbuffers", + "@crate_index//:memmap2", + "@crate_index//:ouroboros", + "@crate_index//:prost", + "@crate_index//:schemars", + "@crate_index//:serde", + "@crate_index//:serde_json", + "@crate_index//:sha2", + "@crate_index//:tokio", + "@crate_index//:tracing", + "@crate_index//:uuid", + "@crate_index//:xz2", + ], +) diff --git a/cda-extra/BUILD.bazel b/cda-extra/BUILD.bazel new file mode 100644 index 000000000..a7386f24b --- /dev/null +++ b/cda-extra/BUILD.bazel @@ -0,0 +1,25 @@ +# SPDX-License-Identifier: Apache-2.0 +# SPDX-FileCopyrightText: 2025 The Contributors to Eclipse OpenSOVD (see CONTRIBUTORS) +# +# See the NOTICE file(s) distributed with this work for additional +# information regarding copyright ownership. +# +# This program and the accompanying materials are made available under the +# terms of the Apache License Version 2.0 which is available at +# https://www.apache.org/licenses/LICENSE-2.0 + +# cda-extra: Optional platform extras (e.g., systemd notify). +# By default all deps are optional; the systemd-notify feature enables them. + +load("@rules_rust//rust:defs.bzl", "rust_library") + +package(default_visibility = ["//visibility:public"]) + +rust_library( + name = "cda-extra", + srcs = glob(["src/**/*.rs"]), + crate_name = "cda_extra", + # No features enabled by default -- systemd-notify is Linux-only. + # Enable via crate_features = ["systemd-notify"] if needed. + deps = [], +) diff --git a/cda-health/BUILD.bazel b/cda-health/BUILD.bazel new file mode 100644 index 000000000..7a07b43c6 --- /dev/null +++ b/cda-health/BUILD.bazel @@ -0,0 +1,36 @@ +# SPDX-License-Identifier: Apache-2.0 +# SPDX-FileCopyrightText: 2025 The Contributors to Eclipse OpenSOVD (see CONTRIBUTORS) +# +# See the NOTICE file(s) distributed with this work for additional +# information regarding copyright ownership. +# +# This program and the accompanying materials are made available under the +# terms of the Apache License Version 2.0 which is available at +# https://www.apache.org/licenses/LICENSE-2.0 + +# cda-health: Health check interface for monitoring service status. + +load("@rules_rust//rust:defs.bzl", "rust_library") + +package(default_visibility = ["//visibility:public"]) + +rust_library( + name = "cda-health", + srcs = glob(["src/**/*.rs"]), + crate_name = "cda_health", + deps = [ + "//cda-interfaces", + "//cda-sovd", + "@crate_index//:aide", + "@crate_index//:axum", + "@crate_index//:chrono", + "@crate_index//:futures", + "@crate_index//:schemars", + "@crate_index//:serde", + "@crate_index//:thiserror", + "@crate_index//:tokio", + ], + proc_macro_deps = [ + "@crate_index//:async-trait", + ], +) diff --git a/cda-interfaces/BUILD.bazel b/cda-interfaces/BUILD.bazel new file mode 100644 index 000000000..8892a7dc3 --- /dev/null +++ b/cda-interfaces/BUILD.bazel @@ -0,0 +1,38 @@ +# SPDX-License-Identifier: Apache-2.0 +# SPDX-FileCopyrightText: 2025 The Contributors to Eclipse OpenSOVD (see CONTRIBUTORS) +# +# See the NOTICE file(s) distributed with this work for additional +# information regarding copyright ownership. +# +# This program and the accompanying materials are made available under the +# terms of the Apache License Version 2.0 which is available at +# https://www.apache.org/licenses/LICENSE-2.0 + +# cda-interfaces: Shared interfaces and types used across CDA crates. + +load("@rules_rust//rust:defs.bzl", "rust_library") + +package(default_visibility = ["//visibility:public"]) + +rust_library( + name = "cda-interfaces", + srcs = glob(["src/**/*.rs"]), + crate_name = "cda_interfaces", + deps = [ + "@crate_index//:bytes", + "@crate_index//:foldhash", + "@crate_index//:hex", + "@crate_index//:parking_lot", + "@crate_index//:schemars", + "@crate_index//:serde", + "@crate_index//:serde_json", + "@crate_index//:strum", + "@crate_index//:thiserror", + "@crate_index//:tokio", + "@crate_index//:tracing", + ], + proc_macro_deps = [ + "@crate_index//:async-trait", + "@crate_index//:strum_macros", + ], +) diff --git a/cda-main/BUILD.bazel b/cda-main/BUILD.bazel new file mode 100644 index 000000000..b4aba39d2 --- /dev/null +++ b/cda-main/BUILD.bazel @@ -0,0 +1,92 @@ +# SPDX-License-Identifier: Apache-2.0 +# SPDX-FileCopyrightText: 2025 The Contributors to Eclipse OpenSOVD (see CONTRIBUTORS) +# +# See the NOTICE file(s) distributed with this work for additional +# information regarding copyright ownership. +# +# This program and the accompanying materials are made available under the +# terms of the Apache License Version 2.0 which is available at +# https://www.apache.org/licenses/LICENSE-2.0 + +# cda-main: Main binary entry point for the CDA application. +# Builds the opensovd-cda binary and library. +# TLS backend is selected via //:tls_backend config flag. + +load("@rules_rust//cargo:defs.bzl", "cargo_build_script") +load("@rules_rust//rust:defs.bzl", "rust_binary", "rust_library") + +package(default_visibility = ["//visibility:public"]) + +cargo_build_script( + name = "build_script", + srcs = ["build.rs"], + build_script_env = { + # Provide deterministic build metadata. + # For production builds, override via --action_env or workspace_status_command. + "SOURCE_DATE_EPOCH": "0", + "SOURCE_GIT_SHA": "bazel", + }, + deps = [ + "@crate_index//:chrono", + ], +) + +rust_library( + name = "opensovd_cda_lib", + srcs = glob( + ["src/**/*.rs"], + exclude = ["src/main.rs"], + ), + crate_features = ["health"] + select({ + "//:use_openssl": ["openssl"], + "//:use_mbedtls": ["mbedtls"], + }), + crate_name = "opensovd_cda_lib", + deps = [ + ":build_script", + "//cda-comm-doip", + "//cda-comm-uds", + "//cda-core", + "//cda-database", + "//cda-health", + "//cda-interfaces", + "//cda-plugin-security", + "//cda-sovd", + "//cda-tracing", + "@crate_index//:clap", + "@crate_index//:figment", + "@crate_index//:futures", + "@crate_index//:mimalloc", + "@crate_index//:schemars", + "@crate_index//:serde", + "@crate_index//:serde_json", + "@crate_index//:thiserror", + "@crate_index//:tokio", + "@crate_index//:toml", + "@crate_index//:tracing", + "@crate_index//:tracing-subscriber", + ], +) + +rust_binary( + name = "opensovd-cda", + srcs = ["src/main.rs"], + crate_features = ["health"] + select({ + "//:use_openssl": ["openssl"], + "//:use_mbedtls": ["mbedtls"], + }), + deps = [ + ":build_script", + ":opensovd_cda_lib", + "//cda-core", + "//cda-health", + "//cda-interfaces", + "//cda-plugin-security", + "//cda-sovd", + "@crate_index//:clap", + "@crate_index//:futures", + "@crate_index//:serde_json", + "@crate_index//:tokio", + "@crate_index//:tracing", + ], +) diff --git a/cda-plugin-security/BUILD.bazel b/cda-plugin-security/BUILD.bazel new file mode 100644 index 000000000..a065a7218 --- /dev/null +++ b/cda-plugin-security/BUILD.bazel @@ -0,0 +1,39 @@ +# SPDX-License-Identifier: Apache-2.0 +# SPDX-FileCopyrightText: 2025 The Contributors to Eclipse OpenSOVD (see CONTRIBUTORS) +# +# See the NOTICE file(s) distributed with this work for additional +# information regarding copyright ownership. +# +# This program and the accompanying materials are made available under the +# terms of the Apache License Version 2.0 which is available at +# https://www.apache.org/licenses/LICENSE-2.0 + +# cda-plugin-security: Security plugin APIs for authentication and ECU security access. + +load("@rules_rust//rust:defs.bzl", "rust_library") + +package(default_visibility = ["//visibility:public"]) + +rust_library( + name = "cda-plugin-security", + srcs = glob(["src/**/*.rs"]), + crate_name = "cda_plugin_security", + deps = [ + "//cda-database", + "//cda-interfaces", + "//cda-sovd-interfaces:sovd-interfaces", + "@crate_index//:aide", + "@crate_index//:axum", + "@crate_index//:axum-extra", + "@crate_index//:http", + "@crate_index//:jsonwebtoken", + "@crate_index//:schemars", + "@crate_index//:serde", + "@crate_index//:serde_json", + "@crate_index//:thiserror", + "@crate_index//:tracing", + ], + proc_macro_deps = [ + "@crate_index//:async-trait", + ], +) diff --git a/cda-sovd-interfaces/BUILD.bazel b/cda-sovd-interfaces/BUILD.bazel new file mode 100644 index 000000000..42e741319 --- /dev/null +++ b/cda-sovd-interfaces/BUILD.bazel @@ -0,0 +1,29 @@ +# SPDX-License-Identifier: Apache-2.0 +# SPDX-FileCopyrightText: 2025 The Contributors to Eclipse OpenSOVD (see CONTRIBUTORS) +# +# See the NOTICE file(s) distributed with this work for additional +# information regarding copyright ownership. +# +# This program and the accompanying materials are made available under the +# terms of the Apache License Version 2.0 which is available at +# https://www.apache.org/licenses/LICENSE-2.0 + +# sovd-interfaces: Data models and trait definitions for SOVD API resources. + +load("@rules_rust//rust:defs.bzl", "rust_library") + +package(default_visibility = ["//visibility:public"]) + +rust_library( + name = "sovd-interfaces", + srcs = glob(["src/**/*.rs"]), + crate_name = "sovd_interfaces", + deps = [ + "//cda-interfaces", + "@crate_index//:chrono", + "@crate_index//:schemars", + "@crate_index//:serde", + "@crate_index//:serde_json", + "@crate_index//:strum", + ], +) diff --git a/cda-sovd/BUILD.bazel b/cda-sovd/BUILD.bazel new file mode 100644 index 000000000..65efe5878 --- /dev/null +++ b/cda-sovd/BUILD.bazel @@ -0,0 +1,57 @@ +# SPDX-License-Identifier: Apache-2.0 +# SPDX-FileCopyrightText: 2025 The Contributors to Eclipse OpenSOVD (see CONTRIBUTORS) +# +# See the NOTICE file(s) distributed with this work for additional +# information regarding copyright ownership. +# +# This program and the accompanying materials are made available under the +# terms of the Apache License Version 2.0 which is available at +# https://www.apache.org/licenses/LICENSE-2.0 + +# cda-sovd: SOVD-compliant HTTP/REST server exposing the diagnostic API. + +load("@rules_rust//cargo:defs.bzl", "cargo_build_script") +load("@rules_rust//rust:defs.bzl", "rust_library") + +package(default_visibility = ["//visibility:public"]) + +cargo_build_script( + name = "build_script", + srcs = ["build.rs"], + deps = [ + "//cda-build", + ], +) + +rust_library( + name = "cda-sovd", + srcs = glob(["src/**/*.rs"]), + crate_name = "cda_sovd", + deps = [ + ":build_script", + "//cda-interfaces", + "//cda-plugin-security", + "//cda-sovd-interfaces:sovd-interfaces", + "//cda-tracing", + "//opensovd-axum-extra", + "@crate_index//:aide", + "@crate_index//:axum", + "@crate_index//:axum-extra", + "@crate_index//:chrono", + "@crate_index//:http", + "@crate_index//:indexmap", + "@crate_index//:mime", + "@crate_index//:percent-encoding", + "@crate_index//:regex", + "@crate_index//:schemars", + "@crate_index//:serde", + "@crate_index//:serde_json", + "@crate_index//:serde_qs", + "@crate_index//:thiserror", + "@crate_index//:tokio", + "@crate_index//:tower", + "@crate_index//:tower-http", + "@crate_index//:tracing", + "@crate_index//:uuid", + ], +) diff --git a/cda-tracing/BUILD.bazel b/cda-tracing/BUILD.bazel new file mode 100644 index 000000000..128ac8544 --- /dev/null +++ b/cda-tracing/BUILD.bazel @@ -0,0 +1,48 @@ +# SPDX-License-Identifier: Apache-2.0 +# SPDX-FileCopyrightText: 2025 The Contributors to Eclipse OpenSOVD (see CONTRIBUTORS) +# +# See the NOTICE file(s) distributed with this work for additional +# information regarding copyright ownership. +# +# This program and the accompanying materials are made available under the +# terms of the Apache License Version 2.0 which is available at +# https://www.apache.org/licenses/LICENSE-2.0 + +# cda-tracing: Logging, tracing, and OpenTelemetry setup. + +load("@rules_rust//cargo:defs.bzl", "cargo_build_script") +load("@rules_rust//rust:defs.bzl", "rust_library") + +package(default_visibility = ["//visibility:public"]) + +cargo_build_script( + name = "build_script", + srcs = ["build.rs"], + deps = [ + "//cda-build", + ], +) + +rust_library( + name = "cda-tracing", + srcs = glob(["src/**/*.rs"]), + crate_name = "cda_tracing", + deps = [ + ":build_script", + "@crate_index//:nu-ansi-term", + "@crate_index//:opentelemetry", + "@crate_index//:opentelemetry-otlp", + "@crate_index//:opentelemetry-semantic-conventions", + "@crate_index//:opentelemetry_sdk", + "@crate_index//:schemars", + "@crate_index//:serde", + "@crate_index//:strip-ansi-escapes", + "@crate_index//:thiserror", + "@crate_index//:tokio", + "@crate_index//:tracing", + "@crate_index//:tracing-appender", + "@crate_index//:tracing-core", + "@crate_index//:tracing-opentelemetry", + "@crate_index//:tracing-subscriber", + ], +) diff --git a/comm-mbedtls/mbedtls-rs/BUILD.bazel b/comm-mbedtls/mbedtls-rs/BUILD.bazel new file mode 100644 index 000000000..dedd99886 --- /dev/null +++ b/comm-mbedtls/mbedtls-rs/BUILD.bazel @@ -0,0 +1,31 @@ +# SPDX-License-Identifier: Apache-2.0 +# SPDX-FileCopyrightText: 2025 The Contributors to Eclipse OpenSOVD (see CONTRIBUTORS) +# +# See the NOTICE file(s) distributed with this work for additional +# information regarding copyright ownership. +# +# This program and the accompanying materials are made available under the +# terms of the Apache License Version 2.0 which is available at +# https://www.apache.org/licenses/LICENSE-2.0 + +# mbedtls-rs: Safe Rust wrapper around mbedtls with async (Tokio) TLS support. + +load("@rules_rust//rust:defs.bzl", "rust_library") + +package(default_visibility = ["//visibility:public"]) + +rust_library( + name = "mbedtls-rs", + srcs = glob(["src/**/*.rs"]), + crate_features = [ + "default", + "tokio", + ], + crate_name = "mbedtls_rs", + deps = [ + "//comm-mbedtls/mbedtls-sys", + "@crate_index//:ed25519-dalek", + "@crate_index//:tokio", + "@crate_index//:tracing", + ], +) diff --git a/comm-mbedtls/mbedtls-sys/BUILD.bazel b/comm-mbedtls/mbedtls-sys/BUILD.bazel new file mode 100644 index 000000000..e37860f2d --- /dev/null +++ b/comm-mbedtls/mbedtls-sys/BUILD.bazel @@ -0,0 +1,67 @@ +# SPDX-License-Identifier: Apache-2.0 +# SPDX-FileCopyrightText: 2025 The Contributors to Eclipse OpenSOVD (see CONTRIBUTORS) +# +# See the NOTICE file(s) distributed with this work for additional +# information regarding copyright ownership. +# +# This program and the accompanying materials are made available under the +# terms of the Apache License Version 2.0 which is available at +# https://www.apache.org/licenses/LICENSE-2.0 + +# mbedtls-sys: Raw FFI bindings to mbedtls 4.0.0. +# +# In Bazel, the native mbedtls libraries are built by //third_party/mbedtls:mbedtls +# via rules_foreign_cc. The build.rs (cargo_build_script) only runs bindgen to generate +# Rust FFI bindings -- cmake/cc steps are skipped via MBEDTLS_SKIP_BUILD=1. + +load("@rules_rust//cargo:defs.bzl", "cargo_build_script") +load("@rules_rust//rust:defs.bzl", "rust_library") + +package(default_visibility = ["//visibility:public"]) + +# Export C source files for //third_party/mbedtls:ed25519_psa_driver +exports_files([ + "csrc/ed25519_extract.h", + "csrc/ed25519_psa_driver.c", + "csrc/ed25519_psa_driver.h", + "wrapper.h", +]) + +cargo_build_script( + name = "build_script", + srcs = ["build.rs"], + build_script_env = { + "MBEDTLS_DIR": "$(execpath @mbedtls//:CMakeLists.txt)", + "MBEDTLS_SKIP_BUILD": "1", + "MBEDTLS_SKIP_PATCH": "1", + # Explicit path to wrapper.h for bindgen (sandbox-safe) + "MBEDTLS_WRAPPER_H": "$(execpath wrapper.h)", + }, + data = [ + "wrapper.h", + "@mbedtls//:CMakeLists.txt", + "@mbedtls//:all_srcs", + ] + glob(["csrc/**"]), + deps = [ + "@crate_index//:bindgen", + "@crate_index//:bzip2", + "@crate_index//:cc", + "@crate_index//:cmake", + "@crate_index//:const_format", + "@crate_index//:diffy", + "@crate_index//:sha256", + "@crate_index//:tar", + "@crate_index//:ureq", + ], +) + +rust_library( + name = "mbedtls-sys", + srcs = glob(["src/**/*.rs"]), + crate_name = "mbedtls_sys", + deps = [ + ":build_script", + "//third_party/mbedtls", + "//third_party/mbedtls:ed25519_psa_driver", + ], +) diff --git a/comm-mbedtls/mbedtls-sys/build.rs b/comm-mbedtls/mbedtls-sys/build.rs index b8acfa3e5..b5d6e0982 100644 --- a/comm-mbedtls/mbedtls-sys/build.rs +++ b/comm-mbedtls/mbedtls-sys/build.rs @@ -25,6 +25,8 @@ const TARBALL_SHA: &str = "2f3a47f7b3a541ddef450e4867eeecb7ce2ef7776093f3a11d6d4 const MBEDTLS_SOURCE_OVERRIDE_VAR: &str = "MBEDTLS_DIR"; const MBEDTLS_SKIP_PATCH_VAR: &str = "MBEDTLS_SKIP_PATCH"; +const MBEDTLS_SKIP_BUILD_VAR: &str = "MBEDTLS_SKIP_BUILD"; +const MBEDTLS_WRAPPER_H_VAR: &str = "MBEDTLS_WRAPPER_H"; /// The build script takes care of compiling mbedtls and creating up to date binaries. /// It additionally applies the patches for supporting record size limit on TLS 1.2 as well as @@ -36,16 +38,22 @@ const MBEDTLS_SKIP_PATCH_VAR: &str = "MBEDTLS_SKIP_PATCH"; /// The build can be customized with following environment variables /// - `BINDGEN_SYSROOT`: provide the path to a sysroot for bindgen. Required when cross-compiling /// using a SDK. -/// - `MBEDTLS_DIR`: provide the path to the mbedtls source code. This avoids fetching the tarball -/// during build. +/// - `MBEDTLS_DIR`: provide the path to the mbedtls source code directory (or a file within it, +/// e.g. `CMakeLists.txt`). This avoids fetching the tarball during build. /// - `MBEDTLS_SKIP_PATCH`: skip the tls1.2 record-size-limit and ed25519-psa-driver patches +/// - `MBEDTLS_SKIP_BUILD`: skip the cmake and cc compilation steps. When set to "1", the build +/// script only generates Rust FFI bindings via bindgen. Native libraries must be provided +/// externally (e.g., via Bazel `cc_library` / `rules_foreign_cc` targets). Link directives +/// are NOT emitted -- the external build system is responsible for linking. +/// - `MBEDTLS_WRAPPER_H`: explicit path to `wrapper.h` for bindgen. Used by Bazel to pass a +/// sandbox-safe `$(execpath)`. Falls back to `$CARGO_MANIFEST_DIR/wrapper.h` when unset. fn main() { let manifest_dir = PathBuf::from(env!("CARGO_MANIFEST_DIR")); // Download + patch mbedtls if not already present. - ensure_mbedtls_source(&manifest_dir); + // Returns the resolved path to the mbedtls source directory. + let mbedtls_src = ensure_mbedtls_source(&manifest_dir); - let mbedtls_src = manifest_dir.join(format!("mbedtls-{MBEDTLS_VERSION}")); let out_dir = PathBuf::from( env::var("OUT_DIR") .expect("OUT_DIR environment variable not set - build script must be run by Cargo"), @@ -56,9 +64,30 @@ fn main() { println!("cargo:rerun-if-changed=patches"); println!("cargo:rerun-if-changed=csrc"); println!("cargo:rerun-if-changed=build.rs"); + println!("cargo:rerun-if-env-changed={MBEDTLS_WRAPPER_H_VAR}"); + let skip_build = env::var(MBEDTLS_SKIP_BUILD_VAR) + .map(|v| v == "1") + .unwrap_or(false); + + if skip_build { + // External build system (e.g., Bazel with rules_foreign_cc) provides the + // pre-built native libraries. Only generate Rust FFI bindings via bindgen. + // Link directives are handled by the external build system's cc_library deps. + eprintln!("Skipping cmake/cc build as requested by {MBEDTLS_SKIP_BUILD_VAR}=1"); + generate_bindings(&mbedtls_src, &manifest_dir, &out_dir); + return; + } + + build_mbedtls(&mbedtls_src, &manifest_dir, &out_dir); + generate_bindings(&mbedtls_src, &manifest_dir, &out_dir); +} + +/// Compile mbedtls via cmake and the Ed25519 PSA driver via cc, then emit +/// the necessary `cargo:rustc-link-*` directives. +fn build_mbedtls(mbedtls_src: &Path, manifest_dir: &Path, out_dir: &Path) { // build mbedtls - cmake::Config::new(&mbedtls_src) + cmake::Config::new(mbedtls_src) .define("USE_STATIC_MBEDTLS_LIBRARY", "ON") .define("USE_SHARED_MBEDTLS_LIBRARY", "OFF") .define("ENABLE_TESTING", "OFF") @@ -103,8 +132,10 @@ fn main() { .include(mbedtls_src.join("include")) .warnings(false) .compile("ed25519_psa_driver"); +} - // generate rust bindings for mbedtls +/// Generate Rust FFI bindings for mbedtls via bindgen. +fn generate_bindings(mbedtls_src: &Path, manifest_dir: &Path, out_dir: &Path) { let include_paths: Vec = vec![ mbedtls_src.join("include"), mbedtls_src.join("tf-psa-crypto").join("include"), @@ -122,8 +153,14 @@ fn main() { .join("src"), ]; + // Resolve wrapper.h: if MBEDTLS_WRAPPER_H_VAR is not set, + // fall back to manifest_dir for plain cargo builds. + let wrapper_h = env::var(MBEDTLS_WRAPPER_H_VAR) + .map(PathBuf::from) + .unwrap_or_else(|_| manifest_dir.join("wrapper.h")); + let mut builder = bindgen::Builder::default() - .header(manifest_dir.join("wrapper.h").to_string_lossy()) + .header(wrapper_h.to_string_lossy()) .allowlist_function("mbedtls_.*") .allowlist_function("psa_.*") .allowlist_type("mbedtls_.*") @@ -260,16 +297,27 @@ fn apply_patch(patch_file: &Path, work_dir: &Path) { } } -/// Ensure `mbedtls-4.0.0/` exists in `workspace_dir`, downloading and -/// patching it if necessary. -fn ensure_mbedtls_source(workspace_dir: &Path) { +/// Ensure the mbedtls source is available, downloading and patching it if necessary. +/// +/// Returns the path to the root of the mbedtls source directory. +fn ensure_mbedtls_source(workspace_dir: &Path) -> PathBuf { let prefetched_source_var = std::env::var(MBEDTLS_SOURCE_OVERRIDE_VAR).ok(); let skip_src_patch = std::env::var(MBEDTLS_SKIP_PATCH_VAR) .map(|v| v == "1") .unwrap_or(false); - let mbedtls_dir = if let Some(dir) = prefetched_source_var { - PathBuf::from(dir) + let mbedtls_dir = if let Some(dir_or_file) = prefetched_source_var { + let path = PathBuf::from(&dir_or_file); + // Support both directory paths and paths to files within the source + // tree (e.g., when Bazel passes an execpath to CMakeLists.txt via + // MBEDTLS_DIR). In the latter case, derive the parent directory. + if path.is_file() { + path.parent() + .expect("MBEDTLS_DIR points to a file with no parent directory") + .to_path_buf() + } else { + path + } } else { let dir = workspace_dir.join(format!("mbedtls-{MBEDTLS_VERSION}")); if !dir.join("CMakeLists.txt").exists() { @@ -291,12 +339,12 @@ fn ensure_mbedtls_source(workspace_dir: &Path) { if skip_src_patch { eprintln!("Skipping source patches as requested by {MBEDTLS_SKIP_PATCH_VAR}=1"); - return; + return mbedtls_dir; } if mbedtls_dir.join(".patch_marker").exists() { eprintln!("Source already patched, skipping patching."); - return; + return mbedtls_dir; } // Patches are applied relative to the parent of the mbedtls source tree so @@ -338,4 +386,5 @@ fn ensure_mbedtls_source(workspace_dir: &Path) { .expect("Failed to write patch marker file"); eprintln!("mbedtls {MBEDTLS_VERSION} ready."); + mbedtls_dir } diff --git a/comm-mbedtls/mbedtls-sys/patches/BUILD.bazel b/comm-mbedtls/mbedtls-sys/patches/BUILD.bazel new file mode 100644 index 000000000..addc2aa00 --- /dev/null +++ b/comm-mbedtls/mbedtls-sys/patches/BUILD.bazel @@ -0,0 +1,18 @@ +# SPDX-License-Identifier: Apache-2.0 +# SPDX-FileCopyrightText: 2025 The Contributors to Eclipse OpenSOVD (see CONTRIBUTORS) +# +# See the NOTICE file(s) distributed with this work for additional +# information regarding copyright ownership. +# +# This program and the accompanying materials are made available under the +# terms of the Apache License Version 2.0 which is available at +# https://www.apache.org/licenses/LICENSE-2.0 + +# Export patch files for the @mbedtls http_archive in MODULE.bazel. + +package(default_visibility = ["//visibility:public"]) + +exports_files([ + "ed25519-psa-driver.patch", + "record-size-limit-tls12.patch", +]) diff --git a/opensovd-axum-extra/BUILD.bazel b/opensovd-axum-extra/BUILD.bazel new file mode 100644 index 000000000..c044f7b75 --- /dev/null +++ b/opensovd-axum-extra/BUILD.bazel @@ -0,0 +1,33 @@ +# SPDX-License-Identifier: Apache-2.0 +# SPDX-FileCopyrightText: 2025 The Contributors to Eclipse OpenSOVD (see CONTRIBUTORS) +# +# See the NOTICE file(s) distributed with this work for additional +# information regarding copyright ownership. +# +# This program and the accompanying materials are made available under the +# terms of the Apache License Version 2.0 which is available at +# https://www.apache.org/licenses/LICENSE-2.0 + +# opensovd-axum-extra: Optional axum extractors for host source detection. + +load("@rules_rust//rust:defs.bzl", "rust_library") + +package(default_visibility = ["//visibility:public"]) + +rust_library( + name = "opensovd-axum-extra", + srcs = glob(["src/**/*.rs"]), + crate_features = [ + "default", + "forwarded", + "host-header", + "uri-authority", + "x-forwarded-host", + ], + crate_name = "opensovd_axum_extra", + deps = [ + "@crate_index//:aide", + "@crate_index//:axum", + "@crate_index//:http", + ], +) diff --git a/third_party/BUILD.bazel b/third_party/BUILD.bazel new file mode 100644 index 000000000..e8dbc4ea6 --- /dev/null +++ b/third_party/BUILD.bazel @@ -0,0 +1,11 @@ +# SPDX-License-Identifier: Apache-2.0 +# SPDX-FileCopyrightText: 2025 The Contributors to Eclipse OpenSOVD (see CONTRIBUTORS) +# +# See the NOTICE file(s) distributed with this work for additional +# information regarding copyright ownership. +# +# This program and the accompanying materials are made available under the +# terms of the Apache License Version 2.0 which is available at +# https://www.apache.org/licenses/LICENSE-2.0 + +# Package boundary for third_party/. diff --git a/third_party/mbedtls/BUILD.bazel b/third_party/mbedtls/BUILD.bazel new file mode 100644 index 000000000..61f5aeeb3 --- /dev/null +++ b/third_party/mbedtls/BUILD.bazel @@ -0,0 +1,56 @@ +# SPDX-License-Identifier: Apache-2.0 +# SPDX-FileCopyrightText: 2025 The Contributors to Eclipse OpenSOVD (see CONTRIBUTORS) +# +# See the NOTICE file(s) distributed with this work for additional +# information regarding copyright ownership. +# +# This program and the accompanying materials are made available under the +# terms of the Apache License Version 2.0 which is available at +# https://www.apache.org/licenses/LICENSE-2.0 + +# Build mbedtls 4.0.0 from source via cmake (rules_foreign_cc). +# The source is pre-fetched and patched by the @mbedtls http_archive in MODULE.bazel. + +load("@rules_cc//cc:cc_library.bzl", "cc_library") +load("@rules_foreign_cc//foreign_cc:defs.bzl", "cmake") + +package(default_visibility = ["//visibility:public"]) + +cmake( + name = "mbedtls", + build_data = [ + "//comm-mbedtls/mbedtls-sys:csrc/ed25519_extract.h", + "//comm-mbedtls/mbedtls-sys:csrc/ed25519_psa_driver.h", + ], + cache_entries = { + # Force ar instead of libtool to avoid rules_foreign_cc wrapper issues on macOS + "CMAKE_AR": "/usr/bin/ar", + "CMAKE_C_FLAGS": "-DMBEDTLS_SSL_RECORD_SIZE_LIMIT -DMBEDTLS_SSL_NULL_CIPHERSUITES -DMBEDTLS_ED25519_PSA_DRIVER -I$$EXT_BUILD_ROOT$$/comm-mbedtls/mbedtls-sys/csrc", + "ENABLE_PROGRAMS": "OFF", + "ENABLE_TESTING": "OFF", + "GEN_FILES": "OFF", + "MBEDTLS_FATAL_WARNINGS": "OFF", + "USE_SHARED_MBEDTLS_LIBRARY": "OFF", + "USE_STATIC_MBEDTLS_LIBRARY": "ON", + }, + # Use Ninja to avoid macOS libtool wrapper issues with rules_foreign_cc + generate_args = ["-GNinja"], + lib_source = "@mbedtls//:all_srcs", + out_static_libs = [ + "libmbedtls.a", + "libmbedx509.a", + "libtfpsacrypto.a", + ], +) + +# Custom Ed25519 PSA accelerator driver (compiled from CDA source) +cc_library( + name = "ed25519_psa_driver", + srcs = ["//comm-mbedtls/mbedtls-sys:csrc/ed25519_psa_driver.c"], + hdrs = [ + "//comm-mbedtls/mbedtls-sys:csrc/ed25519_extract.h", + "//comm-mbedtls/mbedtls-sys:csrc/ed25519_psa_driver.h", + ], + copts = ["-DMBEDTLS_ED25519_PSA_DRIVER"], + deps = [":mbedtls"], +) diff --git a/third_party/mbedtls/overlay/BUILD.bazel b/third_party/mbedtls/overlay/BUILD.bazel new file mode 100644 index 000000000..6e487a1ae --- /dev/null +++ b/third_party/mbedtls/overlay/BUILD.bazel @@ -0,0 +1,21 @@ +# SPDX-License-Identifier: Apache-2.0 +# SPDX-FileCopyrightText: 2025 The Contributors to Eclipse OpenSOVD (see CONTRIBUTORS) +# +# See the NOTICE file(s) distributed with this work for additional +# information regarding copyright ownership. +# +# This program and the accompanying materials are made available under the +# terms of the Apache License Version 2.0 which is available at +# https://www.apache.org/licenses/LICENSE-2.0 + +# Overlay BUILD file applied to the @mbedtls http_archive. +# Exposes all mbedtls source files for the cmake build rule. + +package(default_visibility = ["//visibility:public"]) + +exports_files(["CMakeLists.txt"]) + +filegroup( + name = "all_srcs", + srcs = glob(["**"]), +) From 17cc57b160989232322c7edee69a463b0cc604e0 Mon Sep 17 00:00:00 2001 From: Elena Gantner Date: Wed, 20 May 2026 15:13:11 +0200 Subject: [PATCH 02/14] mbedtls: add alwayslink to fix linking on linux Signed-off-by: Elena Gantner --- third_party/mbedtls/BUILD.bazel | 5 ++++- 1 file changed, 4 insertions(+), 1 deletion(-) diff --git a/third_party/mbedtls/BUILD.bazel b/third_party/mbedtls/BUILD.bazel index 61f5aeeb3..20ec51de0 100644 --- a/third_party/mbedtls/BUILD.bazel +++ b/third_party/mbedtls/BUILD.bazel @@ -43,7 +43,9 @@ cmake( ], ) -# Custom Ed25519 PSA accelerator driver (compiled from CDA source) +# Custom Ed25519 PSA accelerator driver (compiled from CDA source). +# alwayslink ensures symbols are available to libtfpsacrypto regardless of +# link order (tfpsacrypto references ed25519_psa_import_key etc.). cc_library( name = "ed25519_psa_driver", srcs = ["//comm-mbedtls/mbedtls-sys:csrc/ed25519_psa_driver.c"], @@ -51,6 +53,7 @@ cc_library( "//comm-mbedtls/mbedtls-sys:csrc/ed25519_extract.h", "//comm-mbedtls/mbedtls-sys:csrc/ed25519_psa_driver.h", ], + alwayslink = True, copts = ["-DMBEDTLS_ED25519_PSA_DRIVER"], deps = [":mbedtls"], ) From 82a88628ebdc69cee95c0ab6472a6672eef2a378 Mon Sep 17 00:00:00 2001 From: Elena Gantner Date: Thu, 21 May 2026 15:17:22 +0200 Subject: [PATCH 03/14] PR review: add isolate=True for CDA crates universe Thanks @opajonk! Signed-off-by: Elena Gantner --- .bazelrc | 2 ++ MODULE.bazel | 18 +++++++++--------- 2 files changed, 11 insertions(+), 9 deletions(-) diff --git a/.bazelrc b/.bazelrc index 7b20e7a7d..f87626718 100644 --- a/.bazelrc +++ b/.bazelrc @@ -16,6 +16,8 @@ # --- Common settings --- common --enable_bzlmod +# enable experimental flag to allow private CDA crate universe +common --experimental_isolated_extension_usages build --incompatible_enable_cc_toolchain_resolution # --- TLS backend selection --- diff --git a/MODULE.bazel b/MODULE.bazel index 440a56c2d..c4e80bd0d 100644 --- a/MODULE.bazel +++ b/MODULE.bazel @@ -53,8 +53,9 @@ http_archive( ) # --- crate_universe: auto-generate Bazel targets for external Cargo dependencies --- -crate = use_extension("@rules_rust//crate_universe:extensions.bzl", "crate") - +# isolate = True gives CDA its own private crate universe, avoiding name clashes +# when CDA is consumed as a bazel_dep by other modules (e.g., Eclipse S-CORE). +crate = use_extension("@rules_rust//crate_universe:extensions.bzl", "crate", isolate = True) crate.from_cargo( name = "crate_index", cargo_lockfile = "//:Cargo.lock", @@ -63,28 +64,27 @@ crate.from_cargo( # mbedtls-sys: point build.rs at pre-fetched + pre-patched source, skip native build crate.annotation( - crate = "mbedtls-sys", build_script_data = [ "@mbedtls//:all_srcs", ], + build_script_data_glob = [ + "csrc/**", + "wrapper.h", + ], build_script_env = { "MBEDTLS_DIR": "$(execpath @mbedtls//:CMakeLists.txt)", "MBEDTLS_SKIP_BUILD": "1", "MBEDTLS_SKIP_PATCH": "1", }, - build_script_data_glob = [ - "csrc/**", - "wrapper.h", - ], + crate = "mbedtls-sys", ) # opensovd-cda (cda-main): provide deterministic build metadata for build.rs crate.annotation( - crate = "opensovd-cda", build_script_env = { "SOURCE_DATE_EPOCH": "0", "SOURCE_GIT_SHA": "bazel", }, + crate = "opensovd-cda", ) - use_repo(crate, "crate_index") From a27c988e48224f5facf3fd65f10fc9413840634c Mon Sep 17 00:00:00 2001 From: Elena Gantner Date: Thu, 21 May 2026 15:40:35 +0200 Subject: [PATCH 04/14] add rkyv to bazel deps Signed-off-by: Elena Gantner --- cda-interfaces/BUILD.bazel | 1 + 1 file changed, 1 insertion(+) diff --git a/cda-interfaces/BUILD.bazel b/cda-interfaces/BUILD.bazel index 8892a7dc3..98274e7db 100644 --- a/cda-interfaces/BUILD.bazel +++ b/cda-interfaces/BUILD.bazel @@ -23,6 +23,7 @@ rust_library( "@crate_index//:foldhash", "@crate_index//:hex", "@crate_index//:parking_lot", + "@crate_index//:rkyv", "@crate_index//:schemars", "@crate_index//:serde", "@crate_index//:serde_json", From af903a85e01356135087873cd765c94afa5aebd8 Mon Sep 17 00:00:00 2001 From: Elena Gantner Date: Thu, 21 May 2026 16:18:56 +0200 Subject: [PATCH 05/14] add all cargo.toml to manifests Signed-off-by: Elena Gantner --- MODULE.bazel | 22 +++++++++++++++++++++- cda-storage/BUILD.bazel | 34 ++++++++++++++++++++++++++++++++++ integration-tests/BUILD.bazel | 16 ++++++++++++++++ 3 files changed, 71 insertions(+), 1 deletion(-) create mode 100644 cda-storage/BUILD.bazel create mode 100644 integration-tests/BUILD.bazel diff --git a/MODULE.bazel b/MODULE.bazel index c4e80bd0d..40cbea6f0 100644 --- a/MODULE.bazel +++ b/MODULE.bazel @@ -59,7 +59,27 @@ crate = use_extension("@rules_rust//crate_universe:extensions.bzl", "crate", iso crate.from_cargo( name = "crate_index", cargo_lockfile = "//:Cargo.lock", - manifests = ["//:Cargo.toml"], + manifests = [ + "//:Cargo.toml", + "//cda-build:Cargo.toml", + "//cda-comm-doip:Cargo.toml", + "//cda-comm-uds:Cargo.toml", + "//cda-core:Cargo.toml", + "//cda-database:Cargo.toml", + "//cda-extra:Cargo.toml", + "//cda-health:Cargo.toml", + "//cda-interfaces:Cargo.toml", + "//cda-main:Cargo.toml", + "//cda-plugin-security:Cargo.toml", + "//cda-sovd:Cargo.toml", + "//cda-sovd-interfaces:Cargo.toml", + "//cda-storage:Cargo.toml", + "//cda-tracing:Cargo.toml", + "//comm-mbedtls/mbedtls-rs:Cargo.toml", + "//comm-mbedtls/mbedtls-sys:Cargo.toml", + "//integration-tests:Cargo.toml", + "//opensovd-axum-extra:Cargo.toml", + ], ) # mbedtls-sys: point build.rs at pre-fetched + pre-patched source, skip native build diff --git a/cda-storage/BUILD.bazel b/cda-storage/BUILD.bazel new file mode 100644 index 000000000..32022fc84 --- /dev/null +++ b/cda-storage/BUILD.bazel @@ -0,0 +1,34 @@ +# SPDX-License-Identifier: Apache-2.0 +# SPDX-FileCopyrightText: 2025 The Contributors to Eclipse OpenSOVD (see CONTRIBUTORS) +# +# See the NOTICE file(s) distributed with this work for additional +# information regarding copyright ownership. +# +# This program and the accompanying materials are made available under the +# terms of the Apache License Version 2.0 which is available at +# https://www.apache.org/licenses/LICENSE-2.0 + +# cda-storage: Storage access implementation for CDA. + +load("@rules_rust//rust:defs.bzl", "rust_library") + +package(default_visibility = ["//visibility:public"]) + +rust_library( + name = "cda-storage", + srcs = glob(["src/**/*.rs"]), + crate_name = "cda_storage", + deps = [ + "//cda-interfaces", + "@crate_index//:crc32fast", + "@crate_index//:rkyv", + "@crate_index//:serde", + "@crate_index//:thiserror", + "@crate_index//:tokio", + "@crate_index//:tracing", + "@crate_index//:uuid", + ], + proc_macro_deps = [ + "@crate_index//:async-trait", + ], +) diff --git a/integration-tests/BUILD.bazel b/integration-tests/BUILD.bazel new file mode 100644 index 000000000..32fd2f824 --- /dev/null +++ b/integration-tests/BUILD.bazel @@ -0,0 +1,16 @@ +# SPDX-License-Identifier: Apache-2.0 +# SPDX-FileCopyrightText: 2025 The Contributors to Eclipse OpenSOVD (see CONTRIBUTORS) +# +# See the NOTICE file(s) distributed with this work for additional +# information regarding copyright ownership. +# +# This program and the accompanying materials are made available under the +# terms of the Apache License Version 2.0 which is available at +# https://www.apache.org/licenses/LICENSE-2.0 + +# integration-tests: End-to-end integration tests (not yet built with Bazel). +# This BUILD file exists so crate_universe can reference the Cargo.toml manifest. + +package(default_visibility = ["//visibility:public"]) + +exports_files(["Cargo.toml"]) From 8e36584b25b2b74abab0ce5fe01f5181cf1e8c9d Mon Sep 17 00:00:00 2001 From: Elena Gantner Date: Thu, 21 May 2026 19:13:41 +0200 Subject: [PATCH 06/14] remove transitive openssl dependency from graph Signed-off-by: Elena Gantner --- Cargo.toml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/Cargo.toml b/Cargo.toml index a0dd2c79b..c82543b5e 100644 --- a/Cargo.toml +++ b/Cargo.toml @@ -123,7 +123,7 @@ percent-encoding = "2.3.2" # ---- opentelemetry crates ---- opentelemetry = { version = "0.32.0", default-features = false } opentelemetry_sdk = { version = "0.32.1", default-features = false } -opentelemetry-otlp = "0.32.0" +opentelemetry-otlp = { version = "0.32.0", default-features = false } opentelemetry-semantic-conventions = "0.32.1" # ---- networking crates ---- From de797c32432f5610840d6a821a80c9f61c838c67 Mon Sep 17 00:00:00 2001 From: Elena Gantner Date: Thu, 21 May 2026 22:14:06 +0200 Subject: [PATCH 07/14] set rust edition explicitly on packages Signed-off-by: Elena Gantner --- cda-build/BUILD.bazel | 1 + cda-comm-doip/BUILD.bazel | 1 + cda-comm-uds/BUILD.bazel | 1 + cda-core/BUILD.bazel | 1 + cda-database/BUILD.bazel | 2 ++ cda-extra/BUILD.bazel | 1 + cda-health/BUILD.bazel | 1 + cda-interfaces/BUILD.bazel | 1 + cda-main/BUILD.bazel | 3 +++ cda-plugin-security/BUILD.bazel | 1 + cda-sovd-interfaces/BUILD.bazel | 1 + cda-sovd/BUILD.bazel | 2 ++ cda-storage/BUILD.bazel | 1 + cda-tracing/BUILD.bazel | 2 ++ comm-mbedtls/mbedtls-rs/BUILD.bazel | 1 + comm-mbedtls/mbedtls-sys/BUILD.bazel | 2 ++ opensovd-axum-extra/BUILD.bazel | 1 + 17 files changed, 23 insertions(+) diff --git a/cda-build/BUILD.bazel b/cda-build/BUILD.bazel index 6ac95c46e..b3bdfc67f 100644 --- a/cda-build/BUILD.bazel +++ b/cda-build/BUILD.bazel @@ -18,6 +18,7 @@ rust_library( name = "cda-build", srcs = glob(["src/**/*.rs"]), crate_name = "cda_build", + edition = "2024", proc_macro_deps = [ "@crate_index//:rustversion", ], diff --git a/cda-comm-doip/BUILD.bazel b/cda-comm-doip/BUILD.bazel index 2e16bb5e0..048a5deb4 100644 --- a/cda-comm-doip/BUILD.bazel +++ b/cda-comm-doip/BUILD.bazel @@ -18,6 +18,7 @@ package(default_visibility = ["//visibility:public"]) rust_library( name = "cda-comm-doip", srcs = glob(["src/**/*.rs"]), + edition = "2024", crate_features = select({ "//:use_openssl": ["openssl"], "//:use_mbedtls": ["mbedtls"], diff --git a/cda-comm-uds/BUILD.bazel b/cda-comm-uds/BUILD.bazel index c7ecd7b91..7cb3d4a1f 100644 --- a/cda-comm-uds/BUILD.bazel +++ b/cda-comm-uds/BUILD.bazel @@ -18,6 +18,7 @@ rust_library( name = "cda-comm-uds", srcs = glob(["src/**/*.rs"]), crate_name = "cda_comm_uds", + edition = "2024", deps = [ "//cda-interfaces", "@crate_index//:futures", diff --git a/cda-core/BUILD.bazel b/cda-core/BUILD.bazel index 4147b9f8c..a33d2ac3c 100644 --- a/cda-core/BUILD.bazel +++ b/cda-core/BUILD.bazel @@ -18,6 +18,7 @@ rust_library( name = "cda-core", srcs = glob(["src/**/*.rs"]), crate_name = "cda_core", + edition = "2024", deps = [ "//cda-database", "//cda-interfaces", diff --git a/cda-database/BUILD.bazel b/cda-database/BUILD.bazel index 0db20b9ce..adf8fcb5f 100644 --- a/cda-database/BUILD.bazel +++ b/cda-database/BUILD.bazel @@ -18,6 +18,7 @@ package(default_visibility = ["//visibility:public"]) cargo_build_script( name = "build_script", srcs = ["build.rs"], + edition = "2024", deps = [ "//cda-build", "@crate_index//:cargo_toml", @@ -30,6 +31,7 @@ rust_library( name = "cda-database", srcs = glob(["src/**/*.rs"]), crate_name = "cda_database", + edition = "2024", deps = [ ":build_script", "//cda-interfaces", diff --git a/cda-extra/BUILD.bazel b/cda-extra/BUILD.bazel index a7386f24b..c1228d84f 100644 --- a/cda-extra/BUILD.bazel +++ b/cda-extra/BUILD.bazel @@ -19,6 +19,7 @@ rust_library( name = "cda-extra", srcs = glob(["src/**/*.rs"]), crate_name = "cda_extra", + edition = "2024", # No features enabled by default -- systemd-notify is Linux-only. # Enable via crate_features = ["systemd-notify"] if needed. deps = [], diff --git a/cda-health/BUILD.bazel b/cda-health/BUILD.bazel index 7a07b43c6..7a140e5d6 100644 --- a/cda-health/BUILD.bazel +++ b/cda-health/BUILD.bazel @@ -18,6 +18,7 @@ rust_library( name = "cda-health", srcs = glob(["src/**/*.rs"]), crate_name = "cda_health", + edition = "2024", deps = [ "//cda-interfaces", "//cda-sovd", diff --git a/cda-interfaces/BUILD.bazel b/cda-interfaces/BUILD.bazel index 98274e7db..4ed3286eb 100644 --- a/cda-interfaces/BUILD.bazel +++ b/cda-interfaces/BUILD.bazel @@ -18,6 +18,7 @@ rust_library( name = "cda-interfaces", srcs = glob(["src/**/*.rs"]), crate_name = "cda_interfaces", + edition = "2024", deps = [ "@crate_index//:bytes", "@crate_index//:foldhash", diff --git a/cda-main/BUILD.bazel b/cda-main/BUILD.bazel index b4aba39d2..a7a4f8127 100644 --- a/cda-main/BUILD.bazel +++ b/cda-main/BUILD.bazel @@ -20,6 +20,7 @@ package(default_visibility = ["//visibility:public"]) cargo_build_script( name = "build_script", srcs = ["build.rs"], + edition = "2024", build_script_env = { # Provide deterministic build metadata. # For production builds, override via --action_env or workspace_status_command. @@ -37,6 +38,7 @@ rust_library( ["src/**/*.rs"], exclude = ["src/main.rs"], ), + edition = "2024", crate_features = ["health"] + select({ "//:use_openssl": ["openssl"], "//:use_mbedtls": ["mbedtls"], @@ -71,6 +73,7 @@ rust_library( rust_binary( name = "opensovd-cda", srcs = ["src/main.rs"], + edition = "2024", crate_features = ["health"] + select({ "//:use_openssl": ["openssl"], "//:use_mbedtls": ["mbedtls"], diff --git a/cda-plugin-security/BUILD.bazel b/cda-plugin-security/BUILD.bazel index a065a7218..720b07fe7 100644 --- a/cda-plugin-security/BUILD.bazel +++ b/cda-plugin-security/BUILD.bazel @@ -18,6 +18,7 @@ rust_library( name = "cda-plugin-security", srcs = glob(["src/**/*.rs"]), crate_name = "cda_plugin_security", + edition = "2024", deps = [ "//cda-database", "//cda-interfaces", diff --git a/cda-sovd-interfaces/BUILD.bazel b/cda-sovd-interfaces/BUILD.bazel index 42e741319..3f91a7264 100644 --- a/cda-sovd-interfaces/BUILD.bazel +++ b/cda-sovd-interfaces/BUILD.bazel @@ -18,6 +18,7 @@ rust_library( name = "sovd-interfaces", srcs = glob(["src/**/*.rs"]), crate_name = "sovd_interfaces", + edition = "2024", deps = [ "//cda-interfaces", "@crate_index//:chrono", diff --git a/cda-sovd/BUILD.bazel b/cda-sovd/BUILD.bazel index 65efe5878..91cdacf67 100644 --- a/cda-sovd/BUILD.bazel +++ b/cda-sovd/BUILD.bazel @@ -18,6 +18,7 @@ package(default_visibility = ["//visibility:public"]) cargo_build_script( name = "build_script", srcs = ["build.rs"], + edition = "2024", deps = [ "//cda-build", ], @@ -27,6 +28,7 @@ rust_library( name = "cda-sovd", srcs = glob(["src/**/*.rs"]), crate_name = "cda_sovd", + edition = "2024", deps = [ ":build_script", "//cda-interfaces", diff --git a/cda-storage/BUILD.bazel b/cda-storage/BUILD.bazel index 32022fc84..508934352 100644 --- a/cda-storage/BUILD.bazel +++ b/cda-storage/BUILD.bazel @@ -18,6 +18,7 @@ rust_library( name = "cda-storage", srcs = glob(["src/**/*.rs"]), crate_name = "cda_storage", + edition = "2024", deps = [ "//cda-interfaces", "@crate_index//:crc32fast", diff --git a/cda-tracing/BUILD.bazel b/cda-tracing/BUILD.bazel index 128ac8544..717b55a38 100644 --- a/cda-tracing/BUILD.bazel +++ b/cda-tracing/BUILD.bazel @@ -18,6 +18,7 @@ package(default_visibility = ["//visibility:public"]) cargo_build_script( name = "build_script", srcs = ["build.rs"], + edition = "2024", deps = [ "//cda-build", ], @@ -27,6 +28,7 @@ rust_library( name = "cda-tracing", srcs = glob(["src/**/*.rs"]), crate_name = "cda_tracing", + edition = "2024", deps = [ ":build_script", "@crate_index//:nu-ansi-term", diff --git a/comm-mbedtls/mbedtls-rs/BUILD.bazel b/comm-mbedtls/mbedtls-rs/BUILD.bazel index dedd99886..8429ff4e1 100644 --- a/comm-mbedtls/mbedtls-rs/BUILD.bazel +++ b/comm-mbedtls/mbedtls-rs/BUILD.bazel @@ -17,6 +17,7 @@ package(default_visibility = ["//visibility:public"]) rust_library( name = "mbedtls-rs", srcs = glob(["src/**/*.rs"]), + edition = "2024", crate_features = [ "default", "tokio", diff --git a/comm-mbedtls/mbedtls-sys/BUILD.bazel b/comm-mbedtls/mbedtls-sys/BUILD.bazel index e37860f2d..c26e5a5bb 100644 --- a/comm-mbedtls/mbedtls-sys/BUILD.bazel +++ b/comm-mbedtls/mbedtls-sys/BUILD.bazel @@ -30,6 +30,7 @@ exports_files([ cargo_build_script( name = "build_script", srcs = ["build.rs"], + edition = "2024", build_script_env = { "MBEDTLS_DIR": "$(execpath @mbedtls//:CMakeLists.txt)", "MBEDTLS_SKIP_BUILD": "1", @@ -59,6 +60,7 @@ rust_library( name = "mbedtls-sys", srcs = glob(["src/**/*.rs"]), crate_name = "mbedtls_sys", + edition = "2024", deps = [ ":build_script", "//third_party/mbedtls", diff --git a/opensovd-axum-extra/BUILD.bazel b/opensovd-axum-extra/BUILD.bazel index c044f7b75..26838c68e 100644 --- a/opensovd-axum-extra/BUILD.bazel +++ b/opensovd-axum-extra/BUILD.bazel @@ -17,6 +17,7 @@ package(default_visibility = ["//visibility:public"]) rust_library( name = "opensovd-axum-extra", srcs = glob(["src/**/*.rs"]), + edition = "2024", crate_features = [ "default", "forwarded", From 03fc952d7d259a38daa34e6463928858fe93c610 Mon Sep 17 00:00:00 2001 From: Frank Scholter Peres Date: Fri, 10 Jul 2026 12:59:26 +0000 Subject: [PATCH 08/14] add universe and optimized to alias and macro --- Cargo.lock | 1119 ++++++++++----------- MODULE.bazel | 22 +- bazel/rust_crate.bzl | 70 ++ cda-build/BUILD.bazel | 8 +- cda-comm-doip/BUILD.bazel | 24 +- cda-comm-uds/BUILD.bazel | 18 +- cda-core/BUILD.bazel | 14 +- cda-database/BUILD.bazel | 31 +- cda-extra/BUILD.bazel | 6 +- cda-health/BUILD.bazel | 18 +- cda-interfaces/BUILD.bazel | 23 +- cda-main/BUILD.bazel | 41 +- cda-main/Cargo.toml | 2 - cda-main/src/lib.rs | 1310 +++++++++++++------------ cda-plugin-runtime-update/BUILD.bazel | 24 + cda-plugin-security/BUILD.bazel | 20 +- cda-sovd-interfaces/BUILD.bazel | 14 +- cda-sovd/BUILD.bazel | 32 +- cda-storage/BUILD.bazel | 19 +- cda-tracing/BUILD.bazel | 30 +- cda-tracing/Cargo.toml | 2 +- comm-mbedtls/mbedtls-rs/BUILD.bazel | 12 +- comm-mbedtls/mbedtls-sys/BUILD.bazel | 22 +- opensovd-axum-extra/BUILD.bazel | 10 +- third_party/mbedtls/BUILD.bazel | 5 +- 25 files changed, 1347 insertions(+), 1549 deletions(-) create mode 100644 bazel/rust_crate.bzl create mode 100644 cda-plugin-runtime-update/BUILD.bazel diff --git a/Cargo.lock b/Cargo.lock index fac170068..9b2d4eb67 100644 --- a/Cargo.lock +++ b/Cargo.lock @@ -33,7 +33,7 @@ dependencies = [ "serde", "serde_json", "serde_qs", - "thiserror 2.0.17", + "thiserror", "tower-layer", "tower-service", "tracing", @@ -67,9 +67,9 @@ dependencies = [ [[package]] name = "anstream" -version = "0.6.21" +version = "1.0.0" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "43d5b281e737544384e969a5ccad3f1cdd24b48086a0fc1b2a5262a26b8f4f4a" +checksum = "824a212faf96e9acacdbd09febd34438f8f711fb84e09a8916013cd7815ca28d" dependencies = [ "anstyle", "anstyle-parse", @@ -82,15 +82,15 @@ dependencies = [ [[package]] name = "anstyle" -version = "1.0.13" +version = "1.0.14" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "5192cca8006f1fd4f7237516f40fa183bb07f8fbdfedaa0036de5ea9b0b45e78" +checksum = "940b3a0ca603d1eade50a4846a2afffd5ef57a9feac2c0e2ec2e14f9ead76000" [[package]] name = "anstyle-parse" -version = "0.2.7" +version = "1.0.0" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "4e7644824f0aa2c7b9384579234ef10eb7efb6a0deb83f9630a49594dd9c15c2" +checksum = "52ce7f38b242319f7cabaa6813055467063ecdc9d355bbb4ce0c68908cd8130e" dependencies = [ "utf8parse", ] @@ -117,9 +117,9 @@ dependencies = [ [[package]] name = "anyhow" -version = "1.0.100" +version = "1.0.103" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "a23eb6b1614318a8071c9b2521f36b424b2c83db5eb3a0fead4a6c0809af6e61" +checksum = "2a4385e2e34eb35d6b3efe798b9eb88096925d87726c0798709bf56d9ed84af3" [[package]] name = "async-trait" @@ -149,15 +149,15 @@ checksum = "1505bd5d3d116872e7271a6d4e16d81d0c8570876c8de68093a09ac269d8aac0" [[package]] name = "autocfg" -version = "1.5.0" +version = "1.5.1" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "c08606f8c3cbf4ce6ec8e28fb0014a2c086708fe954eaa885384a6165172e7e8" +checksum = "f2032f911046de80f0a198e0901378627c33f59ea0ac00e363d481118bd70a53" [[package]] name = "axum" -version = "0.8.7" +version = "0.8.9" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "5b098575ebe77cb6d14fc7f32749631a6e44edbef6b796f89b020e99ba20d425" +checksum = "31b698c5f9a010f6573133b09e0de5408834d0c82f8d7475a89fc1867a71cd90" dependencies = [ "axum-core", "bytes", @@ -189,9 +189,9 @@ dependencies = [ [[package]] name = "axum-core" -version = "0.5.5" +version = "0.5.6" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "59446ce19cd142f8833f856eb31f3eb097812d1479ab224f54d72428ca21ea22" +checksum = "08c78f31d7b1291f7ee735c1c6780ccde7785daae9a9206026862dab7d8792d1" dependencies = [ "bytes", "futures-core", @@ -208,9 +208,9 @@ dependencies = [ [[package]] name = "axum-extra" -version = "0.12.2" +version = "0.12.6" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "dbfe9f610fe4e99cf0cfcd03ccf8c63c28c616fe714d80475ef731f3b13dd21b" +checksum = "be44683b41ccb9ab2d23a5230015c9c3c55be97a25e4428366de8873103f7970" dependencies = [ "axum", "axum-core", @@ -248,9 +248,9 @@ checksum = "72b3254f16251a8381aa12e40e3c4d2f0199f8c6508fbecb9d91f575e0fbb8c6" [[package]] name = "base64ct" -version = "1.8.0" +version = "1.8.3" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "55248b47b0caf0546f7988906588779981c43bb1bc9d0c44087278f80cdb44ba" +checksum = "2af50177e190e07a26ab74f8b1efbfe2ef87da2116221318cb1c2e82baf7de06" [[package]] name = "bindgen" @@ -268,15 +268,15 @@ dependencies = [ "quote", "regex", "rustc-hash", - "shlex", + "shlex 1.3.0", "syn", ] [[package]] name = "bitflags" -version = "2.10.0" +version = "2.13.0" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "812e12b5285cc515a9c72a5c1d3b6d46a19dac5acfef5265968c166106e31dd3" +checksum = "b4388bee8683e3d04af747c73422af53102d2bd24d9eadb6cbc100baef4b43f8" [[package]] name = "block-buffer" @@ -289,9 +289,9 @@ dependencies = [ [[package]] name = "bumpalo" -version = "3.19.0" +version = "3.20.3" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "46c5e41b57b8bba42a04676d81cb89e9ee8e859a1a66f80a5a72e1cb76b34d43" +checksum = "72f5acc6cb2ba439de613abc23857ec3d78374d8ed5ac84e9d11336e87da8649" [[package]] name = "bytecheck" @@ -330,9 +330,9 @@ checksum = "1fd0f2584146f6f2ef48085050886acf353beff7305ebd1ae69500e27c67f64b" [[package]] name = "bytes" -version = "1.11.1" +version = "1.12.1" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "1e748733b7cbc798e1434b6ac524f0c1ff2ab456fe201501e6497c8417a4fc33" +checksum = "fc652a48c352aef3ea3aed32080501cf3ef6ed5da78602a020c991775b0aff04" [[package]] name = "bzip2" @@ -350,17 +350,17 @@ source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "374b7c592d9c00c1f4972ea58390ac6b18cbb6ab79011f3bdc90a0b82ca06b77" dependencies = [ "serde", - "toml 0.9.8", + "toml 0.9.12+spec-1.1.0", ] [[package]] name = "cc" -version = "1.2.47" +version = "1.2.66" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "cd405d82c84ff7f35739f175f67d8b9fb7687a0e84ccdc78bd3568839827cf07" +checksum = "f5d6cac793997bd970000024b2934968efe83b382de4fdcf4fcb46b6ee4ad996" dependencies = [ "find-msvc-tools", - "shlex", + "shlex 2.0.1", ] [[package]] @@ -384,7 +384,7 @@ dependencies = [ "serde", "serde_json", "socket2", - "thiserror 2.0.17", + "thiserror", "tokio", "tokio-openssl", "tokio-util", @@ -443,7 +443,7 @@ dependencies = [ "serde_json", "sha2", "tokio", - "toml 0.9.8", + "toml 0.9.12+spec-1.1.0", "tracing", "uuid", "xz2", @@ -473,7 +473,7 @@ dependencies = [ "futures", "schemars", "serde", - "thiserror 2.0.17", + "thiserror", "tokio", ] @@ -483,7 +483,7 @@ version = "0.1.0" dependencies = [ "async-trait", "bytes", - "foldhash", + "foldhash 0.2.0", "hex", "mockall", "parking_lot", @@ -493,7 +493,7 @@ dependencies = [ "serde_json", "strum", "strum_macros", - "thiserror 2.0.17", + "thiserror", "tokio", "tracing", ] @@ -513,7 +513,7 @@ dependencies = [ "sha2", "sovd-interfaces", "tempfile", - "thiserror 2.0.17", + "thiserror", "tokio", "tracing", "uuid", @@ -536,7 +536,7 @@ dependencies = [ "serde", "serde_json", "sovd-interfaces", - "thiserror 2.0.17", + "thiserror", "tracing", ] @@ -567,7 +567,7 @@ dependencies = [ "serde_json", "serde_qs", "sovd-interfaces", - "thiserror 2.0.17", + "thiserror", "tokio", "tower", "tower-http", @@ -585,7 +585,7 @@ dependencies = [ "rkyv", "serde", "tempfile", - "thiserror 2.0.17", + "thiserror", "tokio", "tracing", "uuid", @@ -605,7 +605,7 @@ dependencies = [ "schemars", "serde", "strip-ansi-escapes", - "thiserror 2.0.17", + "thiserror", "tokio", "tracing", "tracing-appender", @@ -632,9 +632,9 @@ checksum = "9330f8b2ff13f34540b44e946ef35111825727b38d33286ef986142615121801" [[package]] name = "chrono" -version = "0.4.43" +version = "0.4.45" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "fac4744fb15ae8337dc853fee7fb3f4e48c0fbaa23d0afe49c447b4fab126118" +checksum = "1aa79e62e7697b8e29b513a68abacf485adcd1fe8284a4316c5ae868e6633327" dependencies = [ "iana-time-zone", "js-sys", @@ -656,9 +656,9 @@ dependencies = [ [[package]] name = "clap" -version = "4.5.52" +version = "4.6.1" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "aa8120877db0e5c011242f96806ce3c94e0737ab8108532a76a3300a01db2ab8" +checksum = "1ddb117e43bbf7dacf0a4190fef4d345b9bad68dfc649cb349e7d17d28428e51" dependencies = [ "clap_builder", "clap_derive", @@ -666,9 +666,9 @@ dependencies = [ [[package]] name = "clap_builder" -version = "4.5.52" +version = "4.6.0" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "02576b399397b659c26064fbc92a75fede9d18ffd5f80ca1cd74ddab167016e1" +checksum = "714a53001bf66416adb0e2ef5ac857140e7dc3a0c48fb28b2f10762fc4b5069f" dependencies = [ "anstream", "anstyle", @@ -678,9 +678,9 @@ dependencies = [ [[package]] name = "clap_derive" -version = "4.5.49" +version = "4.6.1" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "2a0b5487afeab2deb2ff4e03a807ad1a03ac532ff5a2cee5d86884440c7f7671" +checksum = "f2ce8604710f6733aa641a2b3731eaa1e8b3d9973d5e3565da11800813f997a9" dependencies = [ "heck 0.5.0", "proc-macro2", @@ -690,24 +690,24 @@ dependencies = [ [[package]] name = "clap_lex" -version = "0.7.6" +version = "1.1.0" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "a1d728cc89cf3aee9ff92b05e62b19ee65a02b5702cff7d5a377e32c6ae29d8d" +checksum = "c8d4a3bb8b1e0c1050499d1815f5ab16d04f0959b233085fb31653fbfc9d98f9" [[package]] name = "cmake" -version = "0.1.57" +version = "0.1.58" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "75443c44cd6b379beb8c5b45d85d0773baf31cce901fe7bb252f4eff3008ef7d" +checksum = "c0f78a02292a74a88ac736019ab962ece0bc380e3f977bf72e376c5d78ff0678" dependencies = [ "cc", ] [[package]] name = "colorchoice" -version = "1.0.4" +version = "1.0.5" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "b05b61dc5112cbb17e4b6cd61790d9845d13888356391624cbe7e41efeac1e75" +checksum = "1d07550c9036bf2ae0c684c4297d503f838287c83c53686d05370d0e139ae570" [[package]] name = "console-api" @@ -757,11 +757,12 @@ checksum = "c2459377285ad874054d797f3ccebf984978aa39129f6eafde5cdc8315b612f8" [[package]] name = "const_format" -version = "0.2.35" +version = "0.2.36" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "7faa7469a93a566e9ccc1c73fe783b4a65c274c5ace346038dca9c39fe0030ad" +checksum = "4481a617ad9a412be3b97c5d403fef8ed023103368908b9c50af598ff467cc1e" dependencies = [ "const_format_proc_macros", + "konst", ] [[package]] @@ -821,18 +822,18 @@ dependencies = [ [[package]] name = "crossbeam-channel" -version = "0.5.15" +version = "0.5.16" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "82b8f8f868b36967f9606790d1903570de9ceaf870a7bf9fbbd3016d636a2cb2" +checksum = "d85363c37faeca707aef026efa9f3b34d077bce547e48f770770625c6013679e" dependencies = [ "crossbeam-utils", ] [[package]] name = "crossbeam-utils" -version = "0.8.21" +version = "0.8.22" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "d0a5c400df2834b80a4c3327b3aad3a4c4cd4de0629063962b03235697506a28" +checksum = "61803da095bee82a81bb1a452ecc25d3b2f1416d1897eb86430c6159ef717c17" [[package]] name = "crypto-bigint" @@ -931,30 +932,28 @@ dependencies = [ [[package]] name = "deranged" -version = "0.5.5" +version = "0.5.8" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "ececcb659e7ba858fb4f10388c250a7252eb0a27373f1a72b8748afdd248e587" -dependencies = [ - "powerfmt", -] +checksum = "7cd812cc2bc1d69d4764bd80df88b4317eaef9e773c75226407d9bc0876b211c" [[package]] name = "derive_more" -version = "2.0.1" +version = "2.1.1" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "093242cf7570c207c83073cf82f79706fe7b8317e98620a47d5be7c3d8497678" +checksum = "d751e9e49156b02b44f9c1815bcb94b984cdcc4396ecc32521c739452808b134" dependencies = [ "derive_more-impl", ] [[package]] name = "derive_more-impl" -version = "2.0.1" +version = "2.1.1" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "bda628edc44c4bb645fbe0f758797143e4e07926f7ebf4e9bdfbd3d2ce621df3" +checksum = "799a97264921d8623a957f6c3b9011f3b5492f557bbb7a5a19b7fa6d06ba8dcb" dependencies = [ "proc-macro2", "quote", + "rustc_version", "syn", ] @@ -981,9 +980,9 @@ dependencies = [ [[package]] name = "displaydoc" -version = "0.2.5" +version = "0.2.6" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "97369cbbc041bc366949bc74d34658d6cda5621039731c6310521892a3a20ae0" +checksum = "1ac70aa55017e108007fbaf5aa0f54b021c98f92ff8af59d42eda9da96e3dd4f" dependencies = [ "proc-macro2", "quote", @@ -997,7 +996,7 @@ source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "a652f3e705c41ce2b929b82ee99e9a3c262cf9c88df53597b67a6b59b1c2a3b4" dependencies = [ "dlt-sys", - "thiserror 2.0.17", + "thiserror", "tokio", ] @@ -1088,9 +1087,9 @@ dependencies = [ [[package]] name = "either" -version = "1.15.0" +version = "1.16.0" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "48c757948c5ede0e46177b7add2e67155f70e33c07fea8284df6576da70b3719" +checksum = "91622ff5e7162018101f2fea40d6ebf4a78bbe5a49736a2020649edf9693679e" [[package]] name = "elliptic-curve" @@ -1140,9 +1139,9 @@ dependencies = [ [[package]] name = "fastrand" -version = "2.3.0" +version = "2.4.1" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "37909eebbb50d72f9059c3b6d82c0463f2ff062c9e95845c43a6c9c0355411be" +checksum = "9f1f227452a390804cdb637b74a86990f2a7d7ba4b7d5693aac9b4dd6defd8d6" [[package]] name = "ff" @@ -1176,20 +1175,19 @@ dependencies = [ [[package]] name = "filetime" -version = "0.2.27" +version = "0.2.29" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "f98844151eee8917efc50bd9e8318cb963ae8b297431495d3f758616ea5c57db" +checksum = "5c287a33c7f0a620c38e641e7f60827713987b3c0f26e8ddc9462cc69cf75759" dependencies = [ "cfg-if", "libc", - "libredox", ] [[package]] name = "find-msvc-tools" -version = "0.1.5" +version = "0.1.9" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "3a3076410a55c90011c298b04d0cfa770b00fa04e1e3c97d3f6c9de105a03844" +checksum = "5baebc0774151f905a1a2cc41989300b1e6fbb29aff0ceffa1064fdd3088d582" [[package]] name = "fixedbitset" @@ -1208,9 +1206,9 @@ dependencies = [ [[package]] name = "flate2" -version = "1.1.5" +version = "1.1.9" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "bfe33edd8e85a12a67454e37f8c75e730830d83e313556ab9ebf9ee7fbeb3bfb" +checksum = "843fba2746e448b37e26a819579957415c8cef339bf08564fe8b7ddbd959573c" dependencies = [ "crc32fast", "miniz_oxide", @@ -1222,6 +1220,12 @@ version = "1.0.7" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "3f9eec918d3f24069decb9af1554cad7c880e2da24a9afd88aca000531ab82c1" +[[package]] +name = "foldhash" +version = "0.1.5" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "d9c4f5dac5e15c24eb999c26181a6ca40b39fe946cbe4c263c7209467bc83af2" + [[package]] name = "foldhash" version = "0.2.0" @@ -1254,15 +1258,18 @@ dependencies = [ [[package]] name = "fragile" -version = "2.0.1" +version = "2.1.0" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "28dd6caf6059519a65843af8fe2a3ae298b14b80179855aeb4adc2c1934ee619" +checksum = "8878864ba14bb86e818a412bfd6f18f9eabd4ec0f008a28e8f7eb61db532fcf9" +dependencies = [ + "futures-core", +] [[package]] name = "futures" -version = "0.3.31" +version = "0.3.32" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "65bc07b1a8bc7c85c5f2e110c476c7389b4554ba72af57d8445ea63a576b0876" +checksum = "8b147ee9d1f6d097cef9ce628cd2ee62288d963e16fb287bd9286455b241382d" dependencies = [ "futures-channel", "futures-core", @@ -1275,9 +1282,9 @@ dependencies = [ [[package]] name = "futures-channel" -version = "0.3.31" +version = "0.3.32" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "2dff15bf788c671c1934e366d07e30c1814a8ef514e1af724a602e8a2fbe1b10" +checksum = "07bbe89c50d7a535e539b8c17bc0b49bdb77747034daa8087407d655f3f7cc1d" dependencies = [ "futures-core", "futures-sink", @@ -1285,15 +1292,15 @@ dependencies = [ [[package]] name = "futures-core" -version = "0.3.31" +version = "0.3.32" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "05f29059c0c2090612e8d742178b0580d2dc940c837851ad723096f87af6663e" +checksum = "7e3450815272ef58cec6d564423f6e755e25379b217b0bc688e295ba24df6b1d" [[package]] name = "futures-executor" -version = "0.3.31" +version = "0.3.32" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "1e28d1d997f585e54aebc3f97d39e72338912123a67330d723fdbb564d646c9f" +checksum = "baf29c38818342a3b26b5b923639e7b1f4a61fc5e76102d4b1981c6dc7a7579d" dependencies = [ "futures-core", "futures-task", @@ -1302,15 +1309,15 @@ dependencies = [ [[package]] name = "futures-io" -version = "0.3.31" +version = "0.3.32" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "9e5c1b78ca4aae1ac06c48a526a655760685149f0d465d21f37abfe57ce075c6" +checksum = "cecba35d7ad927e23624b22ad55235f2239cfa44fd10428eecbeba6d6a717718" [[package]] name = "futures-macro" -version = "0.3.31" +version = "0.3.32" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "162ee34ebcb7c64a8abebc059ce0fee27c2262618d7b60ed8faf72fef13c3650" +checksum = "e835b70203e41293343137df5c0664546da5745f82ec9b84d40be8336958447b" dependencies = [ "proc-macro2", "quote", @@ -1319,21 +1326,21 @@ dependencies = [ [[package]] name = "futures-sink" -version = "0.3.31" +version = "0.3.32" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "e575fab7d1e0dcb8d0c7bcf9a63ee213816ab51902e6d244a95819acacf1d4f7" +checksum = "c39754e157331b013978ec91992bde1ac089843443c49cbc7f46150b0fad0893" [[package]] name = "futures-task" -version = "0.3.31" +version = "0.3.32" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "f90f7dce0722e95104fcb095585910c0977252f286e354b5e3bd38902cd99988" +checksum = "037711b3d59c33004d3856fbdc83b99d4ff37a24768fa1be9ce3538a1cde4393" [[package]] name = "futures-util" -version = "0.3.31" +version = "0.3.32" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "9fa08315bb612088cc391249efdc3bc77536f16c91f6cf495e6fbe85b20a4a81" +checksum = "389ca41296e6190b48053de0321d02a77f32f8a5d2461dd38762c0593805c6d6" dependencies = [ "futures-channel", "futures-core", @@ -1343,7 +1350,6 @@ dependencies = [ "futures-task", "memchr", "pin-project-lite", - "pin-utils", "slab", ] @@ -1360,9 +1366,9 @@ dependencies = [ [[package]] name = "getrandom" -version = "0.2.16" +version = "0.2.17" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "335ff9f135e4384c8150d6f27c6daed433577f86b4750418338c01a1a2528592" +checksum = "ff2abc00be7fca6ebc474524697ae276ad847ad0a6b3faa4bcb027e9a4614ad0" dependencies = [ "cfg-if", "libc", @@ -1377,10 +1383,21 @@ checksum = "899def5c37c4fd7b2664648c28120ecec138e4d395b459e5ca34f9cce2dd77fd" dependencies = [ "cfg-if", "libc", - "r-efi", + "r-efi 5.3.0", "wasip2", ] +[[package]] +name = "getrandom" +version = "0.4.3" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "300e883d756b2e4ec94e02791f39b04b522276138852cfc41d9fb7e904106099" +dependencies = [ + "cfg-if", + "libc", + "r-efi 6.0.0", +] + [[package]] name = "glob" version = "0.3.3" @@ -1400,9 +1417,9 @@ dependencies = [ [[package]] name = "h2" -version = "0.4.12" +version = "0.4.15" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "f3c0b69cfcb4e1b9f1bf2f53f95f766e4661169728ec61cd3fe5a0166f2d1386" +checksum = "6cb093c84e8bd9b188d4c4a8cb6579fc016968d14c99882163cd3ff402a4f155" dependencies = [ "atomic-waker", "bytes", @@ -1428,9 +1445,12 @@ dependencies = [ [[package]] name = "hashbrown" -version = "0.16.1" +version = "0.15.5" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "841d1cc9bed7f9236f321df977030373f4a4163ae1a7dbfe1a51a2c1a51d9100" +checksum = "9229cfe53dfd69f0609a49f65461bd93001ea1ef889cd5529dd176593f5338a1" +dependencies = [ + "foldhash 0.1.5", +] [[package]] name = "hashbrown" @@ -1523,12 +1543,11 @@ dependencies = [ [[package]] name = "http" -version = "1.3.1" +version = "1.4.2" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "f4a85d31aea989eead29a3aaf9e1115a180df8282431156e533de47660892565" +checksum = "6970f50e31d6fc17d3fa27329444bfa74e196cf62e95052a3f6fee181dba6425" dependencies = [ "bytes", - "fnv", "itoa", ] @@ -1575,15 +1594,15 @@ checksum = "df3b46402a9d5adb4c86a0cf463f42e19994e3ee891101b1841f30a545cb49a9" [[package]] name = "humantime" -version = "2.3.0" +version = "2.4.0" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "135b12329e5e3ce057a9f972339ea52bc954fe1e9358ef27f95e89716fbc5424" +checksum = "15cdd26707701c53297e2fa6afb323d55fbc1d0810c3aec078ae3ef0424c3c15" [[package]] name = "hyper" -version = "1.8.1" +version = "1.10.1" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "2ab2d4f250c3d7b1c9fcdff1cece94ea4e2dfbec68614f7b87cb205f24ca9d11" +checksum = "55281c53a1894c864990125767da440a4e630446785086f52523b20033b74498" dependencies = [ "atomic-waker", "bytes", @@ -1596,7 +1615,6 @@ dependencies = [ "httpdate", "itoa", "pin-project-lite", - "pin-utils", "smallvec", "tokio", "want", @@ -1604,15 +1622,14 @@ dependencies = [ [[package]] name = "hyper-rustls" -version = "0.27.7" +version = "0.27.9" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "e3c93eb611681b207e1fe55d5a71ecf91572ec8a6705cdb6857f7d8d5242cf58" +checksum = "33ca68d021ef39cf6463ab54c1d0f5daf03377b70561305bb89a8f83aab66e0f" dependencies = [ "http", "hyper", "hyper-util", "rustls", - "rustls-pki-types", "tokio", "tokio-rustls", "tower-service", @@ -1649,14 +1666,13 @@ dependencies = [ [[package]] name = "hyper-util" -version = "0.1.18" +version = "0.1.20" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "52e9a2a24dc5c6821e71a7030e1e14b7b632acac55c40e9d2e082c621261bb56" +checksum = "96547c2556ec9d12fb1578c4eaf448b04993e7fb79cbaad930a656880a6bdfa0" dependencies = [ "base64 0.22.1", "bytes", "futures-channel", - "futures-core", "futures-util", "http", "http-body", @@ -1675,9 +1691,9 @@ dependencies = [ [[package]] name = "iana-time-zone" -version = "0.1.64" +version = "0.1.65" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "33e57f83510bb73707521ebaffa789ec8caf86f9657cad665b092b581d40e9fb" +checksum = "e31bc9ad994ba00e440a8aa5c9ef0ec67d5cb5e5cb0cc7f8b744a35b389cc470" dependencies = [ "android_system_properties", "core-foundation-sys", @@ -1699,12 +1715,13 @@ dependencies = [ [[package]] name = "icu_collections" -version = "2.1.1" +version = "2.2.0" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "4c6b649701667bbe825c3b7e6388cb521c23d88644678e83c0c4d0a621a34b43" +checksum = "2984d1cd16c883d7935b9e07e44071dca8d917fd52ecc02c04d5fa0b5a3f191c" dependencies = [ "displaydoc", "potential_utf", + "utf8_iter", "yoke", "zerofrom", "zerovec", @@ -1712,9 +1729,9 @@ dependencies = [ [[package]] name = "icu_locale_core" -version = "2.1.1" +version = "2.2.0" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "edba7861004dd3714265b4db54a3c390e880ab658fec5f7db895fae2046b5bb6" +checksum = "92219b62b3e2b4d88ac5119f8904c10f8f61bf7e95b640d25ba3075e6cac2c29" dependencies = [ "displaydoc", "litemap", @@ -1725,9 +1742,9 @@ dependencies = [ [[package]] name = "icu_normalizer" -version = "2.1.1" +version = "2.2.0" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "5f6c8828b67bf8908d82127b2054ea1b4427ff0230ee9141c54251934ab1b599" +checksum = "c56e5ee99d6e3d33bd91c5d85458b6005a22140021cc324cea84dd0e72cff3b4" dependencies = [ "icu_collections", "icu_normalizer_data", @@ -1739,15 +1756,15 @@ dependencies = [ [[package]] name = "icu_normalizer_data" -version = "2.1.1" +version = "2.2.0" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "7aedcccd01fc5fe81e6b489c15b247b8b0690feb23304303a9e560f37efc560a" +checksum = "da3be0ae77ea334f4da67c12f149704f19f81d1adf7c51cf482943e84a2bad38" [[package]] name = "icu_properties" -version = "2.1.1" +version = "2.2.0" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "e93fcd3157766c0c8da2f8cff6ce651a31f0810eaa1c51ec363ef790bbb5fb99" +checksum = "bee3b67d0ea5c2cca5003417989af8996f8604e34fb9ddf96208a033901e70de" dependencies = [ "icu_collections", "icu_locale_core", @@ -1759,15 +1776,15 @@ dependencies = [ [[package]] name = "icu_properties_data" -version = "2.1.1" +version = "2.2.0" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "02845b3647bb045f1100ecd6480ff52f34c35f82d9880e029d329c21d1054899" +checksum = "8e2bbb201e0c04f7b4b3e14382af113e17ba4f63e2c9d2ee626b720cbce54a14" [[package]] name = "icu_provider" -version = "2.1.1" +version = "2.2.0" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "85962cf0ce02e1e0a629cc34e7ca3e373ce20dda4c4d7294bbd0bf1fdb59e614" +checksum = "139c4cf31c8b5f33d7e199446eff9c1e02decfc2f0eec2c8d71f65befa45b421" dependencies = [ "displaydoc", "icu_locale_core", @@ -1797,9 +1814,9 @@ dependencies = [ [[package]] name = "idna_adapter" -version = "1.2.1" +version = "1.2.2" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "3acae9609540aa318d1bc588455225fb2085b9ed0c4f6bd0d9d5bcd86f1a0344" +checksum = "cb68373c0d6620ef8105e855e7745e18b0d00d3bdb07fb532e434244cdb9a714" dependencies = [ "icu_normalizer", "icu_properties", @@ -1807,12 +1824,12 @@ dependencies = [ [[package]] name = "indexmap" -version = "2.12.1" +version = "2.14.0" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "0ad4bb2b565bca0645f4d68c5c9af97fba094e9791da685bf83cb5f3ce74acf2" +checksum = "d466e9454f08e4a911e14806c24e16fba1b4c121d1ea474396f396069cf949d9" dependencies = [ "equivalent", - "hashbrown 0.16.1", + "hashbrown 0.17.1", "serde", "serde_core", ] @@ -1847,15 +1864,15 @@ dependencies = [ "libc", "mime", "opensovd-cda", - "reqwest 0.12.28", + "reqwest", "schemars", "serde", "serde_json", "serde_qs", "sovd-interfaces", - "thiserror 2.0.17", + "thiserror", "tokio", - "toml 0.9.8", + "toml 0.9.12+spec-1.1.0", "tracing", "tracing-subscriber", "url", @@ -1864,19 +1881,9 @@ dependencies = [ [[package]] name = "ipnet" -version = "2.11.0" +version = "2.12.0" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "469fb0b9cefa57e3ef31275ee7cacb78f2fdca44e4765491884a2b119d4eb130" - -[[package]] -name = "iri-string" -version = "0.7.9" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "4f867b9d1d896b67beb18518eda36fdb77a32ea590de864f1325b294a6d14397" -dependencies = [ - "memchr", - "serde", -] +checksum = "d98f6fed1fde3f8c21bc40a1abb88dd75e67924f9cffc3ef95607bad8017f8e2" [[package]] name = "is_terminal_polyfill" @@ -1904,29 +1911,30 @@ dependencies = [ [[package]] name = "itoa" -version = "1.0.15" +version = "1.0.18" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "4a5f13b858c8d314ee3e8f639011f7ccefe71f97f96e50151fb991f267928e2c" +checksum = "8f42a60cbdf9a97f5d2305f08a87dc4e09308d1276d28c869c684d7777685682" [[package]] name = "js-sys" -version = "0.3.82" +version = "0.3.103" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "b011eec8cc36da2aab2d5cff675ec18454fad408585853910a202391cf9f8e65" +checksum = "53b44bfcdb3f8d5837a46dae1ca9660a837176eee74a28b229bc626816589102" dependencies = [ - "once_cell", + "cfg-if", + "futures-util", "wasm-bindgen", ] [[package]] name = "jsonwebtoken" -version = "10.3.0" +version = "10.4.0" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "0529410abe238729a60b108898784df8984c87f6054c9c4fcacc47e4803c1ce1" +checksum = "eba32bfb4ffdeaca3e34431072faf01745c9b26d25504aa7a6cf5684334fc4fc" dependencies = [ "base64 0.22.1", "ed25519-dalek", - "getrandom 0.2.16", + "getrandom 0.2.17", "hmac", "js-sys", "p256", @@ -1939,13 +1947,14 @@ dependencies = [ "sha2", "signature", "simple_asn1", + "zeroize", ] [[package]] name = "kameo" -version = "0.21.0" +version = "0.21.1" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "fe998b05ae765a040027d9fe3187240cb840e6705fa29d86f3abaa5e96b36291" +checksum = "aea00bfc3709c5b95be7c9a93289d0c3ff42cf9a3b77d532387242992705bca7" dependencies = [ "downcast-rs", "dyn-clone", @@ -1957,9 +1966,9 @@ dependencies = [ [[package]] name = "kameo_macros" -version = "0.21.0" +version = "0.21.1" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "0f200083477f64b12545688f8e0f562c31c1462827e163cb14dc2ed6c89eb888" +checksum = "f7566055976eb86ee8e8fbafa0fbdad985c5d7c3f4eed04fc11bb495f71e3856" dependencies = [ "heck 0.5.0", "proc-macro2", @@ -1967,6 +1976,21 @@ dependencies = [ "syn", ] +[[package]] +name = "konst" +version = "0.2.20" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "128133ed7824fcd73d6e7b17957c5eb7bacb885649bd8c69708b2331a10bcefb" +dependencies = [ + "konst_macro_rules", +] + +[[package]] +name = "konst_macro_rules" +version = "0.2.19" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "a4933f3f57a8e9d9da04db23fb153356ecaf00cbd14aee46279c33dc80925c37" + [[package]] name = "lazy_static" version = "1.5.0" @@ -1978,15 +2002,15 @@ dependencies = [ [[package]] name = "libbz2-rs-sys" -version = "0.2.2" +version = "0.2.5" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "2c4a545a15244c7d945065b5d392b2d2d7f21526fba56ce51467b06ed445e8f7" +checksum = "34b357333733e8260735ba5894eb928c02ecc69c78715f01a8019e7fa7f2db4c" [[package]] name = "libc" -version = "0.2.177" +version = "0.2.186" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "2874a2af47a2325c2001a6e6fad9b16a53b802102b528163885171cf92b15976" +checksum = "68ab91017fe16c622486840e4c83c9a37afeff978bd239b5293d61ece587de66" [[package]] name = "libloading" @@ -2000,33 +2024,21 @@ dependencies = [ [[package]] name = "libm" -version = "0.2.15" +version = "0.2.16" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "f9fbbcab51052fe104eb5e5d351cf728d30a5be1fe14d9be8a3b097481fb97de" - -[[package]] -name = "libredox" -version = "0.1.14" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "1744e39d1d6a9948f4f388969627434e31128196de472883b39f148769bfe30a" -dependencies = [ - "bitflags", - "libc", - "plain", - "redox_syscall 0.7.3", -] +checksum = "b6d2cec3eae94f9f509c767b45932f1ada8350c4bdb85af2fcab4a3c14807981" [[package]] name = "linux-raw-sys" -version = "0.11.0" +version = "0.12.1" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "df1d3c3b53da64cf5760482273a98e575c651a67eec7f77df96b5b642de8f039" +checksum = "32a66949e030da00e8c7d4434b251670a91556f4144941d37452769c25d58a53" [[package]] name = "litemap" -version = "0.8.1" +version = "0.8.2" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "6373607a59f0be73a39b6fe456b8192fcc3585f602af20751600e974dd455e77" +checksum = "92daf443525c4cce67b150400bc2316076100ce0b3686209eb8cf3c31612e6f0" [[package]] name = "lock_api" @@ -2039,9 +2051,9 @@ dependencies = [ [[package]] name = "log" -version = "0.4.28" +version = "0.4.33" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "34080505efa8e45a4b816c349525ebe327ceaa8559756f0356cba97ef3bf7432" +checksum = "0ceec5bc11778974d1bcb055b18002eba7f4b3518b6a0081b3af5f21666da9ad" [[package]] name = "lzma-sys" @@ -2097,15 +2109,15 @@ dependencies = [ [[package]] name = "memchr" -version = "2.7.6" +version = "2.8.3" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "f52b00d39961fc5b2736ea853c9cc86238e165017a493d1d5c8eac6bdc4cc273" +checksum = "cf8baf1c55e62ffcace7a9f06f4bd9cd3f0c4beb022d3b367256b91b87513d98" [[package]] name = "memmap2" -version = "0.9.10" +version = "0.9.11" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "714098028fe011992e1c3962653c96b2d578c4b4bce9036e15ff220319b1e0e3" +checksum = "d1219ed1b7f229ee7104d281dd01d6802fe28bb6e95d292942c4daacdeb798c0" dependencies = [ "libc", ] @@ -2153,9 +2165,9 @@ dependencies = [ [[package]] name = "mio" -version = "1.1.0" +version = "1.2.1" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "69d83b0086dc8ecf3ce9ae2874b2d1290252e2a30720bea58a5c6639b0092873" +checksum = "02bd0af71c67b473010cbbc60715ee815645a4dc942899111f494b4b737d6fda" dependencies = [ "libc", "wasi", @@ -2269,9 +2281,9 @@ dependencies = [ [[package]] name = "num-bigint" -version = "0.4.6" +version = "0.4.8" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "a5e44f723f1133c9deac646763579fdb3ac745e418f2a7af9cd0c431da1f20b9" +checksum = "c89e69e7e0f03bea5ef08013795c25018e101932225a656383bd384495ecc367" dependencies = [ "num-integer", "num-traits", @@ -2295,9 +2307,9 @@ dependencies = [ [[package]] name = "num-conv" -version = "0.2.0" +version = "0.2.2" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "cf97ec579c3c42f953ef76dbf8d55ac91fb219dde70e49aa4a6b7d74e9919050" +checksum = "521739c6d2bac4aa25192232afe6841231376b2b26d4d9fae5ecf8ca5772e441" [[package]] name = "num-integer" @@ -2310,11 +2322,10 @@ dependencies = [ [[package]] name = "num-iter" -version = "0.1.45" +version = "0.1.46" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "1429034a0490724d0075ebb2bc9e875d6503c3cf69e235a8941aa757d83ef5bf" +checksum = "c92800bd69a1eac91786bcfe9da64a897eb72911b8dc3095decbd07429e8048b" dependencies = [ - "autocfg", "num-integer", "num-traits", ] @@ -2331,9 +2342,9 @@ dependencies = [ [[package]] name = "once_cell" -version = "1.21.3" +version = "1.21.4" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "42f5e15c9953c5e4ccceeb2e7382a716482c34515315f7b03532b8b4e8393d2d" +checksum = "9f7c3e4beb33f85d45ae3e3a1792185706c8e16d043238c593331cc7cd313b50" [[package]] name = "once_cell_polyfill" @@ -2361,10 +2372,8 @@ dependencies = [ "cda-core", "cda-database", "cda-extra", - "cda-health", "cda-interfaces", "cda-plugin-runtime-update", - "cda-plugin-security", "cda-sovd", "cda-storage", "cda-tracing", @@ -2377,18 +2386,18 @@ dependencies = [ "serde", "serde_json", "tempfile", - "thiserror 2.0.17", + "thiserror", "tokio", - "toml 0.9.8", + "toml 0.9.12+spec-1.1.0", "tracing", "tracing-subscriber", ] [[package]] name = "openssl" -version = "0.10.80" +version = "0.10.81" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "a45fa2aa886c42762255da344f0a0d313e254066c46aad76f300c3d3da62d967" +checksum = "77823a27f0babb03091cb9ed9ef80af3b39dbc82f97e8fa530374b7dafd87a45" dependencies = [ "bitflags", "cfg-if", @@ -2417,18 +2426,18 @@ checksum = "7c87def4c32ab89d880effc9e097653c8da5d6ef28e6b539d313baaacfbafcbe" [[package]] name = "openssl-src" -version = "300.5.4+3.5.4" +version = "300.6.1+3.6.3" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "a507b3792995dae9b0df8a1c1e3771e8418b7c2d9f0baeba32e6fe8b06c7cb72" +checksum = "46eb8fb9fb3b61ce1c0f8a026c4c1a0714d3a9e138e7fbde78753ce2babc3846" dependencies = [ "cc", ] [[package]] name = "openssl-sys" -version = "0.9.116" +version = "0.9.117" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "f28a22dc7140cda5f096e5e7724a6962ca81a7f8bfd2979f9b18c11af56318c4" +checksum = "b47e7e6bb2c38cd930d25a23b40fa52e068c10e85f3e03a7f5ba5aaca5713695" dependencies = [ "cc", "libc", @@ -2447,21 +2456,7 @@ dependencies = [ "futures-sink", "js-sys", "pin-project-lite", - "thiserror 2.0.17", - "tracing", -] - -[[package]] -name = "opentelemetry-http" -version = "0.32.0" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "5683015d09e2df236ef005b17f6f196f0d5f6313c4fa43a7b6a53b52776e4331" -dependencies = [ - "async-trait", - "bytes", - "http", - "opentelemetry", - "reqwest 0.13.4", + "thiserror", ] [[package]] @@ -2472,12 +2467,10 @@ checksum = "9966929966d17620d7c316c643ba62631826e10021409357772d5eea84f62c35" dependencies = [ "http", "opentelemetry", - "opentelemetry-http", "opentelemetry-proto", "opentelemetry_sdk", "prost", - "reqwest 0.13.4", - "thiserror 2.0.17", + "thiserror", "tokio", "tonic", "tonic-types", @@ -2514,8 +2507,8 @@ dependencies = [ "opentelemetry", "percent-encoding", "portable-atomic", - "rand 0.9.3", - "thiserror 2.0.17", + "rand 0.9.4", + "thiserror", ] [[package]] @@ -2584,7 +2577,7 @@ checksum = "2621685985a2ebf1c516881c026032ac7deafcda1a2c9b7850dc81e3dfcb64c1" dependencies = [ "cfg-if", "libc", - "redox_syscall 0.5.18", + "redox_syscall", "smallvec", "windows-link", ] @@ -2639,28 +2632,29 @@ checksum = "9b4f627cb1b25917193a259e49bdad08f671f8d9708acfd5fe0a8c1455d87220" [[package]] name = "petgraph" -version = "0.7.1" +version = "0.8.3" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "3672b37090dbd86368a4145bc067582552b29c27377cad4e0a306c97f9bd7772" +checksum = "8701b58ea97060d5e5b155d383a69952a60943f0e6dfe30b04c287beb0b27455" dependencies = [ "fixedbitset", + "hashbrown 0.15.5", "indexmap", ] [[package]] name = "pin-project" -version = "1.1.10" +version = "1.1.13" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "677f1add503faace112b9f1373e43e9e054bfdd22ff1a63c1bc485eaec6a6a8a" +checksum = "2466b2336ed02bcdca6b294417127b90ec92038d1d5c4fbeac971a922e0e0924" dependencies = [ "pin-project-internal", ] [[package]] name = "pin-project-internal" -version = "1.1.10" +version = "1.1.13" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "6e918e4ff8c4549eb882f14b3a4bc8c8bc93de829416eacf579f1207a8fbf861" +checksum = "c96395f0a926bc13b1c17622aaddda1ecb55d49c8f1bf9777e4d877800a43f8b" dependencies = [ "proc-macro2", "quote", @@ -2669,15 +2663,9 @@ dependencies = [ [[package]] name = "pin-project-lite" -version = "0.2.16" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "3b3cff922bd51709b605d9ead9aa71031d81447142d828eb4a6eba76fe619f9b" - -[[package]] -name = "pin-utils" -version = "0.1.0" +version = "0.2.17" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "8b870d8c151b6f2fb93e84a13146138f05d02ed11c7e7c54f8826aaaf7c9f184" +checksum = "a89322df9ebe1c1578d689c92318e070967d1042b512afbe49518723f4e6d5cd" [[package]] name = "pkcs1" @@ -2702,15 +2690,9 @@ dependencies = [ [[package]] name = "pkg-config" -version = "0.3.32" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "7edddbd0b52d732b21ad9a5fab5c704c14cd949e5e9a1ec5929a24fded1b904c" - -[[package]] -name = "plain" -version = "0.2.3" +version = "0.3.33" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "b4596b6d070b27117e987119b4dac604f3c58cfb0b191112e24771b2faeac1a6" +checksum = "19f132c84eca552bf34cab8ec81f1c1dcc229b811638f9d283dceabe58c5569e" [[package]] name = "portable-atomic" @@ -2720,9 +2702,9 @@ checksum = "c33a9471896f1c69cecef8d20cbe2f7accd12527ce60845ff44c153bb2a21b49" [[package]] name = "potential_utf" -version = "0.1.4" +version = "0.1.5" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "b73949432f5e2a09657003c25bca5e19a0e9c84f8058ca374f49e0ebe605af77" +checksum = "0103b1cef7ec0cf76490e969665504990193874ea05c85ff9bab8b911d0a0564" dependencies = [ "zerovec", ] @@ -2744,9 +2726,9 @@ dependencies = [ [[package]] name = "predicates" -version = "3.1.3" +version = "3.1.4" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "a5d19ee57562043d37e82899fade9a22ebab7be9cef5026b07fda9cdd4293573" +checksum = "ada8f2932f28a27ee7b70dd6c1c39ea0675c55a36879ab92f3a715eaa1e63cfe" dependencies = [ "anstyle", "predicates-core", @@ -2754,15 +2736,15 @@ dependencies = [ [[package]] name = "predicates-core" -version = "1.0.9" +version = "1.0.10" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "727e462b119fe9c93fd0eb1429a5f7647394014cf3c04ab2c0350eeb09095ffa" +checksum = "cad38746f3166b4031b1a0d39ad9f954dd291e7854fcc0eed52ee41a0b50d144" [[package]] name = "predicates-tree" -version = "1.0.12" +version = "1.0.13" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "72dd2d6d381dfb73a193c7fca536518d7caee39fc8503f74e7dc0be0531b425c" +checksum = "d0de1b847b39c8131db0467e9df1ff60e6d0562ab8e9a16e568ad0fdb372e2f2" dependencies = [ "predicates-core", "termtree", @@ -2789,9 +2771,9 @@ dependencies = [ [[package]] name = "proc-macro2" -version = "1.0.103" +version = "1.0.106" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "5ee95bc4ef87b8d5ba32e8b7714ccc834865276eab0aed5c9958d00ec45f49e8" +checksum = "8fd00f0bb2e90d81d1044c2b32617f68fcb9fa3bb7640c23e9c748e53fb30934" dependencies = [ "unicode-ident", ] @@ -2811,9 +2793,9 @@ dependencies = [ [[package]] name = "prost" -version = "0.14.1" +version = "0.14.4" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "7231bd9b3d3d33c86b58adbac74b5ec0ad9f496b19d22801d773636feaa95f3d" +checksum = "528ac67416ff8646872a3c02cad9cc4ee5dc9f9540c9b10771855c95cb2e5ae1" dependencies = [ "bytes", "prost-derive", @@ -2821,15 +2803,14 @@ dependencies = [ [[package]] name = "prost-build" -version = "0.14.1" +version = "0.14.4" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "ac6c3320f9abac597dcbc668774ef006702672474aad53c6d596b62e487b40b1" +checksum = "03da047801ff44bb6a4d407d4860c05fd70bb81714e6b2f3812603d5b145b042" dependencies = [ "heck 0.5.0", "itertools 0.14.0", "log", "multimap", - "once_cell", "petgraph", "prettyplease", "prost", @@ -2841,9 +2822,9 @@ dependencies = [ [[package]] name = "prost-derive" -version = "0.14.1" +version = "0.14.4" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "9120690fafc389a67ba3803df527d0ec9cbbc9cc45e4cc20b332996dfb672425" +checksum = "b570b25f7617e43d59005d0990ccb79e950a423952cea19671b7a876da390adf" dependencies = [ "anyhow", "itertools 0.14.0", @@ -2854,9 +2835,9 @@ dependencies = [ [[package]] name = "prost-types" -version = "0.14.1" +version = "0.14.4" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "b9b4db3d6da204ed77bb26ba83b6122a73aeb2e87e25fbf7ad2e84c4ccbf8f72" +checksum = "f94967dc7688f3054c7fac87473ffae4cc4c3904800e2d9f5b857246d8963b0a" dependencies = [ "prost", ] @@ -2883,9 +2864,9 @@ dependencies = [ [[package]] name = "quote" -version = "1.0.42" +version = "1.0.46" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "a338cc41d27e6cc6dce6cefc13a0729dfbb81c262b1f519331575dd80ef3067f" +checksum = "dfbc457d0c7a0759a614551b11a6409e5951f6c7537be1f1b7682b9ae9230368" dependencies = [ "proc-macro2", ] @@ -2896,11 +2877,17 @@ version = "5.3.0" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "69cdb34c158ceb288df11e18b4bd39de994f6657d83847bdffdbd7f346754b0f" +[[package]] +name = "r-efi" +version = "6.0.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "f8dcc9c7d52a811697d2151c701e0d08956f92b0e24136cf4cf27b57a6a0d9bf" + [[package]] name = "rancor" -version = "0.1.1" +version = "0.1.2" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "a063ea72381527c2a0561da9c80000ef822bdd7c3241b1cc1b12100e3df081ee" +checksum = "daff8b7b3ccf5f7ba270b3e7a0a4d4c701c5797e38dec27c7e2c3dbb830fed1c" dependencies = [ "ptr_meta", ] @@ -2918,12 +2905,12 @@ dependencies = [ [[package]] name = "rand" -version = "0.9.3" +version = "0.9.4" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "7ec095654a25171c2124e9e3393a930bddbffdc939556c914957a4c3e0a87166" +checksum = "44c5af06bb1b7d3216d91932aed5265164bf384dc89cd6ba05cf59a35f5f76ea" dependencies = [ "rand_chacha 0.9.0", - "rand_core 0.9.3", + "rand_core 0.9.5", ] [[package]] @@ -2943,7 +2930,7 @@ source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "d3022b5f1df60f26e1ffddd6c66e8aa15de382ae63b3a0c1bfc0e4d3e3f325cb" dependencies = [ "ppv-lite86", - "rand_core 0.9.3", + "rand_core 0.9.5", ] [[package]] @@ -2952,14 +2939,14 @@ version = "0.6.4" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "ec0be4795e2f6a28069bec0b5ff3e2ac9bafc99e6a9a7dc3547996c5c816922c" dependencies = [ - "getrandom 0.2.16", + "getrandom 0.2.17", ] [[package]] name = "rand_core" -version = "0.9.3" +version = "0.9.5" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "99d9a13982dcf210057a8a78572b2217b667c3beacbf3a0d8b454f6f82837d38" +checksum = "76afc826de14238e6e8c374ddcc1fa19e374fd8dd986b0d2af0d02377261d83c" dependencies = [ "getrandom 0.3.4", ] @@ -2973,15 +2960,6 @@ dependencies = [ "bitflags", ] -[[package]] -name = "redox_syscall" -version = "0.7.3" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "6ce70a74e890531977d37e532c34d45e9055d2409ed08ddba14529471ed0be16" -dependencies = [ - "bitflags", -] - [[package]] name = "ref-cast" version = "1.0.25" @@ -3004,9 +2982,9 @@ dependencies = [ [[package]] name = "regex" -version = "1.12.2" +version = "1.13.0" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "843bc0191f75f3e22651ae5f1e72939ab2f72a4bc30fa80a066bd66edefc24d4" +checksum = "2a0e75113e14dc5acb068cd0786884f214f1312650a3d36d269f5c4f3cdee8a2" dependencies = [ "aho-corasick", "memchr", @@ -3016,9 +2994,9 @@ dependencies = [ [[package]] name = "regex-automata" -version = "0.4.13" +version = "0.4.15" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "5276caf25ac86c8d810222b3dbb938e512c55c6831a10f3e6ed1c93b84041f1c" +checksum = "1f388202e4b80542a0921078cc23b6333bcf1409c1e3f86404cae4766a6131db" dependencies = [ "aho-corasick", "memchr", @@ -3027,15 +3005,15 @@ dependencies = [ [[package]] name = "regex-syntax" -version = "0.8.8" +version = "0.8.11" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "7a2d987857b319362043e95f5353c0535c1f58eec5336fdfcf626430af7def58" +checksum = "d6f6ff9a378485b298a5286656da665ba74413d36db0979633275d2e708145d4" [[package]] name = "rend" -version = "0.5.3" +version = "0.5.4" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "cadadef317c2f20755a64d7fdc48f9e7178ee6b0e1f7fce33fa60f1d68a276e6" +checksum = "663ba70707f96e871406fe10d68128412e619b06d1d47cb91c3a4c6501176240" dependencies = [ "bytecheck", ] @@ -3082,37 +3060,6 @@ dependencies = [ "web-sys", ] -[[package]] -name = "reqwest" -version = "0.13.4" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "219c5811de6525e5416c7d5d53bb656d3afdbc6c5af816e0802bcfa42dbdc1c3" -dependencies = [ - "base64 0.22.1", - "bytes", - "futures-channel", - "futures-core", - "futures-util", - "http", - "http-body", - "http-body-util", - "hyper", - "hyper-util", - "js-sys", - "log", - "percent-encoding", - "pin-project-lite", - "sync_wrapper", - "tokio", - "tower", - "tower-http", - "tower-service", - "url", - "wasm-bindgen", - "wasm-bindgen-futures", - "web-sys", -] - [[package]] name = "rfc6979" version = "0.4.0" @@ -3131,7 +3078,7 @@ checksum = "a4689e6c2294d81e88dc6261c768b63bc4fcdb852be6d1352498b114f61383b7" dependencies = [ "cc", "cfg-if", - "getrandom 0.2.16", + "getrandom 0.2.17", "libc", "untrusted", "windows-sys 0.52.0", @@ -3139,9 +3086,9 @@ dependencies = [ [[package]] name = "rkyv" -version = "0.8.16" +version = "0.8.17" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "73389e0c99e664f919275ab5b5b0471391fe9a8de61e1dff9b1eaf56a90f16e3" +checksum = "815cc8a37159a463064825246cadb07961e25cd9885908606f6d08a98d8f8874" dependencies = [ "bytecheck", "bytes", @@ -3158,9 +3105,9 @@ dependencies = [ [[package]] name = "rkyv_derive" -version = "0.8.16" +version = "0.8.17" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "5d2ed0b54125315fb36bd021e82d314d1c126548f871634b483f46b31d13cac6" +checksum = "c0ed1a78a1b19d184b0daa629dd9a024573173ec7d485b287cb369fb3607cc1c" dependencies = [ "proc-macro2", "quote", @@ -3189,9 +3136,9 @@ dependencies = [ [[package]] name = "rustc-hash" -version = "2.1.1" +version = "2.1.3" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "357703d41365b4b27c590e3ed91eabb1b663f07c4c084095e60cbed4362dff0d" +checksum = "6b1e7f9a428571be2dc5bc0505c13fb6bf936822b894ec87abf8a08a4e51742d" [[package]] name = "rustc_version" @@ -3204,9 +3151,9 @@ dependencies = [ [[package]] name = "rustix" -version = "1.1.2" +version = "1.1.4" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "cd15f8a2c5551a84d56efdc1cd049089e409ac19a3072d5037a17fd70719ff3e" +checksum = "b6fe4565b9518b83ef4f91bb47ce29620ca828bd32cb7e408f0062e9930ba190" dependencies = [ "bitflags", "errno", @@ -3217,9 +3164,9 @@ dependencies = [ [[package]] name = "rustls" -version = "0.23.35" +version = "0.23.41" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "533f54bc6a7d4f647e46ad909549eda97bf5afc1585190ef692b4286b198bd8f" +checksum = "6b92b125634d9b795e7beca796cc790df15a7fb38323bf3196fda83292d06b1f" dependencies = [ "log", "once_cell", @@ -3232,9 +3179,9 @@ dependencies = [ [[package]] name = "rustls-pki-types" -version = "1.13.0" +version = "1.15.0" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "94182ad936a0c91c324cd46c6511b9510ed16af436d7b5bab34beab0afd55f7a" +checksum = "764899a24af3980067ee14bc143654f297b22eaebfe3c7b6b211920a5a59b046" dependencies = [ "zeroize", ] @@ -3252,30 +3199,30 @@ dependencies = [ [[package]] name = "rustversion" -version = "1.0.22" +version = "1.0.23" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "b39cdef0fa800fc44525c84ccb54a029961a8215f9619753635a9c0d2538d46d" +checksum = "cf54715a573b99ac80df0bc206da022bcd442c974952c7b9720069370852e21f" [[package]] name = "ryu" -version = "1.0.20" +version = "1.0.23" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "28d3b2b1366ec20994f1fd18c3c594f05c5dd4bc44d8bb0c1c632c8d6829481f" +checksum = "9774ba4a74de5f7b1c1451ed6cd5285a32eddb5cccb8cc655a4e50009e06477f" [[package]] name = "schannel" -version = "0.1.28" +version = "0.1.29" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "891d81b926048e76efe18581bf793546b4c0eaf8448d72be8de2bbee5fd166e1" +checksum = "91c1b7e4904c873ef0710c1f407dde2e6287de2bebc1bbbf7d430bb7cbffd939" dependencies = [ "windows-sys 0.61.2", ] [[package]] name = "schemars" -version = "1.1.0" +version = "1.2.1" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "9558e172d4e8533736ba97870c4b2cd63f84b382a3d6eb063da41b91cce17289" +checksum = "a2b42f36aa1cd011945615b92222f6bf73c599a102a300334cd7f8dbeec726cc" dependencies = [ "dyn-clone", "indexmap", @@ -3287,9 +3234,9 @@ dependencies = [ [[package]] name = "schemars_derive" -version = "1.1.0" +version = "1.2.1" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "301858a4023d78debd2353c7426dc486001bddc91ae31a76fb1f55132f7e2633" +checksum = "7d115b50f4aaeea07e79c1912f645c7513d81715d0420f8bc77a18c6260b307f" dependencies = [ "proc-macro2", "quote", @@ -3328,9 +3275,9 @@ dependencies = [ [[package]] name = "security-framework" -version = "3.5.1" +version = "3.7.0" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "b3297343eaf830f66ede390ea39da1d462b6b0c1b000f420d0a83f898bbbe6ef" +checksum = "b7f4bc775c73d9a02cde8bf7b2ec4c9d12743edf609006c7facc23998404cd1d" dependencies = [ "bitflags", "core-foundation 0.10.1", @@ -3341,9 +3288,9 @@ dependencies = [ [[package]] name = "security-framework-sys" -version = "2.15.0" +version = "2.17.0" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "cc1f0cbffaac4852523ce30d8bd3c5cdc873501d96ff467ca09b6767bb8cd5c0" +checksum = "6ce2691df843ecc5d231c0b14ece2acc3efb62c0a398c7e1d875f3983ce020e3" dependencies = [ "core-foundation-sys", "libc", @@ -3351,9 +3298,9 @@ dependencies = [ [[package]] name = "semver" -version = "1.0.27" +version = "1.0.28" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "d767eb0aabc880b29956c35734170f26ed551a859dbd361d140cdbeca61ab1e2" +checksum = "8a7852d02fc848982e0c167ef163aaff9cd91dc640ba85e263cb1ce46fae51cd" [[package]] name = "serde" @@ -3398,15 +3345,15 @@ dependencies = [ [[package]] name = "serde_json" -version = "1.0.145" +version = "1.0.150" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "402a6f66d8c709116cf22f558eab210f5a50187f702eb4d7e5ef38d9a7f1c79c" +checksum = "e8014e44b4736ed0538adeecded0fce2a272f22dc9578a7eb6b2d9993c74cfb9" dependencies = [ "itoa", "memchr", - "ryu", "serde", "serde_core", + "zmij", ] [[package]] @@ -3432,7 +3379,7 @@ dependencies = [ "percent-encoding", "ryu", "serde", - "thiserror 2.0.17", + "thiserror", ] [[package]] @@ -3446,9 +3393,9 @@ dependencies = [ [[package]] name = "serde_spanned" -version = "1.0.3" +version = "1.1.1" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "e24345aa0fe688594e73770a5f6d1b216508b4f93484c0026d521acd30134392" +checksum = "6662b5879511e06e8999a8a235d848113e942c9124f211511b16466ee2995f26" dependencies = [ "serde_core", ] @@ -3515,12 +3462,19 @@ version = "1.3.0" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "0fda2ff0d084019ba4d7c6f371c95d8fd75ce3524c3cb8fb653a3023f6323e64" +[[package]] +name = "shlex" +version = "2.0.1" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "f8fadd59c855ef2080decdef8ff161eb6661b86933c9d82e5ba29dc602a55aba" + [[package]] name = "signal-hook-registry" -version = "1.4.6" +version = "1.4.8" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "b2a4719bff48cee6b39d12c020eeb490953ad2443b7055bd0b21fca26bd8c28b" +checksum = "c4db69cba1110affc0e9f7bcd48bbf87b3f4fc7c61fc9155afd4c469eb3d6c1b" dependencies = [ + "errno", "libc", ] @@ -3536,9 +3490,9 @@ dependencies = [ [[package]] name = "simd-adler32" -version = "0.3.7" +version = "0.3.9" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "d66dc143e6b11c1eddc06d5c423cfc97062865baf299914ab64caa38182078fe" +checksum = "703d5c7ef118737c72f1af64ad2f6f8c5e1921f818cdcb97b8fe6fc69bf66214" [[package]] name = "simdutf8" @@ -3548,36 +3502,36 @@ checksum = "e3a9fe34e3e7a50316060351f37187a3f546bce95496156754b601a5fa71b76e" [[package]] name = "simple_asn1" -version = "0.6.3" +version = "0.6.4" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "297f631f50729c8c99b84667867963997ec0b50f32b2a7dbcab828ef0541e8bb" +checksum = "0d585997b0ac10be3c5ee635f1bab02d512760d14b7c468801ac8a01d9ae5f1d" dependencies = [ "num-bigint", "num-traits", - "thiserror 2.0.17", + "thiserror", "time", ] [[package]] name = "slab" -version = "0.4.11" +version = "0.4.12" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "7a2ae44ef20feb57a68b23d846850f861394c2e02dc425a50098ae8c90267589" +checksum = "0c790de23124f9ab44544d7ac05d60440adc586479ce501c1d6d7da3cd8c9cf5" [[package]] name = "smallvec" -version = "1.15.1" +version = "1.15.2" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "67b1b7a3b5fe4f1376887184045fcf45c69e92af734b7aaddc05fb777b6fbd03" +checksum = "8ed6a63f02c8539c91a8685a86f4099661ba3da017932f6ebbea6de3f0fa7c90" [[package]] name = "socket2" -version = "0.6.1" +version = "0.6.4" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "17129e116933cf371d018bb80ae557e889637989d8638274fb25622827b03881" +checksum = "52d1cfed4120b4d927bf7c0f86d2087a4a7d6027c906d9f9d525a80573b9be51" dependencies = [ "libc", - "windows-sys 0.60.2", + "windows-sys 0.61.2", ] [[package]] @@ -3663,11 +3617,17 @@ version = "2.6.1" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "13c2bddecc57b384dee18652358fb23172facb8a2c51ccc10d74c157bdea3292" +[[package]] +name = "symlink" +version = "0.1.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "a7973cce6668464ea31f176d85b13c7ab3bba2cb3b77a2ed26abd7801688010a" + [[package]] name = "syn" -version = "2.0.110" +version = "2.0.118" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "a99801b5bd34ede4cf3fc688c5919368fea4e4814a4664359503e6015b280aea" +checksum = "1b9ae57f904213ebb649ce6895b8a66c66f0203b9319718f69a5612a065b1422" dependencies = [ "proc-macro2", "quote", @@ -3696,9 +3656,9 @@ dependencies = [ [[package]] name = "system-configuration" -version = "0.6.1" +version = "0.7.0" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "3c879d448e9d986b661742763247d3693ed13609438cf3d006f51f5368a5ba6b" +checksum = "a13f3d0daba03132c0aa9767f98351b3488edc2c100cda2d2ec2b04f3d8d3c8b" dependencies = [ "bitflags", "core-foundation 0.9.4", @@ -3728,12 +3688,12 @@ dependencies = [ [[package]] name = "tempfile" -version = "3.23.0" +version = "3.27.0" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "2d31c77bdf42a745371d260a26ca7163f1e0924b64afa0b688e61b5a9fa02f16" +checksum = "32497e9a4c7b38532efcdebeef879707aa9f794296a4f0244f6f69e9bc8574bd" dependencies = [ "fastrand", - "getrandom 0.3.4", + "getrandom 0.4.3", "once_cell", "rustix", "windows-sys 0.61.2", @@ -3747,38 +3707,18 @@ checksum = "8f50febec83f5ee1df3015341d8bd429f2d1cc62bcba7ea2076759d315084683" [[package]] name = "thiserror" -version = "1.0.69" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "b6aaf5339b578ea85b50e080feb250a3e8ae8cfcdff9a461c9ec2904bc923f52" -dependencies = [ - "thiserror-impl 1.0.69", -] - -[[package]] -name = "thiserror" -version = "2.0.17" +version = "2.0.18" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "f63587ca0f12b72a0600bcba1d40081f830876000bb46dd2337a3051618f4fc8" +checksum = "4288b5bcbc7920c07a1149a35cf9590a2aa808e0bc1eafaade0b80947865fbc4" dependencies = [ - "thiserror-impl 2.0.17", + "thiserror-impl", ] [[package]] name = "thiserror-impl" -version = "1.0.69" +version = "2.0.18" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "4fee6c4efc90059e10f81e6d42c60a18f76588c3d74cb83a0b242a2b6c7504c1" -dependencies = [ - "proc-macro2", - "quote", - "syn", -] - -[[package]] -name = "thiserror-impl" -version = "2.0.17" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "3ff15c8ecd7de3849db632e14d18d2571fa09dfc5ed93479bc4485c7a517c913" +checksum = "ebc4ee7f67670e9b64d05fa4253e753e016c6c95ff35b89b7941d6b856dec1d5" dependencies = [ "proc-macro2", "quote", @@ -3796,12 +3736,11 @@ dependencies = [ [[package]] name = "time" -version = "0.3.47" +version = "0.3.53" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "743bd48c283afc0388f9b8827b976905fb217ad9e647fae3a379a9283c4def2c" +checksum = "18dfaaeddcb932337b5e7866ee7d0ce9b76d2fd092997146f187ec09b4558a50" dependencies = [ "deranged", - "itoa", "num-conv", "powerfmt", "serde_core", @@ -3811,15 +3750,15 @@ dependencies = [ [[package]] name = "time-core" -version = "0.1.8" +version = "0.1.9" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "7694e1cfe791f8d31026952abf09c69ca6f6fa4e1a1229e18988f06a04a12dca" +checksum = "9e1c906769ad99c88eaa54e728060edef082f8e358ff32030cb7c7d315e81109" [[package]] name = "time-macros" -version = "0.2.27" +version = "0.2.31" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "2e70e4c5a0e0a8a4823ad65dfe1a6930e4f4d756dcd9dd7939022b5e8c501215" +checksum = "c431b87111666e491a90baa837f914fb45cd5dc3c268591b0220ff5057f2085f" dependencies = [ "num-conv", "time-core", @@ -3827,9 +3766,9 @@ dependencies = [ [[package]] name = "tinystr" -version = "0.8.2" +version = "0.8.3" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "42d3e9c45c09de15d06dd8acf5f4e0e399e85927b7f00711024eb7ae10fa4869" +checksum = "c8323304221c2a851516f22236c5722a72eaa19749016521d6dff0824447d96d" dependencies = [ "displaydoc", "zerovec", @@ -3852,9 +3791,9 @@ checksum = "1f3ccbac311fea05f86f61904b462b55fb3df8837a366dfc601a0161d0532f20" [[package]] name = "tokio" -version = "1.48.0" +version = "1.52.3" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "ff360e02eab121e0bc37a2d3b4d4dc622e6eda3a8e5253d5435ecf5bd4c68408" +checksum = "8fc7f01b389ac15039e4dc9531aa973a135d7a4135281b12d7c1bc79fd57fffe" dependencies = [ "bytes", "libc", @@ -3869,9 +3808,9 @@ dependencies = [ [[package]] name = "tokio-macros" -version = "2.6.0" +version = "2.7.0" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "af407857209536a95c8e56f8231ef2c2e2aff839b22e07a1ffcbc617e9db9fa5" +checksum = "385a6cb71ab9ab790c5fe8d67f1645e6c450a7ce006a33de03daa956cf70a496" dependencies = [ "proc-macro2", "quote", @@ -3911,9 +3850,9 @@ dependencies = [ [[package]] name = "tokio-stream" -version = "0.1.17" +version = "0.1.18" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "eca58d7bba4a75707817a2c44174253f9236b2d5fbd055602e9d5c07c139a047" +checksum = "32da49809aab5c3bc678af03902d4ccddea2a87d028d86392a4b1560c6906c70" dependencies = [ "futures-core", "pin-project-lite", @@ -3922,9 +3861,9 @@ dependencies = [ [[package]] name = "tokio-util" -version = "0.7.17" +version = "0.7.18" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "2efa149fe76073d6e8fd97ef4f4eca7b67f599660115591483572e406e165594" +checksum = "9ae9cec805b01e8fc3fd2fe289f89149a9b66dd16786abd8b19cfa7b48cb0098" dependencies = [ "bytes", "futures-core", @@ -3947,17 +3886,17 @@ dependencies = [ [[package]] name = "toml" -version = "0.9.8" +version = "0.9.12+spec-1.1.0" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "f0dc8b1fb61449e27716ec0e1bdf0f6b8f3e8f6b05391e8497b8b6d7804ea6d8" +checksum = "cf92845e79fc2e2def6a5d828f0801e29a2f8acc037becc5ab08595c7d5e9863" dependencies = [ "indexmap", "serde_core", - "serde_spanned 1.0.3", - "toml_datetime 0.7.3", + "serde_spanned 1.1.1", + "toml_datetime 0.7.5+spec-1.1.0", "toml_parser", "toml_writer", - "winnow", + "winnow 0.7.15", ] [[package]] @@ -3971,9 +3910,9 @@ dependencies = [ [[package]] name = "toml_datetime" -version = "0.7.3" +version = "0.7.5+spec-1.1.0" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "f2cdb639ebbc97961c51720f858597f7f24c4fc295327923af55b74c3c724533" +checksum = "92e1cfed4a3038bc5a127e35a2d360f145e1f4b971b551a2ba5fd7aedf7e1347" dependencies = [ "serde_core", ] @@ -3989,16 +3928,16 @@ dependencies = [ "serde_spanned 0.6.9", "toml_datetime 0.6.11", "toml_write", - "winnow", + "winnow 0.7.15", ] [[package]] name = "toml_parser" -version = "1.0.4" +version = "1.1.2+spec-1.1.0" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "c0cbe268d35bdb4bb5a56a2de88d0ad0eb70af5384a99d648cd4b3d04039800e" +checksum = "a2abe9b86193656635d2411dc43050282ca48aa31c2451210f4202550afb7526" dependencies = [ - "winnow", + "winnow 1.0.3", ] [[package]] @@ -4009,15 +3948,15 @@ checksum = "5d99f8c9a7727884afe522e9bd5edbfc91a3312b36a77b5fb8926e4c31a41801" [[package]] name = "toml_writer" -version = "1.0.4" +version = "1.1.1+spec-1.1.0" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "df8b2b54733674ad286d16267dcfc7a71ed5c776e4ac7aa3c3e2561f7c637bf2" +checksum = "756daf9b1013ebe47a8776667b466417e2d4c5679d441c26230efd9ef78692db" [[package]] name = "tonic" -version = "0.14.2" +version = "0.14.6" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "eb7613188ce9f7df5bfe185db26c5814347d110db17920415cf2fbcad85e7203" +checksum = "ac2a5518c70fa84342385732db33fb3f44bc4cc748936eb5833d2df34d6445ef" dependencies = [ "async-trait", "axum", @@ -4044,9 +3983,9 @@ dependencies = [ [[package]] name = "tonic-prost" -version = "0.14.2" +version = "0.14.6" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "66bd50ad6ce1252d87ef024b3d64fe4c3cf54a86fb9ef4c631fdd0ded7aeaa67" +checksum = "50849f68853be452acf590cde0b146665b8d507b3b8af17261df47e02c209ea0" dependencies = [ "bytes", "prost", @@ -4055,9 +3994,9 @@ dependencies = [ [[package]] name = "tonic-types" -version = "0.14.5" +version = "0.14.6" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "2a875a902255423d34c1f20838ab374126db8eb41625b7947a1d54113b0b7399" +checksum = "73ab1b02061f83d519bba3caa167f88f261ef05720ab8ebc954ade70de3348e8" dependencies = [ "prost", "prost-types", @@ -4066,9 +4005,9 @@ dependencies = [ [[package]] name = "tower" -version = "0.5.2" +version = "0.5.3" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "d039ad9159c98b70ecfd540b2573b97f7f52c3e8d9f8ad57a24b916a536975f9" +checksum = "ebe5ef63511595f1344e2d5cfa636d973292adc0eec1f0ad45fae9f0851ab1d4" dependencies = [ "futures-core", "futures-util", @@ -4085,9 +4024,9 @@ dependencies = [ [[package]] name = "tower-http" -version = "0.6.8" +version = "0.6.11" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "d4e6559d53cc268e5031cd8429d05415bc4cb4aefc4aa5d6cc35fbf5b924a1f8" +checksum = "4cfcf7e2740e6fc6d4d688b4ef00650406bb94adf4731e43c096c3a19fe40840" dependencies = [ "bitflags", "bytes", @@ -4098,7 +4037,6 @@ dependencies = [ "http-body-util", "http-range-header", "httpdate", - "iri-string", "mime", "mime_guess", "percent-encoding", @@ -4109,6 +4047,7 @@ dependencies = [ "tower-layer", "tower-service", "tracing", + "url", ] [[package]] @@ -4136,12 +4075,13 @@ dependencies = [ [[package]] name = "tracing-appender" -version = "0.2.3" +version = "0.2.5" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "3566e8ce28cc0a3fe42519fc80e6b4c943cc4c8cef275620eb8dac2d3d4e06cf" +checksum = "050686193eb999b4bb3bc2acfa891a13da00f79734704c4b8b4ef1a10b368a3c" dependencies = [ "crossbeam-channel", - "thiserror 1.0.69", + "symlink", + "thiserror", "time", "tracing-subscriber", ] @@ -4247,9 +4187,9 @@ checksum = "e421abadd41a4225275504ea4d6566923418b7f05506fbc9c0fe86ba7396114b" [[package]] name = "typenum" -version = "1.19.0" +version = "1.20.1" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "562d481066bde0658276a35467c4af00bdc6ee726305698a55b86e61d7ad82bb" +checksum = "b6f5e870be6c3b371b77fe0ee0bafb859fa4964b4404c27de1d380043c4dda20" [[package]] name = "uncased" @@ -4262,15 +4202,15 @@ dependencies = [ [[package]] name = "unicase" -version = "2.8.1" +version = "2.9.0" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "75b844d17643ee918803943289730bec8aac480150456169e647ed0b576ba539" +checksum = "dbc4bc3a9f746d862c45cb89d705aa10f187bb96c76001afab07a0d35ce60142" [[package]] name = "unicode-ident" -version = "1.0.22" +version = "1.0.24" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "9312f7c4f6ff9069b165498234ce8be658059c6728633667c526e27dc2cf1df5" +checksum = "e6e4313cd5fcd3dad5cafa179702e2b244f760991f45397d14d4ebf38247da75" [[package]] name = "unicode-xid" @@ -4286,9 +4226,9 @@ checksum = "8ecb6da28b8a351d773b68d5825ac39017e680750f980f3a1a85cd8dd28a47c1" [[package]] name = "ureq" -version = "3.2.0" +version = "3.3.0" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "fdc97a28575b85cfedf2a7e7d3cc64b3e11bd8ac766666318003abbacc7a21fc" +checksum = "dea7109cdcd5864d4eeb1b58a1648dc9bf520360d7af16ec26d0a9354bafcfc0" dependencies = [ "base64 0.22.1", "flate2", @@ -4297,15 +4237,15 @@ dependencies = [ "rustls", "rustls-pki-types", "ureq-proto", - "utf-8", + "utf8-zero", "webpki-roots", ] [[package]] name = "ureq-proto" -version = "0.5.3" +version = "0.6.0" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "d81f9efa9df032be5934a46a068815a10a042b494b6a58cb0a1a97bb5467ed6f" +checksum = "e994ba84b0bd1b1b0cf92878b7ef898a5c1760108fe7b6010327e274917a808c" dependencies = [ "base64 0.22.1", "http", @@ -4315,9 +4255,9 @@ dependencies = [ [[package]] name = "url" -version = "2.5.7" +version = "2.5.8" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "08bc136a29a3d1758e07a9cca267be308aeebf5cfd5a10f3f67ab2097683ef5b" +checksum = "ff67a8a4397373c3ef660812acab3268222035010ab8680ec4215f38ba3d0eed" dependencies = [ "form_urlencoded", "idna", @@ -4332,10 +4272,10 @@ source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "daf8dba3b7eb870caf1ddeed7bc9d2a049f3cfdfae7cb521b087cc33ae4c49da" [[package]] -name = "utf-8" -version = "0.7.6" +name = "utf8-zero" +version = "0.8.1" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "09cc8ee72d2a9becf2f2febe0205bbed8fc6615b7cb429ad062dc7b7ddd036a9" +checksum = "b8c0a043c9540bae7c578c88f91dda8bd82e59ae27c21baca69c8b191aaf5a6e" [[package]] name = "utf8_iter" @@ -4351,11 +4291,11 @@ checksum = "06abde3611657adf66d383f00b093d7faecc7fa57071cce2578660c9f1010821" [[package]] name = "uuid" -version = "1.18.1" +version = "1.23.4" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "2f87b8aa10b915a06587d0dec516c282ff295b475d94abf425d62b57710070a2" +checksum = "bf80a72845275afea99e7f2b434723d3bc7e38470fcd1c7ed39a599c73319a53" dependencies = [ - "getrandom 0.3.4", + "getrandom 0.4.3", "js-sys", "wasm-bindgen", ] @@ -4404,18 +4344,18 @@ checksum = "ccf3ec651a847eb01de73ccad15eb7d99f80485de043efb2f370cd654f4ea44b" [[package]] name = "wasip2" -version = "1.0.1+wasi-0.2.4" +version = "1.0.4+wasi-0.2.12" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "0562428422c63773dad2c345a1882263bbf4d65cf3f42e90921f787ef5ad58e7" +checksum = "b67efb37e106e55ce722a510d6b5f9c17f083e5fc79afc2badeb12cc313d9487" dependencies = [ "wit-bindgen", ] [[package]] name = "wasm-bindgen" -version = "0.2.105" +version = "0.2.126" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "da95793dfc411fbbd93f5be7715b0578ec61fe87cb1a42b12eb625caa5c5ea60" +checksum = "4b067c0c11094aef6b7a801c1e34a26affafdf3d051dba08456b868789aaf9a4" dependencies = [ "cfg-if", "once_cell", @@ -4426,22 +4366,19 @@ dependencies = [ [[package]] name = "wasm-bindgen-futures" -version = "0.4.55" +version = "0.4.76" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "551f88106c6d5e7ccc7cd9a16f312dd3b5d36ea8b4954304657d5dfba115d4a0" +checksum = "c62df1340f32221cb9c54d6a27b030e3dba64361d4a95bed55f9aacb44da291d" dependencies = [ - "cfg-if", "js-sys", - "once_cell", "wasm-bindgen", - "web-sys", ] [[package]] name = "wasm-bindgen-macro" -version = "0.2.105" +version = "0.2.126" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "04264334509e04a7bf8690f2384ef5265f05143a4bff3889ab7a3269adab59c2" +checksum = "167ce5e579f6bcf889c4f7175a8a5a585de84e8ff93976ce393efa5f2837aab1" dependencies = [ "quote", "wasm-bindgen-macro-support", @@ -4449,9 +4386,9 @@ dependencies = [ [[package]] name = "wasm-bindgen-macro-support" -version = "0.2.105" +version = "0.2.126" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "420bc339d9f322e562942d52e115d57e950d12d88983a14c79b86859ee6c7ebc" +checksum = "f3997c7839262f4ef12cf90b818d6340c18e80f263f1a94bf157d0ec4420380e" dependencies = [ "bumpalo", "proc-macro2", @@ -4462,18 +4399,18 @@ dependencies = [ [[package]] name = "wasm-bindgen-shared" -version = "0.2.105" +version = "0.2.126" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "76f218a38c84bcb33c25ec7059b07847d465ce0e0a76b995e134a45adcb6af76" +checksum = "dc1b4cb0cc549fcf58d7dfc081778139b3d283a081644e833e84682ad71cea24" dependencies = [ "unicode-ident", ] [[package]] name = "web-sys" -version = "0.3.82" +version = "0.3.103" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "3a1f95c0d03a47f4ae1f7a64643a6bb97465d9b740f0fa8f90ea33915c99a9a1" +checksum = "8622dcb61c0bcc9fffa6938bed81210af2da9a7e4a1a834b2e37a59b6dfb6141" dependencies = [ "js-sys", "wasm-bindgen", @@ -4491,9 +4428,9 @@ dependencies = [ [[package]] name = "webpki-roots" -version = "1.0.6" +version = "1.0.8" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "22cfaf3c063993ff62e73cb4311efde4db1efb31ab78a3e5c457939ad5cc0bed" +checksum = "bf85cb06032201fa7c6f829d7db5a7e5aa45bcc0655327713065f6f0576731bf" dependencies = [ "rustls-pki-types", ] @@ -4574,16 +4511,7 @@ version = "0.52.0" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "282be5f36a8ce781fad8c8ae18fa3f9beff57ec1b52cb3de0789201425d9a33d" dependencies = [ - "windows-targets 0.52.6", -] - -[[package]] -name = "windows-sys" -version = "0.60.2" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "f2f500e4d28234f72040990ec9d39e3a6b950f9f22d3dba18416c35882612bcb" -dependencies = [ - "windows-targets 0.53.5", + "windows-targets", ] [[package]] @@ -4601,31 +4529,14 @@ version = "0.52.6" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "9b724f72796e036ab90c1021d4780d4d3d648aca59e491e6b98e725b84e99973" dependencies = [ - "windows_aarch64_gnullvm 0.52.6", - "windows_aarch64_msvc 0.52.6", - "windows_i686_gnu 0.52.6", - "windows_i686_gnullvm 0.52.6", - "windows_i686_msvc 0.52.6", - "windows_x86_64_gnu 0.52.6", - "windows_x86_64_gnullvm 0.52.6", - "windows_x86_64_msvc 0.52.6", -] - -[[package]] -name = "windows-targets" -version = "0.53.5" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "4945f9f551b88e0d65f3db0bc25c33b8acea4d9e41163edf90dcd0b19f9069f3" -dependencies = [ - "windows-link", - "windows_aarch64_gnullvm 0.53.1", - "windows_aarch64_msvc 0.53.1", - "windows_i686_gnu 0.53.1", - "windows_i686_gnullvm 0.53.1", - "windows_i686_msvc 0.53.1", - "windows_x86_64_gnu 0.53.1", - "windows_x86_64_gnullvm 0.53.1", - "windows_x86_64_msvc 0.53.1", + "windows_aarch64_gnullvm", + "windows_aarch64_msvc", + "windows_i686_gnu", + "windows_i686_gnullvm", + "windows_i686_msvc", + "windows_x86_64_gnu", + "windows_x86_64_gnullvm", + "windows_x86_64_msvc", ] [[package]] @@ -4634,116 +4545,74 @@ version = "0.52.6" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "32a4622180e7a0ec044bb555404c800bc9fd9ec262ec147edd5989ccd0c02cd3" -[[package]] -name = "windows_aarch64_gnullvm" -version = "0.53.1" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "a9d8416fa8b42f5c947f8482c43e7d89e73a173cead56d044f6a56104a6d1b53" - [[package]] name = "windows_aarch64_msvc" version = "0.52.6" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "09ec2a7bb152e2252b53fa7803150007879548bc709c039df7627cabbd05d469" -[[package]] -name = "windows_aarch64_msvc" -version = "0.53.1" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "b9d782e804c2f632e395708e99a94275910eb9100b2114651e04744e9b125006" - [[package]] name = "windows_i686_gnu" version = "0.52.6" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "8e9b5ad5ab802e97eb8e295ac6720e509ee4c243f69d781394014ebfe8bbfa0b" -[[package]] -name = "windows_i686_gnu" -version = "0.53.1" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "960e6da069d81e09becb0ca57a65220ddff016ff2d6af6a223cf372a506593a3" - [[package]] name = "windows_i686_gnullvm" version = "0.52.6" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "0eee52d38c090b3caa76c563b86c3a4bd71ef1a819287c19d586d7334ae8ed66" -[[package]] -name = "windows_i686_gnullvm" -version = "0.53.1" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "fa7359d10048f68ab8b09fa71c3daccfb0e9b559aed648a8f95469c27057180c" - [[package]] name = "windows_i686_msvc" version = "0.52.6" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "240948bc05c5e7c6dabba28bf89d89ffce3e303022809e73deaefe4f6ec56c66" -[[package]] -name = "windows_i686_msvc" -version = "0.53.1" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "1e7ac75179f18232fe9c285163565a57ef8d3c89254a30685b57d83a38d326c2" - [[package]] name = "windows_x86_64_gnu" version = "0.52.6" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "147a5c80aabfbf0c7d901cb5895d1de30ef2907eb21fbbab29ca94c5b08b1a78" -[[package]] -name = "windows_x86_64_gnu" -version = "0.53.1" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "9c3842cdd74a865a8066ab39c8a7a473c0778a3f29370b5fd6b4b9aa7df4a499" - [[package]] name = "windows_x86_64_gnullvm" version = "0.52.6" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "24d5b23dc417412679681396f2b49f3de8c1473deb516bd34410872eff51ed0d" -[[package]] -name = "windows_x86_64_gnullvm" -version = "0.53.1" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "0ffa179e2d07eee8ad8f57493436566c7cc30ac536a3379fdf008f47f6bb7ae1" - [[package]] name = "windows_x86_64_msvc" version = "0.52.6" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "589f6da84c646204747d1270a2a5661ea66ed1cced2631d546fdfb155959f9ec" -[[package]] -name = "windows_x86_64_msvc" -version = "0.53.1" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "d6bbff5f0aada427a1e5a6da5f1f98158182f26556f345ac9e04d36d0ebed650" - [[package]] name = "winnow" -version = "0.7.13" +version = "0.7.15" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "21a0236b59786fed61e2a80582dd500fe61f18b5dca67a4a067d0bc9039339cf" +checksum = "df79d97927682d2fd8adb29682d1140b343be4ac0f08fd68b7765d9c059d3945" dependencies = [ "memchr", ] +[[package]] +name = "winnow" +version = "1.0.3" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "0592e1c9d151f854e6fd382574c3a0855250e1d9b2f99d9281c6e6391af352f1" + [[package]] name = "wit-bindgen" -version = "0.46.0" +version = "0.57.1" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "f17a85883d4e6d00e8a97c586de764dabcc06133f7f1d55dce5cdc070ad7fe59" +checksum = "1ebf944e87a7c253233ad6766e082e3cd714b5d03812acc24c318f549614536e" [[package]] name = "writeable" -version = "0.6.2" +version = "0.6.3" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "9edde0db4769d2dc68579893f2306b26c6ecfbe0ef499b013d731b7b9247e0b9" +checksum = "1ffae5123b2d3fc086436f8834ae3ab053a283cfac8fe0a0b8eaae044768a4c4" [[package]] name = "xattr" @@ -4772,9 +4641,9 @@ checksum = "cfe53a6657fd280eaa890a3bc59152892ffa3e30101319d168b781ed6529b049" [[package]] name = "yoke" -version = "0.8.1" +version = "0.8.3" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "72d6e5c6afb84d73944e5cedb052c4680d5657337201555f9f2a16b7406d4954" +checksum = "709fe23a0424b6a435d82152b1bd3fdfb0833487d5fa90d05d42762a9891fef5" dependencies = [ "stable_deref_trait", "yoke-derive", @@ -4783,9 +4652,9 @@ dependencies = [ [[package]] name = "yoke-derive" -version = "0.8.1" +version = "0.8.2" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "b659052874eb698efe5b9e8cf382204678a0086ebf46982b79d6ca3182927e5d" +checksum = "de844c262c8848816172cef550288e7dc6c7b7814b4ee56b3e1553f275f1858e" dependencies = [ "proc-macro2", "quote", @@ -4795,18 +4664,18 @@ dependencies = [ [[package]] name = "zerocopy" -version = "0.8.27" +version = "0.8.54" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "0894878a5fa3edfd6da3f88c4805f4c8558e2b996227a3d864f47fe11e38282c" +checksum = "b7cbbc0a705a0fd05cc3676525980d2bf5a9bc4adac6d6475209a7887cf59d19" dependencies = [ "zerocopy-derive", ] [[package]] name = "zerocopy-derive" -version = "0.8.27" +version = "0.8.54" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "88d2b8d9c68ad2b9e4340d7832716a4d21a22a1154777ad56ea55c51a9cf3831" +checksum = "e2e817b7b52d0c7358d3246da9d69935ebb18116b2b102b4230dac079b4862f5" dependencies = [ "proc-macro2", "quote", @@ -4815,18 +4684,18 @@ dependencies = [ [[package]] name = "zerofrom" -version = "0.1.6" +version = "0.1.8" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "50cc42e0333e05660c3587f3bf9d0478688e15d870fab3346451ce7f8c9fbea5" +checksum = "0ec05a11813ea801ff6d75110ad09cd0824ddba17dfe17128ea0d5f68e6c5272" dependencies = [ "zerofrom-derive", ] [[package]] name = "zerofrom-derive" -version = "0.1.6" +version = "0.1.7" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "d71e5d6e06ab090c67b5e44993ec16b72dcbaabc526db883a360057678b48502" +checksum = "11532158c46691caf0f2593ea8358fed6bbf68a0315e80aae9bd41fbade684a1" dependencies = [ "proc-macro2", "quote", @@ -4836,15 +4705,29 @@ dependencies = [ [[package]] name = "zeroize" -version = "1.8.2" +version = "1.9.0" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "b97154e67e32c85465826e8bcc1c59429aaaf107c1e4a9e53c8d8ccd5eff88d0" +checksum = "e13c156562582aa81c60cb29407084cdb54c4164760106ab78e6c5b0858cf64e" +dependencies = [ + "zeroize_derive", +] + +[[package]] +name = "zeroize_derive" +version = "1.5.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "3c50655cbb0fe3fc43170059e702f1ce5e19b84cec58dc87b037a09935c2f328" +dependencies = [ + "proc-macro2", + "quote", + "syn", +] [[package]] name = "zerotrie" -version = "0.2.3" +version = "0.2.4" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "2a59c17a5562d507e4b54960e8569ebee33bee890c70aa3fe7b97e85a9fd7851" +checksum = "0f9152d31db0792fa83f70fb2f83148effb5c1f5b8c7686c3459e361d9bc20bf" dependencies = [ "displaydoc", "yoke", @@ -4853,9 +4736,9 @@ dependencies = [ [[package]] name = "zerovec" -version = "0.11.5" +version = "0.11.6" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "6c28719294829477f525be0186d13efa9a3c602f7ec202ca9e353d310fb9a002" +checksum = "90f911cbc359ab6af17377d242225f4d75119aec87ea711a880987b18cd7b239" dependencies = [ "yoke", "zerofrom", @@ -4864,11 +4747,17 @@ dependencies = [ [[package]] name = "zerovec-derive" -version = "0.11.2" +version = "0.11.3" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "eadce39539ca5cb3985590102671f2567e659fca9666581ad3411d59207951f3" +checksum = "625dc425cab0dca6dc3c3319506e6593dcb08a9f387ea3b284dbd52a92c40555" dependencies = [ "proc-macro2", "quote", "syn", ] + +[[package]] +name = "zmij" +version = "1.0.21" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "b8848ee67ecc8aedbaf3e4122217aff892639231befc6a1b58d29fff4c2cabaa" diff --git a/MODULE.bazel b/MODULE.bazel index 40cbea6f0..c4e80bd0d 100644 --- a/MODULE.bazel +++ b/MODULE.bazel @@ -59,27 +59,7 @@ crate = use_extension("@rules_rust//crate_universe:extensions.bzl", "crate", iso crate.from_cargo( name = "crate_index", cargo_lockfile = "//:Cargo.lock", - manifests = [ - "//:Cargo.toml", - "//cda-build:Cargo.toml", - "//cda-comm-doip:Cargo.toml", - "//cda-comm-uds:Cargo.toml", - "//cda-core:Cargo.toml", - "//cda-database:Cargo.toml", - "//cda-extra:Cargo.toml", - "//cda-health:Cargo.toml", - "//cda-interfaces:Cargo.toml", - "//cda-main:Cargo.toml", - "//cda-plugin-security:Cargo.toml", - "//cda-sovd:Cargo.toml", - "//cda-sovd-interfaces:Cargo.toml", - "//cda-storage:Cargo.toml", - "//cda-tracing:Cargo.toml", - "//comm-mbedtls/mbedtls-rs:Cargo.toml", - "//comm-mbedtls/mbedtls-sys:Cargo.toml", - "//integration-tests:Cargo.toml", - "//opensovd-axum-extra:Cargo.toml", - ], + manifests = ["//:Cargo.toml"], ) # mbedtls-sys: point build.rs at pre-fetched + pre-patched source, skip native build diff --git a/bazel/rust_crate.bzl b/bazel/rust_crate.bzl new file mode 100644 index 000000000..ab8b4159d --- /dev/null +++ b/bazel/rust_crate.bzl @@ -0,0 +1,70 @@ +# SPDX-License-Identifier: Apache-2.0 +# SPDX-FileCopyrightText: 2026 The Contributors to Eclipse OpenSOVD (see CONTRIBUTORS) +# +# See the NOTICE file(s) distributed with this work for additional +# information regarding copyright ownership. +# +# This program and the accompanying materials are made available under the +# terms of the Apache License Version 2.0 which is available at +# https://www.apache.org/licenses/LICENSE-2.0 + +"""Workspace-local wrappers for common rules_rust target patterns.""" + +load("@crate_index//:defs.bzl", "aliases", "all_crate_deps") +load("@rules_rust//cargo:defs.bzl", "cargo_build_script") +load("@rules_rust//rust:defs.bzl", "rust_binary", "rust_library") + +def workspace_rust_library( + name, + srcs, + crate_name, + local_deps = None, + local_proc_macro_deps = None, + crate_features = None, + **kwargs): + """Define a first-party rust_library using crate_universe-generated deps.""" + rust_library( + name = name, + srcs = srcs, + crate_name = crate_name, + edition = "2024", + aliases = aliases(normal = True, proc_macro = True), + crate_features = crate_features or [], + deps = (local_deps or []) + all_crate_deps(normal = True), + proc_macro_deps = (local_proc_macro_deps or []) + all_crate_deps(proc_macro = True), + **kwargs + ) + +def workspace_rust_binary( + name, + srcs, + local_deps = None, + crate_features = None, + **kwargs): + """Define a first-party rust_binary using crate_universe-generated deps.""" + rust_binary( + name = name, + srcs = srcs, + edition = "2024", + aliases = aliases(normal = True, proc_macro = True), + crate_features = crate_features or [], + deps = (local_deps or []) + all_crate_deps(normal = True), + **kwargs + ) + +def workspace_cargo_build_script( + name, + srcs, + local_deps = None, + local_proc_macro_deps = None, + **kwargs): + """Define a cargo_build_script using crate_universe-generated build deps.""" + cargo_build_script( + name = name, + srcs = srcs, + edition = "2024", + aliases = aliases(build = True, build_proc_macro = True), + deps = (local_deps or []) + all_crate_deps(build = True), + proc_macro_deps = (local_proc_macro_deps or []) + all_crate_deps(build_proc_macro = True), + **kwargs + ) \ No newline at end of file diff --git a/cda-build/BUILD.bazel b/cda-build/BUILD.bazel index b3bdfc67f..0a24891cc 100644 --- a/cda-build/BUILD.bazel +++ b/cda-build/BUILD.bazel @@ -10,16 +10,12 @@ # cda-build: Common build-time utilities (nightly detection). -load("@rules_rust//rust:defs.bzl", "rust_library") +load("//:bazel/rust_crate.bzl", "workspace_rust_library") package(default_visibility = ["//visibility:public"]) -rust_library( +workspace_rust_library( name = "cda-build", srcs = glob(["src/**/*.rs"]), crate_name = "cda_build", - edition = "2024", - proc_macro_deps = [ - "@crate_index//:rustversion", - ], ) diff --git a/cda-comm-doip/BUILD.bazel b/cda-comm-doip/BUILD.bazel index 048a5deb4..c970c12af 100644 --- a/cda-comm-doip/BUILD.bazel +++ b/cda-comm-doip/BUILD.bazel @@ -11,36 +11,20 @@ # cda-comm-doip: DoIP (Diagnostics over IP) communication transport. # TLS backend is selected via //:tls_backend config flag (openssl or mbedtls). -load("@rules_rust//rust:defs.bzl", "rust_library") +load("//:bazel/rust_crate.bzl", "workspace_rust_library") package(default_visibility = ["//visibility:public"]) -rust_library( +workspace_rust_library( name = "cda-comm-doip", srcs = glob(["src/**/*.rs"]), - edition = "2024", crate_features = select({ "//:use_openssl": ["openssl"], "//:use_mbedtls": ["mbedtls"], }), crate_name = "cda_comm_doip", - deps = [ - "//cda-interfaces", - "@crate_index//:doip-codec", - "@crate_index//:doip-definitions", - "@crate_index//:futures", - "@crate_index//:schemars", - "@crate_index//:serde", - "@crate_index//:socket2", - "@crate_index//:thiserror", - "@crate_index//:tokio", - "@crate_index//:tokio-util", - "@crate_index//:tracing", - ] + select({ - "//:use_openssl": [ - "@crate_index//:openssl", - "@crate_index//:tokio-openssl", - ], + local_deps = ["//cda-interfaces"] + select({ + "//:use_openssl": [], "//:use_mbedtls": [ "//comm-mbedtls/mbedtls-rs", ], diff --git a/cda-comm-uds/BUILD.bazel b/cda-comm-uds/BUILD.bazel index 7cb3d4a1f..8cb3d45f2 100644 --- a/cda-comm-uds/BUILD.bazel +++ b/cda-comm-uds/BUILD.bazel @@ -10,25 +10,13 @@ # cda-comm-uds: UDS (Unified Diagnostic Services) messaging layer. -load("@rules_rust//rust:defs.bzl", "rust_library") +load("//:bazel/rust_crate.bzl", "workspace_rust_library") package(default_visibility = ["//visibility:public"]) -rust_library( +workspace_rust_library( name = "cda-comm-uds", srcs = glob(["src/**/*.rs"]), crate_name = "cda_comm_uds", - edition = "2024", - deps = [ - "//cda-interfaces", - "@crate_index//:futures", - "@crate_index//:serde_json", - "@crate_index//:socket2", - "@crate_index//:strum", - "@crate_index//:tokio", - "@crate_index//:tracing", - ], - proc_macro_deps = [ - "@crate_index//:async-trait", - ], + local_deps = ["//cda-interfaces"], ) diff --git a/cda-core/BUILD.bazel b/cda-core/BUILD.bazel index a33d2ac3c..4b21326b4 100644 --- a/cda-core/BUILD.bazel +++ b/cda-core/BUILD.bazel @@ -10,25 +10,17 @@ # cda-core: Diagnostic core logic and orchestration. -load("@rules_rust//rust:defs.bzl", "rust_library") +load("//:bazel/rust_crate.bzl", "workspace_rust_library") package(default_visibility = ["//visibility:public"]) -rust_library( +workspace_rust_library( name = "cda-core", srcs = glob(["src/**/*.rs"]), crate_name = "cda_core", - edition = "2024", - deps = [ + local_deps = [ "//cda-database", "//cda-interfaces", "//cda-plugin-security", - "@crate_index//:num-traits", - "@crate_index//:parking_lot", - "@crate_index//:schemars", - "@crate_index//:serde", - "@crate_index//:serde_json", - "@crate_index//:tokio", - "@crate_index//:tracing", ], ) diff --git a/cda-database/BUILD.bazel b/cda-database/BUILD.bazel index adf8fcb5f..99ef410f2 100644 --- a/cda-database/BUILD.bazel +++ b/cda-database/BUILD.bazel @@ -10,43 +10,22 @@ # cda-database: ECU database layer for loading/querying diagnostic data (ODX/PDX). -load("@rules_rust//cargo:defs.bzl", "cargo_build_script") -load("@rules_rust//rust:defs.bzl", "rust_library") +load("//:bazel/rust_crate.bzl", "workspace_cargo_build_script", "workspace_rust_library") package(default_visibility = ["//visibility:public"]) -cargo_build_script( +workspace_cargo_build_script( name = "build_script", srcs = ["build.rs"], - edition = "2024", - deps = [ - "//cda-build", - "@crate_index//:cargo_toml", - "@crate_index//:prost-build", - "@crate_index//:toml", - ], + local_deps = ["//cda-build"], ) -rust_library( +workspace_rust_library( name = "cda-database", srcs = glob(["src/**/*.rs"]), crate_name = "cda_database", - edition = "2024", - deps = [ + local_deps = [ ":build_script", "//cda-interfaces", - "@crate_index//:bytes", - "@crate_index//:flatbuffers", - "@crate_index//:memmap2", - "@crate_index//:ouroboros", - "@crate_index//:prost", - "@crate_index//:schemars", - "@crate_index//:serde", - "@crate_index//:serde_json", - "@crate_index//:sha2", - "@crate_index//:tokio", - "@crate_index//:tracing", - "@crate_index//:uuid", - "@crate_index//:xz2", ], ) diff --git a/cda-extra/BUILD.bazel b/cda-extra/BUILD.bazel index c1228d84f..dc931cde6 100644 --- a/cda-extra/BUILD.bazel +++ b/cda-extra/BUILD.bazel @@ -11,16 +11,14 @@ # cda-extra: Optional platform extras (e.g., systemd notify). # By default all deps are optional; the systemd-notify feature enables them. -load("@rules_rust//rust:defs.bzl", "rust_library") +load("//:bazel/rust_crate.bzl", "workspace_rust_library") package(default_visibility = ["//visibility:public"]) -rust_library( +workspace_rust_library( name = "cda-extra", srcs = glob(["src/**/*.rs"]), crate_name = "cda_extra", - edition = "2024", # No features enabled by default -- systemd-notify is Linux-only. # Enable via crate_features = ["systemd-notify"] if needed. - deps = [], ) diff --git a/cda-health/BUILD.bazel b/cda-health/BUILD.bazel index 7a140e5d6..4ffe6b0d2 100644 --- a/cda-health/BUILD.bazel +++ b/cda-health/BUILD.bazel @@ -10,28 +10,16 @@ # cda-health: Health check interface for monitoring service status. -load("@rules_rust//rust:defs.bzl", "rust_library") +load("//:bazel/rust_crate.bzl", "workspace_rust_library") package(default_visibility = ["//visibility:public"]) -rust_library( +workspace_rust_library( name = "cda-health", srcs = glob(["src/**/*.rs"]), crate_name = "cda_health", - edition = "2024", - deps = [ + local_deps = [ "//cda-interfaces", "//cda-sovd", - "@crate_index//:aide", - "@crate_index//:axum", - "@crate_index//:chrono", - "@crate_index//:futures", - "@crate_index//:schemars", - "@crate_index//:serde", - "@crate_index//:thiserror", - "@crate_index//:tokio", - ], - proc_macro_deps = [ - "@crate_index//:async-trait", ], ) diff --git a/cda-interfaces/BUILD.bazel b/cda-interfaces/BUILD.bazel index 4ed3286eb..e665010a4 100644 --- a/cda-interfaces/BUILD.bazel +++ b/cda-interfaces/BUILD.bazel @@ -10,31 +10,12 @@ # cda-interfaces: Shared interfaces and types used across CDA crates. -load("@rules_rust//rust:defs.bzl", "rust_library") +load("//:bazel/rust_crate.bzl", "workspace_rust_library") package(default_visibility = ["//visibility:public"]) -rust_library( +workspace_rust_library( name = "cda-interfaces", srcs = glob(["src/**/*.rs"]), crate_name = "cda_interfaces", - edition = "2024", - deps = [ - "@crate_index//:bytes", - "@crate_index//:foldhash", - "@crate_index//:hex", - "@crate_index//:parking_lot", - "@crate_index//:rkyv", - "@crate_index//:schemars", - "@crate_index//:serde", - "@crate_index//:serde_json", - "@crate_index//:strum", - "@crate_index//:thiserror", - "@crate_index//:tokio", - "@crate_index//:tracing", - ], - proc_macro_deps = [ - "@crate_index//:async-trait", - "@crate_index//:strum_macros", - ], ) diff --git a/cda-main/BUILD.bazel b/cda-main/BUILD.bazel index a7a4f8127..82fac4bea 100644 --- a/cda-main/BUILD.bazel +++ b/cda-main/BUILD.bazel @@ -12,39 +12,34 @@ # Builds the opensovd-cda binary and library. # TLS backend is selected via //:tls_backend config flag. -load("@rules_rust//cargo:defs.bzl", "cargo_build_script") -load("@rules_rust//rust:defs.bzl", "rust_binary", "rust_library") +load("//:bazel/rust_crate.bzl", "workspace_cargo_build_script", "workspace_rust_binary", "workspace_rust_library") package(default_visibility = ["//visibility:public"]) -cargo_build_script( +workspace_cargo_build_script( name = "build_script", srcs = ["build.rs"], - edition = "2024", + local_deps = ["@crate_index//:chrono"], build_script_env = { # Provide deterministic build metadata. # For production builds, override via --action_env or workspace_status_command. "SOURCE_DATE_EPOCH": "0", "SOURCE_GIT_SHA": "bazel", }, - deps = [ - "@crate_index//:chrono", - ], ) -rust_library( +workspace_rust_library( name = "opensovd_cda_lib", srcs = glob( ["src/**/*.rs"], exclude = ["src/main.rs"], ), - edition = "2024", crate_features = ["health"] + select({ "//:use_openssl": ["openssl"], "//:use_mbedtls": ["mbedtls"], }), crate_name = "opensovd_cda_lib", - deps = [ + local_deps = [ ":build_script", "//cda-comm-doip", "//cda-comm-uds", @@ -52,44 +47,30 @@ rust_library( "//cda-database", "//cda-health", "//cda-interfaces", + "//cda-plugin-runtime-update", "//cda-plugin-security", "//cda-sovd", + "//cda-storage", "//cda-tracing", - "@crate_index//:clap", - "@crate_index//:figment", - "@crate_index//:futures", - "@crate_index//:mimalloc", - "@crate_index//:schemars", - "@crate_index//:serde", - "@crate_index//:serde_json", - "@crate_index//:thiserror", - "@crate_index//:tokio", - "@crate_index//:toml", - "@crate_index//:tracing", - "@crate_index//:tracing-subscriber", ], ) -rust_binary( +workspace_rust_binary( name = "opensovd-cda", srcs = ["src/main.rs"], - edition = "2024", crate_features = ["health"] + select({ "//:use_openssl": ["openssl"], "//:use_mbedtls": ["mbedtls"], }), - deps = [ + local_deps = [ ":build_script", ":opensovd_cda_lib", "//cda-core", "//cda-health", "//cda-interfaces", + "//cda-plugin-runtime-update", "//cda-plugin-security", "//cda-sovd", - "@crate_index//:clap", - "@crate_index//:futures", - "@crate_index//:serde_json", - "@crate_index//:tokio", - "@crate_index//:tracing", + "//cda-storage", ], ) diff --git a/cda-main/Cargo.toml b/cda-main/Cargo.toml index 15de078d4..becc33804 100644 --- a/cda-main/Cargo.toml +++ b/cda-main/Cargo.toml @@ -37,8 +37,6 @@ cda-database = { workspace = true } cda-interfaces = { workspace = true } cda-sovd = { workspace = true } cda-tracing = { workspace = true } -cda-plugin-security = { workspace = true } -cda-health = { workspace = true } cda-extra = { workspace = true, optional = true } cda-plugin-runtime-update = { workspace = true } cda-storage = { workspace = true } diff --git a/cda-main/src/lib.rs b/cda-main/src/lib.rs index 1bd70ee8c..3461a4ce1 100644 --- a/cda-main/src/lib.rs +++ b/cda-main/src/lib.rs @@ -1,5 +1,6 @@ /* - * SPDX-FileCopyrightText: 2025 Copyright (c) Contributors to the Eclipse Foundation + * SPDX-License-Identifier: Apache-2.0 + * SPDX-FileCopyrightText: 2025 The Contributors to Eclipse OpenSOVD (see CONTRIBUTORS) * * See the NOTICE file(s) distributed with this work for additional * information regarding copyright ownership. @@ -7,63 +8,55 @@ * This program and the accompanying materials are made available under the * terms of the Apache License Version 2.0 which is available at * https://www.apache.org/licenses/LICENSE-2.0 - * - * SPDX-License-Identifier: Apache-2.0 */ use std::{future::Future, path::PathBuf, sync::Arc}; use cda_comm_doip::{DoipDiagGateway, config::DoipConfig}; use cda_comm_uds::{UdsManager, state_coordinator::EcuStateCoordinator}; -use cda_core::EcuManager; -use cda_database::FileManager; +use cda_core::{EcuManager, EcuManagerConfig}; +use cda_database::{FileManager, ProtoLoadConfig, update_mdd_uncompressed}; +use cda_health::{HealthState, StatusHealthProvider}; use cda_interfaces::{ - DiagServiceError, DoipGatewaySetupError, EcuConnectivityHandler, FunctionalDescriptionConfig, - HashMap, HashMapExtensions, UdsQuery, UdsVariant, + DiagServiceError, DoipGatewaySetupError, EcuAddresses, EcuConnectivityHandler, + EcuManager as EcuManagerTrait, EcuManagerType, FunctionalDescriptionConfig, HashMap, + HashMapEntry, HashMapExtensions, HashSet, Protocol, UdsQuery, UdsVariant, config::{ConfigSanity, ConfigSanityError}, - datatypes::{ComParams, FaultConfig}, + datatypes::{ComParams, DatabaseNamingConvention, FaultConfig, FlatbBufConfig}, dlt_ctx, + file_manager::{Chunk, ChunkType}, }; -use cda_plugin_security::{ - DefaultSecurityPlugin, DefaultSecurityPluginData, SecurityPlugin, SecurityPluginLoader, -}; +use cda_plugin_security::{DefaultSecurityPlugin, DefaultSecurityPluginData, SecurityPlugin}; use cda_sovd::Locks; use cda_tracing::{OtelGuard, TracingSetupError, TracingWorkerGuard}; use clap::{Parser, Subcommand}; -use figment::{ - Figment, - providers::{Format, Serialized, Toml}, -}; use futures::future::FutureExt; -use tokio::sync::{Mutex, RwLock, mpsc}; +use tokio::{ + signal, + sync::{Mutex, RwLock, mpsc}, +}; +use tracing::Instrument; use tracing_subscriber::layer::SubscriberExt; -use crate::{ - config::configfile::Configuration, - mdd::{load_databases, resolve_mdd_paths}, - update::{RuntimeUpdateContext, security::UpdateSecurityHandler}, -}; +use crate::config::configfile::Configuration; pub mod config; -pub mod mdd; -pub mod update; #[global_allocator] static GLOBAL: mimalloc::MiMalloc = mimalloc::MiMalloc; -const DOIP_HEALTH_COMPONENT_KEY: &str = "doip"; +// todo scope after poc: make this configurable +const DB_PARALLEL_LOAD_TASKS: usize = 2; -#[cfg(feature = "health")] -const MAIN_HEALTH_COMPONENT_KEY: &str = "main"; +const DB_HEALTH_COMPONENT_KEY: &str = "database"; +const DOIP_HEALTH_COMPONENT_KEY: &str = "doip"; pub type DatabaseMap = HashMap>>; pub type FileManagerMap = HashMap; #[derive(Subcommand, Debug)] pub enum Command { - /// Generate a reference TOML configuration file with all fields commented out GenerateConfig { - /// Output file path (defaults to opensovd-cda.toml). Use "-" for stdout. #[arg(short, long)] output: Option, }, @@ -90,9 +83,6 @@ pub struct AppArgs { #[arg(long)] pub gateway_port: Option, - /// Protocol name used for com-param lookups - /// in the diagnostic database (matched case-insensitively). - /// Examples: `UDS_Ethernet_DoIP`, `UDS_Ethernet_DoIP_DOBT` #[arg(long)] pub protocol_name: Option, @@ -120,31 +110,71 @@ pub struct AppArgs { #[arg(long)] pub fallback_to_base_variant: Option, - /// Set to true, to rewrite mdd files without compression, which - /// reduces memory usage due to mmap significantly. - // Could use Action::SetFalse here, as the default is false but then we would have - // two different ways to set booleans (with and without `true`) #[arg(long)] pub mdd_decompress: Option, } +impl AppArgs { + #[tracing::instrument(skip(self, config), fields(dlt_context = dlt_ctx!("MAIN")))] + pub fn update_config(self, config: &mut Configuration) { + if let Some(databases_path) = self.databases_path { + config.database.path = databases_path; + } + if let Some(exit_no_database_loaded) = self.exit_no_database_loaded { + config.database.exit_no_database_loaded = exit_no_database_loaded; + } + if let Some(fallback_to_base_variant) = self.fallback_to_base_variant { + config.database.fallback_to_base_variant = fallback_to_base_variant; + } + if let Some(flash_files_path) = self.flash_files_path { + config.flash_files_path = flash_files_path; + } + if let Some(tester_address) = self.tester_address { + config.doip.tester_address = tester_address; + } + if let Some(tester_subnet) = self.tester_subnet { + config.doip.tester_subnet = tester_subnet; + } + if let Some(gateway_port) = self.gateway_port { + config.doip.gateway_port = gateway_port; + } + if let Some(protocol_name) = self.protocol_name { + config.doip.protocol_name = protocol_name; + } + if let Some(listen_address) = self.listen_address { + config.server.address = listen_address; + } + if let Some(listen_port) = self.listen_port { + config.server.port = listen_port; + } + if let Some(file_logging) = self.file_logging { + config.logging.log_file_config.enabled = file_logging; + } + if let Some(log_file_dir) = self.log_file_dir { + config.logging.log_file_config.path = log_file_dir; + } + if let Some(log_file_name) = self.log_file_name { + config.logging.log_file_config.name = log_file_name; + } + if let Some(mdd_decompress) = self.mdd_decompress { + config.flat_buf.mdd_decompress = mdd_decompress; + } + } +} + +#[derive(Debug)] +struct EcuMetadata { + mdd_path: String, + valid: bool, +} + +type LoadedEcuMap = HashMap, EcuMetadata)>; + pub struct VehicleData { pub file_managers: FileManagerMap, pub uds_manager: UdsManagerType, - pub diagnostic_gateway: DoipDiagGateway>, pub locks: Arc, - pub update_guard: cda_sovd::UpdateGuardState, - pub databases: Arc>, - pub variant_detection_handle: tokio::task::JoinHandle<()>, - pub health_providers: Option, -} - -pub struct VehicleComponents { - pub uds_manager: UdsManagerType, - pub diagnostic_gateway: DoipDiagGateway>, pub databases: Arc>, - pub file_managers: FileManagerMap, - pub variant_detection_handle: tokio::task::JoinHandle<()>, } #[derive(thiserror::Error, Debug)] @@ -212,6 +242,7 @@ impl From for AppError { fn from(value: DoipGatewaySetupError) -> Self { match value { DoipGatewaySetupError::InvalidAddress(_) => Self::ConnectionError(value.to_string()), + DoipGatewaySetupError::UnknownECU { .. } => Self::ConfigurationError(value.to_string()), DoipGatewaySetupError::SocketCreationFailed(_) | DoipGatewaySetupError::PortBindFailed(_) => { Self::InitializationFailed(value.to_string()) @@ -221,13 +252,6 @@ impl From for AppError { } DoipGatewaySetupError::ResourceError(_) => Self::ResourceError(value.to_string()), DoipGatewaySetupError::ServerError(_) => Self::ServerError(value.to_string()), - DoipGatewaySetupError::UnknownECU { - logical_address, - protocol_version, - } => Self::ConfigurationError(format!( - "Unknown ECU with logical address {logical_address} and protocol version \ - {protocol_version}" - )), } } } @@ -249,62 +273,6 @@ impl From for AppError { } } -impl AppArgs { - #[tracing::instrument(skip(self, config), - fields( - dlt_context = dlt_ctx!("MAIN"), - ) - )] - pub fn update_config(self, config: &mut Configuration) { - if let Some(databases_path) = self.databases_path { - config.database.path = databases_path; - } - if let Some(exit_no_database_loaded) = self.exit_no_database_loaded { - config.database.exit_no_database_loaded = exit_no_database_loaded; - } - if let Some(fallback_to_base_variant) = self.fallback_to_base_variant { - config.database.fallback_to_base_variant = fallback_to_base_variant; - } - if let Some(flash_files_path) = self.flash_files_path { - config.flash_files_path = flash_files_path; - } - if let Some(tester_address) = self.tester_address { - config.doip.tester_address = tester_address; - } - if let Some(tester_subnet) = self.tester_subnet { - config.doip.tester_subnet = tester_subnet; - } - if let Some(gateway_port) = self.gateway_port { - config.doip.gateway_port = gateway_port; - } - if let Some(protocol_name) = self.protocol_name { - config.doip.protocol_name = protocol_name; - } - if let Some(listen_address) = self.listen_address { - config.server.address = listen_address; - } - if let Some(listen_port) = self.listen_port { - config.server.port = listen_port; - } - if let Some(file_logging) = self.file_logging { - config.logging.log_file_config.enabled = file_logging; - } - if let Some(log_file_dir) = self.log_file_dir { - config.logging.log_file_config.path = log_file_dir; - } - if let Some(log_file_name) = self.log_file_name { - config.logging.log_file_config.name = log_file_name; - } - if let Some(mdd_decompress) = self.mdd_decompress { - config.flat_buf.mdd_decompress = mdd_decompress; - } - } -} - -/// Generate a reference CDA configuration and write it to the requested output. -/// -/// # Errors -/// Returns [`AppError`] if generating the reference configuration or writing it fails. pub fn generate_config_cmd(output: Option<&PathBuf>) -> Result<(), AppError> { let content = config::generate::generate_reference_config() .map_err(|e| AppError::RuntimeError(format!("Failed to generate config: {e}")))?; @@ -328,422 +296,520 @@ pub fn generate_config_cmd(output: Option<&PathBuf>) -> Result<(), AppError> { Ok(()) } -/// Parse CLI arguments and start the CDA with the default startup flow. -/// -/// # Errors -/// Returns [`AppError`] if configuration loading, validation, or startup fails. -pub async fn run_from_cli() -> Result<(), AppError> { - // Box is needed because it's a large future with a size of 16392 bytes - Box::pin(run(AppArgs::parse())).await -} +pub const PROTO_LOAD_CONFIG: &[ProtoLoadConfig; 4] = &[ + ProtoLoadConfig { + type_: ChunkType::DiagnosticDescription, + load_data: true, + name: None, + }, + ProtoLoadConfig { + type_: ChunkType::CodeFile, + load_data: false, + name: None, + }, + ProtoLoadConfig { + type_: ChunkType::CodeFilePartial, + load_data: false, + name: None, + }, + ProtoLoadConfig { + type_: ChunkType::EmbeddedFile, + load_data: false, + name: None, + }, +]; -#[tracing::instrument( - skip(args, extra_health_providers, pre_load_hook), - fields( - dlt_context = dlt_ctx!("MAIN"), - ) -)] -/// Run the CDA from parsed CLI arguments, with optional extra health providers and a -/// pre-vehicle-load hook. See [`run_with_config_ext`] for parameter documentation. -/// +/// Loads vehicle databases and sets up SOVD routes in the webserver. /// # Errors -/// Returns [`AppError`] if configuration loading, validation, or startup fails. -pub async fn run_with_ext( - args: AppArgs, - extra_health_providers: Vec<(&'static str, Arc)>, - pre_load_hook: H, -) -> Result<(), AppError> -where - SP: SecurityPlugin, - SL: SecurityPluginLoader, - H: FnOnce(cda_sovd::dynamic_router::DynamicRouter) -> Fut + Send, - Fut: Future> + Send, -{ - if let Some(Command::GenerateConfig { output }) = args.command.as_ref() { - // Exiting after generating config is on purpose. - return generate_config_cmd(output.as_ref()); - } - - let (mut config, disk_loaded) = config::load_config_with_fallback(args.config.as_deref()); - - if disk_loaded && config.runtime_update_config.init_storage_from_config_file { - let config_file = config::resolve_config_file_path(args.config.as_deref()); - config::seed_storage_from_config_file( - &config.runtime_update_config.storage_dir, - &config_file, - ) - .await; - } +/// Returns `DoipGatewaySetupError` if we failed to create the diagnostic gateway +pub async fn load_vehicle_data< + F: Future + Clone + Send + 'static, + S: SecurityPlugin, +>( + config: &Configuration, + clonable_shutdown_signal: F, + health: Option<&cda_health::HealthState>, +) -> Result, AppError> { + // Load databases in the background + let (databases, file_managers) = load_databases::(config, health).await?; - if let Some(storage_config) = - config::load_config_with_storage_override(&config.runtime_update_config.storage_dir).await? + let (variant_detection_tx, variant_detection_rx) = mpsc::channel(50); + let databases = Arc::new(databases); + let state_coordinator = create_state_coordinator(&databases).await; + let doip_socket = Arc::new(Mutex::new( + cda_comm_doip::create_udp_vir_socket(&config.doip.tester_address, config.doip.gateway_port) + .map_err(AppError::from)?, + )); + let diagnostic_gateway = match create_diagnostic_gateway( + Arc::clone(&databases), + &config.doip, + variant_detection_tx, + Arc::new(state_coordinator.clone()) as Arc, + clonable_shutdown_signal.clone(), + Arc::clone(&doip_socket), + health, + ) + .await { - config = storage_config; - } else if !disk_loaded { - config::require_config_source()?; - } - - // Command line arguments always take precedence over stored configuration - args.update_config(&mut config); + Ok(gateway) => gateway, + Err(e) => { + tracing::error!(error = %e, "Failed to create diagnostic gateway"); + return Err(e.into()); + } + }; - config.validate_sanity().map_err(AppError::from)?; + let uds = create_uds_manager( + diagnostic_gateway, + Arc::clone(&databases), + variant_detection_rx, + state_coordinator, + &config.functional_description, + config.faults.clone(), + ); + tracing::debug!("Starting variant detection"); + let vdetect = uds.clone(); + cda_interfaces::spawn_named!("startup-variant-detection", async move { + vdetect.start_variant_detection().await; + }); - run_with_config_ext::(config, extra_health_providers, pre_load_hook).await + let ecu_names = uds.get_physical_ecus().await; + Ok(VehicleData { + uds_manager: uds, + file_managers, + locks: Arc::new(Locks::new(ecu_names)), + databases, + }) } -/// Run the CDA from parsed CLI arguments. +/// Loads all MDD databases and file managers from the configured database path. /// /// # Errors -/// Returns [`AppError`] if configuration loading, validation, or startup fails. -pub async fn run(args: AppArgs) -> Result<(), AppError> { - Box::pin(run_with_ext::< - DefaultSecurityPluginData, - DefaultSecurityPlugin, - _, - _, - >(args, vec![], |_| async { Ok(()) })) - .await -} - -/// Start the CDA runtime from a prepared configuration, with optional extra health providers -/// and a pre-vehicle-load hook. -/// -/// - `extra_health_providers`: additional `(key, provider)` pairs registered into the health -/// state alongside the built-in `main` provider. Ignored when the `health` feature is -/// disabled or `config.health.enabled` is `false`. -/// - `pre_load_hook`: called after the webserver, health state, and sd-notify are set up but -/// **before** vehicle data is loaded. Use it to register extra routes or endpoints that -/// should be available during (and benefit from parallelism with) the database load. -/// Must return `Ok(())` to continue startup; an `Err` aborts immediately. -/// - `SP` / `SL`: security plugin data and loader types. Use [`DefaultSecurityPluginData`] and -/// [`DefaultSecurityPlugin`] for the default behaviour. /// -/// # Errors -/// Returns [`AppError`] if tracing setup, webserver startup, hook execution, data loading, or -/// route setup fails. -pub async fn run_with_config_ext( - config: Configuration, - extra_health_providers: Vec<(&'static str, Arc)>, - pre_load_hook: H, -) -> Result<(), AppError> -where - SP: SecurityPlugin, - SL: SecurityPluginLoader, - H: FnOnce(cda_sovd::dynamic_router::DynamicRouter) -> Fut + Send, - Fut: Future> + Send, -{ - let _tracing_guards = setup_tracing(&config)?; - tracing::info!("Starting CDA - version {}", cda_version()); +/// Returns [`AppError::ShutdownRequested`] if a shutdown signal is received while +/// databases are still being loaded. +#[tracing::instrument( + skip(config, health), + fields(databases_path = %config.database.path) +)] +pub async fn load_databases( + config: &Configuration, + health: Option<&cda_health::HealthState>, +) -> Result<(DatabaseMap, FileManagerMap), AppError> { + // Extract fields from config + let database_path = &config.database.path; + let flat_buf_settings = config.flat_buf.clone(); + let database_naming_convention = config.database.naming_convention.clone(); + let func_description_cfg = config.functional_description.clone(); + let fallback_to_base_variant = config.database.fallback_to_base_variant; + let strict_parameter_validation = config.strict.parameter_validation(); + let database_config = config.database.clone(); + let protocol = cda_interfaces::Protocol::new(config.doip.protocol_name.clone()); + let com_params = config.com_params.clone(); + + let db_health_provider = setup_db_health_provider(health).await; + + let databases: Arc>> = Arc::new(RwLock::new(HashMap::new())); + + let file_managers: Arc>> = + Arc::new(RwLock::new(HashMap::new())); + + let com_params = Arc::new(com_params); + + let mut database_load_futures = Vec::new(); + let start = std::time::Instant::now(); + 'load_database: { + let files = match std::fs::read_dir(database_path) { + Ok(files) => files, + Err(e) => { + tracing::error!(error = %e, "Failed to read directory"); + if let Some(provider) = &db_health_provider { + provider.update_status(cda_health::Status::Failed).await; + } + break 'load_database; + } + }; + let mut files = files + .filter_map(|entry| { + entry.ok().and_then(|entry| { + let path = entry.path(); + if path.is_file() && path.extension().is_some_and(|ext| ext == "mdd") { + let filesize = std::fs::metadata(&path).ok().map_or(0u64, |m| m.len()); + Some((path, filesize)) + } else { + None + } + }) + }) + .collect::>(); + + files.sort_by_key(|b| std::cmp::Reverse(b.1)); + + let chunk_size = files + .len() + .checked_div(DB_PARALLEL_LOAD_TASKS.saturating_add(1)) + .unwrap_or(1) + .max(1); + + tracing::info!(chunk_size = %chunk_size, "Loading databases"); + + for (i, mddfiles) in files.chunks(chunk_size).enumerate() { + let database = Arc::clone(&databases); + let file_managers = Arc::clone(&file_managers); + let paths = mddfiles.to_vec(); + let com_params = Arc::clone(&com_params); + let database_naming_convention = database_naming_convention.clone(); + let flat_buf_settings = flat_buf_settings.clone(); + let func_description_cfg = func_description_cfg.clone(); + let protocol = protocol.clone(); + let database_config = database_config.clone(); + + database_load_futures.push(cda_interfaces::spawn_named!( + &format!("load-database-{i}"), + async move { + load_database( + protocol, + database, + file_managers, + paths, + com_params, + database_naming_convention, + flat_buf_settings, + func_description_cfg, + fallback_to_base_variant, + strict_parameter_validation, + database_config, + ) + .await; + } + .instrument(tracing::info_span!("load_database_chunk", chunk_id = i)) + )); + } + } - let webserver_config = cda_sovd::WebServerConfig { - host: config.server.address.clone(), - port: config.server.port, - }; + for f in database_load_futures { + tokio::select! { + () = shutdown_signal() => { + tracing::info!("Shutdown triggered. Aborting DB load..."); + return Err(AppError::ShutdownRequested); + }, + res = f =>{ + if let Err(e) = res { + tracing::error!(error = ?e, "Failed to load ecu data"); + } + } + } + } - let clonable_shutdown_signal = shutdown_signal().shared(); + let databases = databases + .write() + .await + .drain() + .filter(|(_, (_, meta))| meta.valid) + .map(|(k, (ecu_manager, _))| (k.to_lowercase(), RwLock::new(ecu_manager))) + .collect::>>>(); + mark_duplicate_ecus_by_address(&databases).await; + + let file_managers = file_managers + .write() + .await + .drain() + .map(|(k, v)| (k.to_lowercase().clone(), v)) + .collect::>(); - let (dynamic_router, webserver_task) = - cda_sovd::launch_webserver(webserver_config.clone(), clonable_shutdown_signal.clone()) - .await?; + let end = std::time::Instant::now(); - #[cfg(feature = "health")] - let (health_state, main_health_provider) = if config.health.enabled { - let health_state = - cda_health::add_health_routes(&dynamic_router, cda_version().to_owned()).await; - let main_health_provider = Arc::new(cda_health::StatusHealthProvider::new( + tracing::info!( + database_count = &databases.len(), + duration = ?end.saturating_duration_since(start), + "Loaded databases"); + let status = if databases.is_empty() { + cda_health::Status::Failed + } else { + cda_health::Status::Up + }; + + if let Some(provider) = db_health_provider { + provider.update_status(status).await; + } + Ok((databases, file_managers)) +} + +async fn setup_db_health_provider( + health: Option<&HealthState>, +) -> Option> { + if let Some(health_state) = health { + let provider = Arc::new(cda_health::StatusHealthProvider::new( cda_health::Status::Starting, )); - - health_state + if let Err(e) = health_state .register_provider( - MAIN_HEALTH_COMPONENT_KEY, - Arc::clone(&main_health_provider) as Arc, + DB_HEALTH_COMPONENT_KEY, + Arc::clone(&provider) as Arc, ) .await - .map_err(|e| AppError::InitializationFailed(e.to_string()))?; - for (key, provider) in extra_health_providers { - health_state - .register_provider(key, provider) - .await - .map_err(|e| AppError::InitializationFailed(e.to_string()))?; + { + tracing::warn!(error = %e, "Failed to register database health provider"); } - (Some(health_state), Some(main_health_provider)) + Some(provider) } else { - (None, None) - }; - - #[cfg(not(feature = "health"))] - let (health_state, main_health_provider): ( - Option, - Option>, - ) = { - // Prevents compiler warning for unused variable when health feature is disabled - let _ = extra_health_providers; - (None, None) - }; - - #[cfg(feature = "systemd-notify")] - let _sd_notify_task = - cda_extra::create_sd_notify_task(health_state.clone(), clonable_shutdown_signal.clone()); - - register_version_endpoints(&dynamic_router).await; - pre_load_hook(dynamic_router.clone()).await?; - - setup_vehicle_and_routes::( - config, - &dynamic_router, - &webserver_config, - health_state.as_ref(), - clonable_shutdown_signal.clone(), - ) - .await?; - - tracing::info!("CDA fully initialized and ready to serve requests"); - if let Some(provider) = main_health_provider { - provider.update_status(cda_health::Status::Up).await; + None } - - // Wait for shutdown signal - clonable_shutdown_signal.await; - tracing::info!("Shutting down..."); - webserver_task - .await - .map_err(|e| AppError::RuntimeError(format!("Webserver task join error: {e}")))?; - - Ok(()) } -/// Start the CDA runtime from a prepared configuration. -/// -/// # Errors -/// Returns [`AppError`] if tracing setup, webserver startup, data loading, or route setup fails. -pub async fn run_with_config(config: Configuration) -> Result<(), AppError> { - run_with_config_ext::( - config, - vec![], - |_| async { Ok(()) }, - ) - .await -} +async fn mark_duplicate_ecus_by_address( + databases: &HashMap>>, +) { + let mut ecus_by_address: HashMap>> = HashMap::new(); + for (name, db_lock) in databases { + let db = db_lock.read().await; + let logical_address = db.logical_address(); + let gateway_address = db.logical_gateway_address(); + ecus_by_address + .entry(gateway_address) + .or_default() + .entry(logical_address) + .or_default() + .push(name.clone()); + } -/// Loads vehicle data, registers all SOVD routes, runtime-update routes, `OpenAPI` routes, -/// and installs the update guard. Extracted from `run_with_config` to keep it under the line limit. -/// -/// The type parameters `SP` and `SL` select the security plugin data and loader implementations. -/// Use [`DefaultSecurityPluginData`] and [`DefaultSecurityPlugin`] for the default behaviour. -/// -/// # Errors -/// Returns [`AppError`] if vehicle data loading, route registration, or update plugin setup fails. -pub async fn setup_vehicle_and_routes( - config: Configuration, - dynamic_router: &cda_sovd::dynamic_router::DynamicRouter, - webserver_config: &cda_sovd::WebServerConfig, - health_state: Option<&cda_health::HealthState>, - clonable_shutdown_signal: futures::future::Shared< - impl std::future::Future + Send + 'static, - >, -) -> Result<(), AppError> { - tracing::debug!("Webserver is running. Loading sovd routes..."); - - let vehicle_data = - match load_vehicle_data::<_, SP>(&config, clonable_shutdown_signal.clone(), health_state) - .await - { - Ok(data) => data, - Err(AppError::ShutdownRequested) => { - tracing::info!("Shutdown requested during database load, exiting cleanly"); - return Ok(()); + for logical_map in ecus_by_address.values() { + for ecu_names in logical_map.values() { + if ecu_names.len() <= 1 { + continue; } - Err(e) => return Err(e), - }; - if vehicle_data.databases.is_empty() && config.database.exit_no_database_loaded { - return Err(AppError::ResourceError( - "No database loaded, exiting as configured".to_string(), - )); + for ecu_name in ecu_names { + let Some(db_lock) = databases.get(ecu_name) else { + continue; + }; + + let mut db = db_lock.write().await; + let duplicates: HashSet = ecu_names + .iter() + .filter(|&name| name != ecu_name) + .cloned() + .collect(); + db.set_duplicating_ecu_names(duplicates); + } + } } +} - let flash_files_path = config.flash_files_path.clone(); - let components_config = config.components.clone(); - let runtime_update_config = config.runtime_update_config.clone(); - - let (ecu_execution_registry, vehicle_route_handle) = cda_sovd::add_vehicle_routes::<_, _, SL>( - dynamic_router, - cda_sovd::VehicleConfig { - flash_files_path: config.flash_files_path.clone(), - functional_group_config: config.functional_description.clone(), - components_config: config.components.clone(), - }, - cda_sovd::VehicleResources { - ecu_uds: vehicle_data.uds_manager.clone(), - file_manager: vehicle_data.file_managers, - locks: Arc::clone(&vehicle_data.locks), - update_in_progress: vehicle_data.update_guard.busy_handle(), - }, - ) - .await?; - - let lock_provider: Arc = Arc::new( - cda_sovd::SovdLockStateProvider::new(Arc::clone(&vehicle_data.locks)), - ); - - let flash_transfer_guard = vehicle_data.uds_manager.flash_transfer_guard(); - let runtime_update_plugin = - update::init_default_runtime_update_plugin::(Box::new(RuntimeUpdateContext { - dynamic_router: dynamic_router.clone(), - vehicle_route_handle, - config, - flash_files_path, - components_config, - lock_provider: Arc::clone(&lock_provider), - update_guard: vehicle_data.update_guard.clone(), - shutdown_signal: clonable_shutdown_signal, - runtime_update_config: runtime_update_config.clone(), - ecu_execution_registry: ecu_execution_registry.clone(), - uds_manager: vehicle_data.uds_manager, - doip_gateway: vehicle_data.diagnostic_gateway, - health: vehicle_data.health_providers, - variant_detection_handle: Some(vehicle_data.variant_detection_handle), - security_handler: Arc::new(UpdateSecurityHandler::new( - Arc::clone(&lock_provider), - vec![ - Box::new(flash_transfer_guard), - Box::new(ecu_execution_registry), - ], - )), - })) - .await?; - update::add_runtime_update_routes::( - dynamic_router, - runtime_update_plugin, - lock_provider, - &vehicle_data.update_guard, - runtime_update_config.upload_body_limit_bytes, - runtime_update_config.retry_after_seconds, +#[allow(clippy::too_many_arguments)] +#[tracing::instrument( + skip_all, + fields( + paths_count = paths.len(), + dlt_context = dlt_ctx!("MAIN"), ) - .await; - - cda_sovd::add_openapi_routes(dynamic_router, &vehicle_data.update_guard, webserver_config) - .await; +)] +async fn load_database( + protocol: Protocol, + database: Arc>>, + file_managers: Arc>>, + paths: Vec<(PathBuf, u64)>, + com_params: Arc, + database_naming_convention: DatabaseNamingConvention, + flat_buf_settings: FlatbBufConfig, + func_description_cfg: FunctionalDescriptionConfig, + fallback_to_base_variant: bool, + strict_parameter_validation: bool, + database_config: cda_database::DatabaseConfig, +) { + for (mddfile, _) in paths { + let Some(mdd_path) = mddfile.to_str().map(ToOwned::to_owned) else { + tracing::error!( + mdd_file = %mddfile.display(), + "Failed to convert MDD file path to string"); + continue; + }; - cda_sovd::install_update_guard(dynamic_router, vehicle_data.update_guard.clone()).await; + // Ensure the MDD file contains uncompressed data (rewrite on first + // use), so that subsequent loads skip LZMA decompression. + if flat_buf_settings.mdd_decompress + && let Err(e) = update_mdd_uncompressed(&mdd_path) + { + tracing::error!( + mdd_file = %mddfile.display(), + error = %e, + "Failed to update MDD file with uncompressed data"); + } - Ok(()) + match cda_database::load_proto_data(&mdd_path, PROTO_LOAD_CONFIG) { + Ok((ecu_name, mut proto_data)) => { + let database_payload = proto_data + .remove(&ChunkType::DiagnosticDescription) + .and_then(|mut chunks| chunks.pop()) + .and_then(|c| c.payload); + + // Build DiagnosticDatabase from the diagnostic database payload. + let diag_data_base = { + let Some(payload) = database_payload else { + tracing::error!( + mdd_file = %mddfile.display(), + ecu_name = %ecu_name, + "No payload found in diagnostic description for ECU"); + continue; + }; + + match cda_database::datatypes::DiagnosticDatabase::new_from_bytes( + mdd_path.clone(), + payload, + flat_buf_settings.clone(), + database_config.clone(), + ) { + Ok(db) => db, + Err(e) => { + tracing::error!( + mdd_file = %mddfile.display(), + ecu_name = %ecu_name, + error = %e, + "Failed to create database from MDD payload"); + continue; + } + } + }; + + let ecu_type = if func_description_cfg.description_database == ecu_name { + EcuManagerType::FunctionalDescription + } else { + EcuManagerType::Ecu + }; + let diag_service_manager = match EcuManager::new( + diag_data_base, + protocol.clone(), + &com_params, + database_naming_convention.clone(), + EcuManagerConfig { + type_: ecu_type, + fallback_to_base_variant, + strict_parameter_validation, + }, + &func_description_cfg, + ) { + Ok(manager) => manager, + Err(e) => { + tracing::error!( + ecu_name = %ecu_name, + error = ?e, + "Failed to create DiagServiceManager"); + continue; + } + }; + + let ecu_metadata = EcuMetadata { + mdd_path: mdd_path.clone(), + valid: true, + }; + + check_duplicate_ecu_names( + &database, + &mdd_path, + &ecu_name, + diag_service_manager, + ecu_metadata, + ) + .await; + + let filtered_chunks: Vec = [ + ChunkType::CodeFile, + ChunkType::CodeFilePartial, + ChunkType::EmbeddedFile, + ] + .iter() + .filter_map(|chunk_type| proto_data.remove(chunk_type)) + .flat_map(std::iter::IntoIterator::into_iter) + .collect(); + + let files: Vec = filtered_chunks + .into_iter() + .chain(proto_data.into_values().flat_map(IntoIterator::into_iter)) + .collect(); + + file_managers + .write() + .await + .insert(ecu_name, FileManager::new(mdd_path, files)); + } + Err(e) => { + tracing::error!( + mdd_file = %mddfile.display(), + error = %e, + "Failed to load ecu data from file"); + } + } + } } -async fn register_version_endpoints(dynamic_router: &cda_sovd::dynamic_router::DynamicRouter) { - // [[ dimpl~sovd-api-version-endpoint, Register Version Endpoint ]] - let serde_json::Value::Object(version_info) = serde_json::json!({ - "id": "version", - "data": { - "name": "Eclipse OpenSOVD Classic Diagnostic Adapter", - "api": { - "version": "1.1" - }, - "implementation": { - "version": cda_version(), - "commit": env!("GIT_COMMIT_HASH").to_owned(), - "build_date": env!("BUILD_DATE").to_owned(), +async fn check_duplicate_ecu_names( + database: &RwLock>, + mdd_path: &String, + ecu_name: &String, + diag_service_manager: EcuManager, + ecu_metadata: EcuMetadata, +) { + let mut db_write = database.write().await; + match db_write.entry(ecu_name.clone()) { + HashMapEntry::Occupied(mut entry) => { + let (existing_ecu, existing_meta) = entry.get_mut(); + + if diag_service_manager.logical_address_eq(existing_ecu) { + if diag_service_manager.revision() > existing_ecu.revision() { + tracing::warn!( + ecu_name = %ecu_name, + existing_mdd = %existing_meta.mdd_path, + existing_revision = %existing_ecu.revision(), + new_mdd = %mdd_path, + new_revision = %diag_service_manager.revision(), + "Replacing ECU with newer revision" + ); + entry.insert((diag_service_manager, ecu_metadata)); + } else { + tracing::warn!( + ecu_name = %ecu_name, + existing_mdd = %existing_meta.mdd_path, + existing_revision = %existing_ecu.revision(), + new_mdd = %mdd_path, + new_revision = %diag_service_manager.revision(), + "Keeping existing ECU with newer or equal revision" + ); + } + } else { + tracing::error!( + ecu_name = %ecu_name, + "Duplicate ECU with different addresses. Marking as invalid." + ); + existing_meta.valid = false; } } - }) else { - tracing::error!("Failed to build version information"); - return; - }; - cda_sovd::add_static_data_endpoint( - dynamic_router, - version_info.clone(), - "/vehicle/v15/apps/sovd2uds/data/version", - ) - .await; - cda_sovd::add_static_data_endpoint(dynamic_router, version_info, "/vehicle/v15/data/version") - .await; + HashMapEntry::Vacant(entry) => { + // Mark as invalid and remove later. + // Not removing now, because there might be multiple duplicates and + // if we would remove now, next duplicate would be added as new. + entry.insert((diag_service_manager, ecu_metadata)); + } + } } -/// Loads vehicle data including MDD databases and vehicle components. -/// -/// # Errors -/// Returns [`AppError`] if MDD path resolution, database loading, or component creation fails. -pub async fn load_vehicle_data< - F: Future + Clone + Send + 'static, - S: SecurityPlugin, ->( - config: &Configuration, - clonable_shutdown_signal: F, - health: Option<&cda_health::HealthState>, -) -> Result, AppError> { - let mdd_paths: Vec = { - let storage_dir = &config.runtime_update_config.storage_dir; - let paths = resolve_mdd_paths(storage_dir, &config.database.path).await; - if paths.is_empty() { - return Err(AppError::InitializationFailed( - "No MDD files found".to_string(), - )); - } - paths - }; +type UdsManagerType = + UdsManager>, EcuManager>; - let health_providers = if let Some(health_state) = health { - let doip = Arc::new(cda_health::StatusHealthProvider::new( - cda_health::Status::Starting, - )); - let database = Arc::new(cda_health::StatusHealthProvider::new( - cda_health::Status::Starting, - )); - health_state - .register_provider( - DOIP_HEALTH_COMPONENT_KEY, - Arc::clone(&doip) as Arc, - ) - .await - .map_err(|e| AppError::InitializationFailed(e.to_string()))?; - health_state - .register_provider( - mdd::DB_HEALTH_COMPONENT_KEY, - Arc::clone(&database) as Arc, - ) - .await - .map_err(|e| AppError::InitializationFailed(e.to_string()))?; - Some(HealthProviders { doip, database }) - } else { - None - }; +async fn create_state_coordinator( + databases: &HashMap>>, +) -> EcuStateCoordinator { + let mut runtime_states = HashMap::new(); - let update_guard = cda_sovd::UpdateGuardState::new(); - let doip_socket = - cda_comm_doip::create_udp_vir_socket(&config.doip.tester_address, config.doip.gateway_port) - .map_err(|e| { - AppError::InitializationFailed(format!("Failed to create DoIP socket: {e}")) - })?; - let components = create_vehicle_components::( - config, - &mdd_paths, - clonable_shutdown_signal, - health_providers.as_ref(), - update_guard.busy_handle(), - Arc::new(Mutex::new(doip_socket)), - ) - .await?; + for (ecu_name, db_lock) in databases { + let db = db_lock.read().await; + runtime_states.insert(ecu_name.clone(), db.runtime_state()); + } - let ecu_names = components.uds_manager.get_physical_ecus().await; - Ok(VehicleData { - uds_manager: components.uds_manager, - diagnostic_gateway: components.diagnostic_gateway, - file_managers: components.file_managers, - locks: Arc::new(Locks::new(ecu_names)), - update_guard, - databases: components.databases, - variant_detection_handle: components.variant_detection_handle, - health_providers, - }) + EcuStateCoordinator::new(runtime_states) } -pub type UdsManagerType = UdsManager>, EcuManager>; - -#[allow( - clippy::implicit_hasher, - reason = "Type alias does not allow specifying hasher. Hasher is set globally" -)] +/// Creates a new UDS manager for the webserver. +// type alias does not allow specifying hasher, we set the hasher globally. +#[allow(clippy::implicit_hasher)] #[tracing::instrument(skip_all, fields( database_count = databases.len(), @@ -757,8 +823,8 @@ pub fn create_uds_manager( state_coordinator: EcuStateCoordinator, functional_description_config: &FunctionalDescriptionConfig, fault_config: FaultConfig, - update_in_progress: Arc, ) -> UdsManagerType { + let update_in_progress = Arc::new(std::sync::atomic::AtomicBool::new(false)); UdsManager::new( gateway, databases, @@ -770,102 +836,42 @@ pub fn create_uds_manager( ) } -pub struct HealthProviders { - pub doip: Arc, - pub database: Arc, -} - -/// Creates vehicle components (databases, `DoIP` gateway, UDS manager) from configuration. -/// +/// Creates a new diagnostic gateway for the webserver. /// # Errors -/// Returns [`AppError`] if database loading or diagnostic gateway creation fails. -pub async fn create_vehicle_components< - F: Future + Clone + Send + 'static, - S: SecurityPlugin, ->( - config: &Configuration, - mdd_paths: &[PathBuf], - shutdown_signal: F, - health_providers: Option<&HealthProviders>, - update_in_progress: Arc, - doip_socket: Arc>, -) -> Result, AppError> { - let db_provider = health_providers.map(|h| &h.database); - let doip_provider = health_providers.map(|h| &h.doip); - - let (databases, file_managers) = load_databases::(config, mdd_paths, db_provider).await?; - - let (variant_detection_tx, variant_detection_rx) = mpsc::channel(50); - let databases = Arc::new(databases); - - // Build runtime states for EcuStateCoordinator from all loaded ECU databases. - let runtime_states = { - let mut states = HashMap::new(); - for (ecu_name, ecu_lock) in databases.as_ref() { - let state = ecu_lock.read().await.runtime_state(); - states.insert(ecu_name.clone(), state); - } - states - }; - let state_coordinator = EcuStateCoordinator::new(runtime_states); - let connectivity_handler: Arc = Arc::new(state_coordinator.clone()); - - let diagnostic_gateway = create_diagnostic_gateway( - Arc::clone(&databases), - &config.doip, - variant_detection_tx, - connectivity_handler, - shutdown_signal, - doip_provider, - doip_socket, - ) - .await?; - - let uds_manager = create_uds_manager( - diagnostic_gateway.clone(), - Arc::clone(&databases), - variant_detection_rx, - state_coordinator, - &config.functional_description, - config.faults.clone(), - update_in_progress, - ); - - let vd = uds_manager.clone(); - let variant_detection_handle = cda_interfaces::spawn_named!("variant-detection", async move { - vd.start_variant_detection().await; - }); - - Ok(VehicleComponents { - uds_manager, - diagnostic_gateway, - databases, - file_managers, - variant_detection_handle, - }) -} - +/// Returns a string error if the gateway cannot be initialized. #[tracing::instrument( - skip(databases, variant_detection, connectivity_handler, shutdown_signal, doip_health_provider, doip_socket), + skip(databases, variant_detection, connectivity_handler, shutdown_signal, doip_socket, health), fields( database_count = databases.len(), dlt_context = dlt_ctx!("MAIN"), ) )] -/// # Errors -/// Returns [`DoipGatewaySetupError`] if `DoIP` gateway initialization fails. pub async fn create_diagnostic_gateway( databases: Arc>, doip_config: &DoipConfig, variant_detection: mpsc::Sender>, connectivity_handler: Arc, - shutdown_signal: impl Future + Send + 'static, - doip_health_provider: Option<&Arc>, + shutdown_signal: impl Future + Send + Clone + 'static, doip_socket: Arc>, + health: Option<&cda_health::HealthState>, ) -> Result>, DoipGatewaySetupError> { - if let Some(provider) = doip_health_provider { - provider.update_status(cda_health::Status::Starting).await; - } + let doip_health_provider = if let Some(health_state) = health { + let provider = Arc::new(cda_health::StatusHealthProvider::new( + cda_health::Status::Starting, + )); + if let Err(e) = health_state + .register_provider( + DOIP_HEALTH_COMPONENT_KEY, + Arc::clone(&provider) as Arc, + ) + .await + { + tracing::warn!(error = %e, "Failed to register DoIP health provider"); + } + Some(provider) + } else { + None + }; let result = DoipDiagGateway::new( doip_config, @@ -887,18 +893,19 @@ pub async fn create_diagnostic_gateway( result } +/// Waits for a shutdown signal, such as Ctrl+C or SIGTERM (on unix). /// # Panics -/// Panics if the OS signal handlers cannot be installed. +/// * If subscribing to the signals fails. pub async fn shutdown_signal() { let ctrl_c = async { - tokio::signal::ctrl_c() + signal::ctrl_c() .await .expect("failed to install Ctrl+C handler"); }; #[cfg(unix)] let terminate = async { - tokio::signal::unix::signal(tokio::signal::unix::SignalKind::terminate()) + signal::unix::signal(signal::unix::SignalKind::terminate()) .expect("failed to install signal handler") .recv() .await; @@ -918,8 +925,9 @@ pub struct TracingGuards { _otel: Option, } +/// Setup the tracing to provide logs and analytics. /// # Errors -/// Returns [`TracingSetupError`] if subscriber or exporter initialization fails. +/// Returns a `TracingSetupError` if the tracing setup fails. pub fn setup_tracing(config: &Configuration) -> Result { let tracing = cda_tracing::new(); let mut layers = vec![]; @@ -963,77 +971,119 @@ pub fn setup_tracing(config: &Configuration) -> Result &'static str { env!("CARGO_PKG_VERSION") } -/// Compute the effective [`ComParams`] for a single ECU. -/// -/// Starts from the global `global` config and merges any per-ECU TOML overrides -/// present in `ecu_table`. -/// -/// Returns `None` (and emits a `tracing::error!`) if the TOML table cannot be -/// serialised or if figment extraction fails - the caller should `continue` to -/// the next ECU. -pub fn resolve_com_params( - ecu_name: &str, - global: &ComParams, - ecu_overrides: Option<&config::configfile::EcuComParams>, -) -> Option { - let params: ComParams = match ecu_overrides { - None => global.clone(), - Some(overrides) => { - let toml_str = match toml::to_string(overrides) { - Ok(s) => s, - Err(e) => { - tracing::error!( - ecu_name = %ecu_name, - error = %e, - "Failed to serialize per-ECU com_params TOML table; skipping ECU" - ); - return None; - } - }; - match Figment::from(Serialized::defaults(global)) - .merge(Toml::string(&toml_str)) - .extract::() - { - Ok(p) => p, - Err(e) => { - tracing::error!( - ecu_name = %ecu_name, - error = %e, - "Failed to merge per-ECU com_params overrides; skipping ECU" - ); - return None; - } +pub async fn run_with_config(config: Configuration) -> Result<(), AppError> { + let _tracing_guards = setup_tracing(&config)?; + tracing::info!("Starting CDA - version {}", cda_version()); + + let webserver_config = cda_sovd::WebServerConfig { + host: config.server.address.clone(), + port: config.server.port, + }; + + let clonable_shutdown_signal = shutdown_signal().shared(); + let (dynamic_router, webserver_task) = + cda_sovd::launch_webserver(webserver_config.clone(), clonable_shutdown_signal.clone()) + .await + .map_err(AppError::from)?; + + #[cfg(feature = "health")] + let health_state = if config.health.enabled { + Some(cda_health::add_health_routes(&dynamic_router, cda_version().to_owned()).await) + } else { + None + }; + + #[cfg(not(feature = "health"))] + let health_state: Option = None; + + let vehicle_data = load_vehicle_data::<_, DefaultSecurityPluginData>( + &config, + clonable_shutdown_signal.clone(), + health_state.as_ref(), + ) + .await?; + + if vehicle_data.databases.is_empty() && config.database.exit_no_database_loaded { + return Err(AppError::ResourceError( + "No database loaded, exiting as configured".to_owned(), + )); + } + + register_version_endpoints(&dynamic_router).await; + + let _ = cda_sovd::add_vehicle_routes::<_, _, DefaultSecurityPlugin>( + &dynamic_router, + cda_sovd::VehicleConfig { + flash_files_path: config.flash_files_path.clone(), + functional_group_config: config.functional_description.clone(), + components_config: config.components.clone(), + }, + cda_sovd::VehicleResources { + ecu_uds: vehicle_data.uds_manager, + file_manager: vehicle_data.file_managers, + locks: Arc::clone(&vehicle_data.locks), + update_in_progress: Arc::new(std::sync::atomic::AtomicBool::new(false)), + }, + ) + .await + .map_err(AppError::from)?; + + tracing::info!("CDA initialized and ready to serve requests"); + clonable_shutdown_signal.await; + tracing::info!("Shutting down..."); + webserver_task + .await + .map_err(|e| AppError::RuntimeError(format!("Webserver task join error: {e}")))?; + Ok(()) +} + +async fn register_version_endpoints(dynamic_router: &cda_sovd::dynamic_router::DynamicRouter) { + let serde_json::Value::Object(version_info) = serde_json::json!({ + "id": "version", + "data": { + "name": "Eclipse OpenSOVD Classic Diagnostic Adapter", + "api": { "version": "1.1" }, + "implementation": { + "version": cda_version(), + "commit": env!("GIT_COMMIT_HASH").to_owned(), + "build_date": env!("BUILD_DATE").to_owned(), } } + }) else { + tracing::error!("Failed to build version information"); + return; }; - Some(params) + cda_sovd::add_static_data_endpoint( + dynamic_router, + version_info.clone(), + "/vehicle/v15/apps/sovd2uds/data/version", + ) + .await; + cda_sovd::add_static_data_endpoint(dynamic_router, version_info, "/vehicle/v15/data/version") + .await; } -#[cfg(test)] -mod tests { - use super::*; - - #[test] - fn resolve_com_params_returns_none_on_figment_extraction_failure() { - let global = ComParams::default(); - // Put a string where figment expects a table (the `uds` key should map - // to a struct, not a scalar); this reliably triggers an extraction error. - let mut table = toml::Table::new(); - table.insert( - "uds".to_owned(), - toml::Value::String("not_a_struct".to_owned()), - ); - let ecu_params = crate::config::configfile::EcuComParams(table); - let result = resolve_com_params("BAD_ECU", &global, Some(&ecu_params)); - assert!( - result.is_none(), - "resolve_com_params must return None when figment extraction fails" - ); +pub async fn run(args: AppArgs) -> Result<(), AppError> { + if let Some(Command::GenerateConfig { output }) = args.command.as_ref() { + return generate_config_cmd(output.as_ref()); } + + let (mut config, disk_loaded) = config::load_config_with_fallback(args.config.as_deref()); + if !disk_loaded { + config::require_config_source()?; + } + args.update_config(&mut config); + config.validate_sanity().map_err(AppError::from)?; + run_with_config(config).await +} + +pub async fn run_from_cli() -> Result<(), AppError> { + Box::pin(run(AppArgs::parse())).await } diff --git a/cda-plugin-runtime-update/BUILD.bazel b/cda-plugin-runtime-update/BUILD.bazel new file mode 100644 index 000000000..56ff1a4a2 --- /dev/null +++ b/cda-plugin-runtime-update/BUILD.bazel @@ -0,0 +1,24 @@ +# SPDX-License-Identifier: Apache-2.0 +# SPDX-FileCopyrightText: 2026 The Contributors to Eclipse OpenSOVD (see CONTRIBUTORS) +# +# See the NOTICE file(s) distributed with this work for additional +# information regarding copyright ownership. +# +# This program and the accompanying materials are made available under the +# terms of the Apache License Version 2.0 which is available at +# https://www.apache.org/licenses/LICENSE-2.0 + +load("//:bazel/rust_crate.bzl", "workspace_rust_library") + +package(default_visibility = ["//visibility:public"]) + +workspace_rust_library( + name = "cda-plugin-runtime-update", + srcs = glob(["src/**/*.rs"]), + crate_name = "cda_plugin_runtime_update", + local_deps = [ + "//cda-database", + "//cda-interfaces", + "//cda-sovd-interfaces:sovd-interfaces", + ], +) \ No newline at end of file diff --git a/cda-plugin-security/BUILD.bazel b/cda-plugin-security/BUILD.bazel index 720b07fe7..d32ca9ae8 100644 --- a/cda-plugin-security/BUILD.bazel +++ b/cda-plugin-security/BUILD.bazel @@ -10,31 +10,17 @@ # cda-plugin-security: Security plugin APIs for authentication and ECU security access. -load("@rules_rust//rust:defs.bzl", "rust_library") +load("//:bazel/rust_crate.bzl", "workspace_rust_library") package(default_visibility = ["//visibility:public"]) -rust_library( +workspace_rust_library( name = "cda-plugin-security", srcs = glob(["src/**/*.rs"]), crate_name = "cda_plugin_security", - edition = "2024", - deps = [ + local_deps = [ "//cda-database", "//cda-interfaces", "//cda-sovd-interfaces:sovd-interfaces", - "@crate_index//:aide", - "@crate_index//:axum", - "@crate_index//:axum-extra", - "@crate_index//:http", - "@crate_index//:jsonwebtoken", - "@crate_index//:schemars", - "@crate_index//:serde", - "@crate_index//:serde_json", - "@crate_index//:thiserror", - "@crate_index//:tracing", - ], - proc_macro_deps = [ - "@crate_index//:async-trait", ], ) diff --git a/cda-sovd-interfaces/BUILD.bazel b/cda-sovd-interfaces/BUILD.bazel index 3f91a7264..79c54bb46 100644 --- a/cda-sovd-interfaces/BUILD.bazel +++ b/cda-sovd-interfaces/BUILD.bazel @@ -10,21 +10,13 @@ # sovd-interfaces: Data models and trait definitions for SOVD API resources. -load("@rules_rust//rust:defs.bzl", "rust_library") +load("//:bazel/rust_crate.bzl", "workspace_rust_library") package(default_visibility = ["//visibility:public"]) -rust_library( +workspace_rust_library( name = "sovd-interfaces", srcs = glob(["src/**/*.rs"]), crate_name = "sovd_interfaces", - edition = "2024", - deps = [ - "//cda-interfaces", - "@crate_index//:chrono", - "@crate_index//:schemars", - "@crate_index//:serde", - "@crate_index//:serde_json", - "@crate_index//:strum", - ], + local_deps = ["//cda-interfaces"], ) diff --git a/cda-sovd/BUILD.bazel b/cda-sovd/BUILD.bazel index 91cdacf67..66e4ae87c 100644 --- a/cda-sovd/BUILD.bazel +++ b/cda-sovd/BUILD.bazel @@ -10,50 +10,28 @@ # cda-sovd: SOVD-compliant HTTP/REST server exposing the diagnostic API. -load("@rules_rust//cargo:defs.bzl", "cargo_build_script") -load("@rules_rust//rust:defs.bzl", "rust_library") +load("//:bazel/rust_crate.bzl", "workspace_cargo_build_script", "workspace_rust_library") package(default_visibility = ["//visibility:public"]) -cargo_build_script( +workspace_cargo_build_script( name = "build_script", srcs = ["build.rs"], - edition = "2024", - deps = [ + local_deps = [ "//cda-build", ], ) -rust_library( +workspace_rust_library( name = "cda-sovd", srcs = glob(["src/**/*.rs"]), crate_name = "cda_sovd", - edition = "2024", - deps = [ + local_deps = [ ":build_script", "//cda-interfaces", "//cda-plugin-security", "//cda-sovd-interfaces:sovd-interfaces", "//cda-tracing", "//opensovd-axum-extra", - "@crate_index//:aide", - "@crate_index//:axum", - "@crate_index//:axum-extra", - "@crate_index//:chrono", - "@crate_index//:http", - "@crate_index//:indexmap", - "@crate_index//:mime", - "@crate_index//:percent-encoding", - "@crate_index//:regex", - "@crate_index//:schemars", - "@crate_index//:serde", - "@crate_index//:serde_json", - "@crate_index//:serde_qs", - "@crate_index//:thiserror", - "@crate_index//:tokio", - "@crate_index//:tower", - "@crate_index//:tower-http", - "@crate_index//:tracing", - "@crate_index//:uuid", ], ) diff --git a/cda-storage/BUILD.bazel b/cda-storage/BUILD.bazel index 508934352..dd99bc3c9 100644 --- a/cda-storage/BUILD.bazel +++ b/cda-storage/BUILD.bazel @@ -10,26 +10,13 @@ # cda-storage: Storage access implementation for CDA. -load("@rules_rust//rust:defs.bzl", "rust_library") +load("//:bazel/rust_crate.bzl", "workspace_rust_library") package(default_visibility = ["//visibility:public"]) -rust_library( +workspace_rust_library( name = "cda-storage", srcs = glob(["src/**/*.rs"]), crate_name = "cda_storage", - edition = "2024", - deps = [ - "//cda-interfaces", - "@crate_index//:crc32fast", - "@crate_index//:rkyv", - "@crate_index//:serde", - "@crate_index//:thiserror", - "@crate_index//:tokio", - "@crate_index//:tracing", - "@crate_index//:uuid", - ], - proc_macro_deps = [ - "@crate_index//:async-trait", - ], + local_deps = ["//cda-interfaces"], ) diff --git a/cda-tracing/BUILD.bazel b/cda-tracing/BUILD.bazel index 717b55a38..d986f9751 100644 --- a/cda-tracing/BUILD.bazel +++ b/cda-tracing/BUILD.bazel @@ -10,41 +10,21 @@ # cda-tracing: Logging, tracing, and OpenTelemetry setup. -load("@rules_rust//cargo:defs.bzl", "cargo_build_script") -load("@rules_rust//rust:defs.bzl", "rust_library") +load("//:bazel/rust_crate.bzl", "workspace_cargo_build_script", "workspace_rust_library") package(default_visibility = ["//visibility:public"]) -cargo_build_script( +workspace_cargo_build_script( name = "build_script", srcs = ["build.rs"], - edition = "2024", - deps = [ + local_deps = [ "//cda-build", ], ) -rust_library( +workspace_rust_library( name = "cda-tracing", srcs = glob(["src/**/*.rs"]), crate_name = "cda_tracing", - edition = "2024", - deps = [ - ":build_script", - "@crate_index//:nu-ansi-term", - "@crate_index//:opentelemetry", - "@crate_index//:opentelemetry-otlp", - "@crate_index//:opentelemetry-semantic-conventions", - "@crate_index//:opentelemetry_sdk", - "@crate_index//:schemars", - "@crate_index//:serde", - "@crate_index//:strip-ansi-escapes", - "@crate_index//:thiserror", - "@crate_index//:tokio", - "@crate_index//:tracing", - "@crate_index//:tracing-appender", - "@crate_index//:tracing-core", - "@crate_index//:tracing-opentelemetry", - "@crate_index//:tracing-subscriber", - ], + local_deps = [":build_script"], ) diff --git a/cda-tracing/Cargo.toml b/cda-tracing/Cargo.toml index 641d96099..9a7d477f5 100644 --- a/cda-tracing/Cargo.toml +++ b/cda-tracing/Cargo.toml @@ -49,7 +49,7 @@ nu-ansi-term = { workspace = true } # ANSI terminal support for terminal log out # otel opentelemetry = { workspace = true, features = ["trace"] } opentelemetry_sdk = { workspace = true, features = ["trace", "metrics"] } -opentelemetry-otlp = { workspace = true, features = ["metrics", "grpc-tonic"] } +opentelemetry-otlp = { workspace = true, features = ["trace", "metrics", "grpc-tonic"] } opentelemetry-semantic-conventions = { workspace = true, features = [ "semconv_experimental", ] } diff --git a/comm-mbedtls/mbedtls-rs/BUILD.bazel b/comm-mbedtls/mbedtls-rs/BUILD.bazel index 8429ff4e1..b3487c205 100644 --- a/comm-mbedtls/mbedtls-rs/BUILD.bazel +++ b/comm-mbedtls/mbedtls-rs/BUILD.bazel @@ -10,23 +10,17 @@ # mbedtls-rs: Safe Rust wrapper around mbedtls with async (Tokio) TLS support. -load("@rules_rust//rust:defs.bzl", "rust_library") +load("//:bazel/rust_crate.bzl", "workspace_rust_library") package(default_visibility = ["//visibility:public"]) -rust_library( +workspace_rust_library( name = "mbedtls-rs", srcs = glob(["src/**/*.rs"]), - edition = "2024", crate_features = [ "default", "tokio", ], crate_name = "mbedtls_rs", - deps = [ - "//comm-mbedtls/mbedtls-sys", - "@crate_index//:ed25519-dalek", - "@crate_index//:tokio", - "@crate_index//:tracing", - ], + local_deps = ["//comm-mbedtls/mbedtls-sys"], ) diff --git a/comm-mbedtls/mbedtls-sys/BUILD.bazel b/comm-mbedtls/mbedtls-sys/BUILD.bazel index c26e5a5bb..21b85a7b3 100644 --- a/comm-mbedtls/mbedtls-sys/BUILD.bazel +++ b/comm-mbedtls/mbedtls-sys/BUILD.bazel @@ -14,8 +14,7 @@ # via rules_foreign_cc. The build.rs (cargo_build_script) only runs bindgen to generate # Rust FFI bindings -- cmake/cc steps are skipped via MBEDTLS_SKIP_BUILD=1. -load("@rules_rust//cargo:defs.bzl", "cargo_build_script") -load("@rules_rust//rust:defs.bzl", "rust_library") +load("//:bazel/rust_crate.bzl", "workspace_cargo_build_script", "workspace_rust_library") package(default_visibility = ["//visibility:public"]) @@ -27,10 +26,9 @@ exports_files([ "wrapper.h", ]) -cargo_build_script( +workspace_cargo_build_script( name = "build_script", srcs = ["build.rs"], - edition = "2024", build_script_env = { "MBEDTLS_DIR": "$(execpath @mbedtls//:CMakeLists.txt)", "MBEDTLS_SKIP_BUILD": "1", @@ -43,25 +41,13 @@ cargo_build_script( "@mbedtls//:CMakeLists.txt", "@mbedtls//:all_srcs", ] + glob(["csrc/**"]), - deps = [ - "@crate_index//:bindgen", - "@crate_index//:bzip2", - "@crate_index//:cc", - "@crate_index//:cmake", - "@crate_index//:const_format", - "@crate_index//:diffy", - "@crate_index//:sha256", - "@crate_index//:tar", - "@crate_index//:ureq", - ], ) -rust_library( +workspace_rust_library( name = "mbedtls-sys", srcs = glob(["src/**/*.rs"]), crate_name = "mbedtls_sys", - edition = "2024", - deps = [ + local_deps = [ ":build_script", "//third_party/mbedtls", "//third_party/mbedtls:ed25519_psa_driver", diff --git a/opensovd-axum-extra/BUILD.bazel b/opensovd-axum-extra/BUILD.bazel index 26838c68e..6c907a857 100644 --- a/opensovd-axum-extra/BUILD.bazel +++ b/opensovd-axum-extra/BUILD.bazel @@ -10,14 +10,13 @@ # opensovd-axum-extra: Optional axum extractors for host source detection. -load("@rules_rust//rust:defs.bzl", "rust_library") +load("//:bazel/rust_crate.bzl", "workspace_rust_library") package(default_visibility = ["//visibility:public"]) -rust_library( +workspace_rust_library( name = "opensovd-axum-extra", srcs = glob(["src/**/*.rs"]), - edition = "2024", crate_features = [ "default", "forwarded", @@ -26,9 +25,4 @@ rust_library( "x-forwarded-host", ], crate_name = "opensovd_axum_extra", - deps = [ - "@crate_index//:aide", - "@crate_index//:axum", - "@crate_index//:http", - ], ) diff --git a/third_party/mbedtls/BUILD.bazel b/third_party/mbedtls/BUILD.bazel index 20ec51de0..3e8eb3dcf 100644 --- a/third_party/mbedtls/BUILD.bazel +++ b/third_party/mbedtls/BUILD.bazel @@ -25,7 +25,10 @@ cmake( cache_entries = { # Force ar instead of libtool to avoid rules_foreign_cc wrapper issues on macOS "CMAKE_AR": "/usr/bin/ar", - "CMAKE_C_FLAGS": "-DMBEDTLS_SSL_RECORD_SIZE_LIMIT -DMBEDTLS_SSL_NULL_CIPHERSUITES -DMBEDTLS_ED25519_PSA_DRIVER -I$$EXT_BUILD_ROOT$$/comm-mbedtls/mbedtls-sys/csrc", + # Support both repository layouts: + # 1) CDA as the main workspace: $EXT_BUILD_ROOT/comm-mbedtls/... + # 2) CDA consumed as external module: $EXT_BUILD_ROOT/external/classic-diagnostic-adapter+/comm-mbedtls/... + "CMAKE_C_FLAGS": "-DMBEDTLS_SSL_RECORD_SIZE_LIMIT -DMBEDTLS_SSL_NULL_CIPHERSUITES -DMBEDTLS_ED25519_PSA_DRIVER -I$$EXT_BUILD_ROOT$$/comm-mbedtls/mbedtls-sys/csrc -I$$EXT_BUILD_ROOT$$/external/classic-diagnostic-adapter+/comm-mbedtls/mbedtls-sys/csrc", "ENABLE_PROGRAMS": "OFF", "ENABLE_TESTING": "OFF", "GEN_FILES": "OFF", From 3ec733a5291070ebdb050cd936fd0729dff95d00 Mon Sep 17 00:00:00 2001 From: Frank Scholter Peres Date: Fri, 10 Jul 2026 13:39:30 +0000 Subject: [PATCH 09/14] fix ci findings --- Cargo.lock | 1 + MODULE.bazel | 4 ++-- README.md | 12 ++++++++++++ cda-main/Cargo.toml | 1 + cda-main/src/lib.rs | 3 +-- cda-sovd/src/sovd/components/ecu/operations.rs | 5 +++-- .../sovd/functions/functional_groups/operations.rs | 5 +++-- opensovd-axum-extra/BUILD.bazel | 1 - third_party/BUILD.bazel | 1 - third_party/mbedtls/BUILD.bazel | 1 - third_party/mbedtls/overlay/BUILD.bazel | 1 - 11 files changed, 23 insertions(+), 12 deletions(-) diff --git a/Cargo.lock b/Cargo.lock index 9b2d4eb67..6cd59e3b1 100644 --- a/Cargo.lock +++ b/Cargo.lock @@ -2372,6 +2372,7 @@ dependencies = [ "cda-core", "cda-database", "cda-extra", + "cda-health", "cda-interfaces", "cda-plugin-runtime-update", "cda-sovd", diff --git a/MODULE.bazel b/MODULE.bazel index c4e80bd0d..899328ff1 100644 --- a/MODULE.bazel +++ b/MODULE.bazel @@ -27,14 +27,14 @@ bazel_dep(name = "platforms", version = "1.0.0") bazel_dep(name = "bazel_skylib", version = "1.8.2") # --- Rust toolchain --- -rust = use_extension("@rules_rust//rust:extensions.bzl", "rust") +rust = use_extension("@rules_rust//rust:extensions.bzl", "rust", dev_dependency = True) rust.toolchain( edition = "2024", versions = ["1.88.0"], ) use_repo(rust, "rust_toolchains") -register_toolchains("@rust_toolchains//:all") +register_toolchains("@rust_toolchains//:all", dev_dependency = True) # --- Pre-fetch mbedtls 4.0.0 source (patched by Bazel, built via rules_foreign_cc) --- http_archive = use_repo_rule("@bazel_tools//tools/build_defs/repo:http.bzl", "http_archive") diff --git a/README.md b/README.md index db854d2f2..4cf17f10a 100644 --- a/README.md +++ b/README.md @@ -126,6 +126,18 @@ bazel build --config=mbedtls //:opensovd-cda The resulting binary is located at `bazel-bin/cda-main/opensovd-cda`. +### Rust toolchain policy (Bazel) + +This repository is intentionally toolchain-neutral when consumed as a Bazel dependency. +It does not force downstream projects to use a specific Rust distribution. + +- Local development in this repository uses upstream `rules_rust` toolchains. +- Downstream integrators can register their own Rust toolchains (for example Ferrocene) + in their top-level `MODULE.bazel`. + +This keeps OpenSOVD independent from SCORE-specific toolchain modules while still allowing +SCORE-based integrations to use Ferrocene where required. + ## developing ### pre commit diff --git a/cda-main/Cargo.toml b/cda-main/Cargo.toml index becc33804..86a43f41b 100644 --- a/cda-main/Cargo.toml +++ b/cda-main/Cargo.toml @@ -34,6 +34,7 @@ cda-core = { workspace = true } cda-comm-doip = { workspace = true } cda-comm-uds = { workspace = true } cda-database = { workspace = true } +cda-health = { workspace = true } cda-interfaces = { workspace = true } cda-sovd = { workspace = true } cda-tracing = { workspace = true } diff --git a/cda-main/src/lib.rs b/cda-main/src/lib.rs index 3461a4ce1..b473e14e2 100644 --- a/cda-main/src/lib.rs +++ b/cda-main/src/lib.rs @@ -791,8 +791,7 @@ async fn check_duplicate_ecu_names( } } -type UdsManagerType = - UdsManager>, EcuManager>; +type UdsManagerType = UdsManager>, EcuManager>; async fn create_state_coordinator( databases: &HashMap>>, diff --git a/cda-sovd/src/sovd/components/ecu/operations.rs b/cda-sovd/src/sovd/components/ecu/operations.rs index caf7a95f8..3116b0682 100644 --- a/cda-sovd/src/sovd/components/ecu/operations.rs +++ b/cda-sovd/src/sovd/components/ecu/operations.rs @@ -755,7 +755,7 @@ pub(crate) mod service { http::{HeaderMap, StatusCode, header}, response::{IntoResponse as _, Response}, }; - use axum_extra::extract::{Host, WithRejection}; + use axum_extra::extract::WithRejection; use cda_interfaces::{ DiagComm, DiagCommType, DynamicPlugin, SchemaProvider, UdsEcu, diagservices::{DiagServiceJsonResponse, DiagServiceResponse, DiagServiceResponseType}, @@ -770,6 +770,7 @@ pub(crate) mod service { OperationQuery, service::executions as sovd_executions, }, }; + use opensovd_axum_extra::ExtractHost; use uuid::Uuid; use crate::{ @@ -856,7 +857,7 @@ pub(crate) mod service { update_in_progress, .. }): State>, - UseApi(Host(host), _): UseApi, + UseApi(ExtractHost(host), _): UseApi, OriginalUri(uri): OriginalUri, headers: HeaderMap, body: Bytes, diff --git a/cda-sovd/src/sovd/functions/functional_groups/operations.rs b/cda-sovd/src/sovd/functions/functional_groups/operations.rs index 41115c0d1..8771f9a3a 100644 --- a/cda-sovd/src/sovd/functions/functional_groups/operations.rs +++ b/cda-sovd/src/sovd/functions/functional_groups/operations.rs @@ -193,13 +193,14 @@ pub(crate) mod diag_service { http::{HeaderMap, StatusCode, Uri, header}, response::{IntoResponse, Response}, }; - use axum_extra::extract::{Host, WithRejection}; + use axum_extra::extract::WithRejection; use cda_interfaces::{ DiagComm, DiagCommType, DynamicPlugin, HashMap, UdsEcu, diagservices::DiagServiceResponse, subfunction_ids, }; use cda_plugin_security::Secured; use indexmap::IndexMap; + use opensovd_axum_extra::ExtractHost; use sovd_interfaces::components::ecu::operations::{AsyncPostResponse, ExecutionStatus}; use tokio::sync::RwLock; use uuid::Uuid; @@ -360,7 +361,7 @@ pub(crate) mod diag_service { pub(crate) async fn post( headers: HeaderMap, UseApi(Secured(security_plugin), _): UseApi, - UseApi(Host(host), _): UseApi, + UseApi(ExtractHost(host), _): UseApi, OriginalUri(uri): OriginalUri, Path(DiagServicePathParam { service: operation }): Path, WithRejection(Query(query), _): WithRejection< diff --git a/opensovd-axum-extra/BUILD.bazel b/opensovd-axum-extra/BUILD.bazel index 6c907a857..d696aef23 100644 --- a/opensovd-axum-extra/BUILD.bazel +++ b/opensovd-axum-extra/BUILD.bazel @@ -1,5 +1,4 @@ # SPDX-License-Identifier: Apache-2.0 -# SPDX-FileCopyrightText: 2025 The Contributors to Eclipse OpenSOVD (see CONTRIBUTORS) # # See the NOTICE file(s) distributed with this work for additional # information regarding copyright ownership. diff --git a/third_party/BUILD.bazel b/third_party/BUILD.bazel index e8dbc4ea6..2c4814f23 100644 --- a/third_party/BUILD.bazel +++ b/third_party/BUILD.bazel @@ -1,5 +1,4 @@ # SPDX-License-Identifier: Apache-2.0 -# SPDX-FileCopyrightText: 2025 The Contributors to Eclipse OpenSOVD (see CONTRIBUTORS) # # See the NOTICE file(s) distributed with this work for additional # information regarding copyright ownership. diff --git a/third_party/mbedtls/BUILD.bazel b/third_party/mbedtls/BUILD.bazel index 3e8eb3dcf..74ece77a5 100644 --- a/third_party/mbedtls/BUILD.bazel +++ b/third_party/mbedtls/BUILD.bazel @@ -1,5 +1,4 @@ # SPDX-License-Identifier: Apache-2.0 -# SPDX-FileCopyrightText: 2025 The Contributors to Eclipse OpenSOVD (see CONTRIBUTORS) # # See the NOTICE file(s) distributed with this work for additional # information regarding copyright ownership. diff --git a/third_party/mbedtls/overlay/BUILD.bazel b/third_party/mbedtls/overlay/BUILD.bazel index 6e487a1ae..eafed57d5 100644 --- a/third_party/mbedtls/overlay/BUILD.bazel +++ b/third_party/mbedtls/overlay/BUILD.bazel @@ -1,5 +1,4 @@ # SPDX-License-Identifier: Apache-2.0 -# SPDX-FileCopyrightText: 2025 The Contributors to Eclipse OpenSOVD (see CONTRIBUTORS) # # See the NOTICE file(s) distributed with this work for additional # information regarding copyright ownership. From cd12bce808df94bd88695ea9311da5fbab7c89bc Mon Sep 17 00:00:00 2001 From: Frank Scholter Peres Date: Fri, 10 Jul 2026 14:37:04 +0000 Subject: [PATCH 10/14] Fix remaining PR348 CI failures Add missing cda-plugin-security dependency in cda-main, adjust ExtractHost import ordering for checkstyle, and configure reuse-annotate to skip unrecognized Bazel files. --- .pre-commit-config.yaml | 1 + Cargo.lock | 1 + cda-main/Cargo.toml | 1 + cda-sovd/src/sovd/components/ecu/operations.rs | 2 +- 4 files changed, 4 insertions(+), 1 deletion(-) diff --git a/.pre-commit-config.yaml b/.pre-commit-config.yaml index a67491632..9302451e8 100644 --- a/.pre-commit-config.yaml +++ b/.pre-commit-config.yaml @@ -54,6 +54,7 @@ repos: rev: 07140bdd84f20b66fd4aff58a83c5148deec388c hooks: - id: reuse-annotate + args: ["--skip-unrecognised"] - id: no-unicode-check args: - --allowed-chars=µ,§ diff --git a/Cargo.lock b/Cargo.lock index 6cd59e3b1..dfa59f5a5 100644 --- a/Cargo.lock +++ b/Cargo.lock @@ -2375,6 +2375,7 @@ dependencies = [ "cda-health", "cda-interfaces", "cda-plugin-runtime-update", + "cda-plugin-security", "cda-sovd", "cda-storage", "cda-tracing", diff --git a/cda-main/Cargo.toml b/cda-main/Cargo.toml index 86a43f41b..e9629cb1d 100644 --- a/cda-main/Cargo.toml +++ b/cda-main/Cargo.toml @@ -40,6 +40,7 @@ cda-sovd = { workspace = true } cda-tracing = { workspace = true } cda-extra = { workspace = true, optional = true } cda-plugin-runtime-update = { workspace = true } +cda-plugin-security = { workspace = true } cda-storage = { workspace = true } # args clap = { workspace = true, features = ["derive", "env"] } diff --git a/cda-sovd/src/sovd/components/ecu/operations.rs b/cda-sovd/src/sovd/components/ecu/operations.rs index 3116b0682..929555266 100644 --- a/cda-sovd/src/sovd/components/ecu/operations.rs +++ b/cda-sovd/src/sovd/components/ecu/operations.rs @@ -763,6 +763,7 @@ pub(crate) mod service { subfunction_ids, }; use cda_plugin_security::{Secured, SecurityPlugin}; + use opensovd_axum_extra::ExtractHost; use sovd_interfaces::{ common::operations::OperationIdItem, components::ecu::operations::{ @@ -770,7 +771,6 @@ pub(crate) mod service { OperationQuery, service::executions as sovd_executions, }, }; - use opensovd_axum_extra::ExtractHost; use uuid::Uuid; use crate::{ From 6dee0923ec05302cedcab786fd28da3778054379 Mon Sep 17 00:00:00 2001 From: Frank Scholter Peres Date: Mon, 13 Jul 2026 08:52:56 +0000 Subject: [PATCH 11/14] Fix remaining Rust/pre-commit CI issues Move com-params resolver usage to cda-main mdd module, add missing error docs and allow reasons, update FG operation tests to use ExtractHost, remove unsupported reuse-annotate arg, restore SPDX headers for Bazel files, and normalize trailing newline in bazel/rust_crate.bzl. --- .pre-commit-config.yaml | 1 - bazel/rust_crate.bzl | 2 +- cda-main/src/config/configfile.rs | 17 +++++----- cda-main/src/config/generate.rs | 9 ++++-- cda-main/src/lib.rs | 31 +++++++++++++++++-- cda-main/src/mdd.rs | 24 +++++++++++--- .../functions/functional_groups/operations.rs | 18 +++++------ opensovd-axum-extra/BUILD.bazel | 1 + third_party/BUILD.bazel | 1 + third_party/mbedtls/BUILD.bazel | 1 + third_party/mbedtls/overlay/BUILD.bazel | 1 + 11 files changed, 78 insertions(+), 28 deletions(-) diff --git a/.pre-commit-config.yaml b/.pre-commit-config.yaml index 9302451e8..a67491632 100644 --- a/.pre-commit-config.yaml +++ b/.pre-commit-config.yaml @@ -54,7 +54,6 @@ repos: rev: 07140bdd84f20b66fd4aff58a83c5148deec388c hooks: - id: reuse-annotate - args: ["--skip-unrecognised"] - id: no-unicode-check args: - --allowed-chars=µ,§ diff --git a/bazel/rust_crate.bzl b/bazel/rust_crate.bzl index ab8b4159d..fc1f2a976 100644 --- a/bazel/rust_crate.bzl +++ b/bazel/rust_crate.bzl @@ -67,4 +67,4 @@ def workspace_cargo_build_script( deps = (local_deps or []) + all_crate_deps(build = True), proc_macro_deps = (local_proc_macro_deps or []) + all_crate_deps(build_proc_macro = True), **kwargs - ) \ No newline at end of file + ) diff --git a/cda-main/src/config/configfile.rs b/cda-main/src/config/configfile.rs index b91113a15..734388b3d 100644 --- a/cda-main/src/config/configfile.rs +++ b/cda-main/src/config/configfile.rs @@ -562,9 +562,12 @@ value = 65535 .get("TMCC3000") .expect("TMCC3000 ecu config should be present"); let ecu_com_params = tmcc.com_params.as_ref().expect("com_params should be Some"); - let resolved = - crate::resolve_com_params("TMCC3000", &config.com_params, Some(ecu_com_params)) - .expect("resolve should succeed"); + let resolved = crate::mdd::resolve_com_params( + "TMCC3000", + &config.com_params, + Some(ecu_com_params), + ) + .expect("resolve should succeed"); assert_eq!( resolved.doip.logical_gateway_address.value, 12288u16, @@ -587,7 +590,7 @@ value = 12288 "; let ecu_overrides = parse_ecu_com_params(ecu_toml).expect("Failed to parse ECU com params"); let global = ComParams::default(); - let effective = crate::resolve_com_params("test", &global, Some(&ecu_overrides)) + let effective = crate::mdd::resolve_com_params("test", &global, Some(&ecu_overrides)) .expect("Resolve should succeed"); assert_eq!( @@ -609,7 +612,7 @@ value = 9999 let mut global = ComParams::default(); global.doip.logical_gateway_address.value = 0x1234u16; - let effective = crate::resolve_com_params("test", &global, Some(&ecu_overrides)) + let effective = crate::mdd::resolve_com_params("test", &global, Some(&ecu_overrides)) .expect("resolve should succeed"); assert_eq!( @@ -631,7 +634,7 @@ precedence = "Config" "#; let ecu_overrides = parse_ecu_com_params(ecu_toml).expect("Failed to parse ECU com params"); let global = ComParams::default(); - let effective = crate::resolve_com_params("test", &global, Some(&ecu_overrides)) + let effective = crate::mdd::resolve_com_params("test", &global, Some(&ecu_overrides)) .expect("resolve should succeed"); assert_eq!( @@ -649,7 +652,7 @@ value = 12288 "; let ecu_overrides = parse_ecu_com_params(ecu_toml).expect("Failed to parse ECU com params"); let global = ComParams::default(); - let effective = crate::resolve_com_params("test", &global, Some(&ecu_overrides)) + let effective = crate::mdd::resolve_com_params("test", &global, Some(&ecu_overrides)) .expect("resolve should succeed"); assert_eq!( diff --git a/cda-main/src/config/generate.rs b/cda-main/src/config/generate.rs index 83c12960e..c00a92f4c 100644 --- a/cda-main/src/config/generate.rs +++ b/cda-main/src/config/generate.rs @@ -773,9 +773,12 @@ mod tests { .as_ref() .expect("FLXC1000 should have com_params"); - let resolved = - crate::resolve_com_params("FLXC1000", &config.com_params, Some(ecu_overrides)) - .expect("resolve_com_params should succeed for FLXC1000"); + let resolved = crate::mdd::resolve_com_params( + "FLXC1000", + &config.com_params, + Some(ecu_overrides), + ) + .expect("resolve_com_params should succeed for FLXC1000"); assert_eq!( resolved.uds.timeout_default.value, diff --git a/cda-main/src/lib.rs b/cda-main/src/lib.rs index b473e14e2..94f7cff7d 100644 --- a/cda-main/src/lib.rs +++ b/cda-main/src/lib.rs @@ -41,6 +41,7 @@ use tracing_subscriber::layer::SubscriberExt; use crate::config::configfile::Configuration; pub mod config; +pub mod mdd; #[global_allocator] static GLOBAL: mimalloc::MiMalloc = mimalloc::MiMalloc; @@ -273,6 +274,11 @@ impl From for AppError { } } +/// Generate a reference configuration file. +/// +/// # Errors +/// +/// Returns [`AppError`] when configuration generation or writing the output fails. pub fn generate_config_cmd(output: Option<&PathBuf>) -> Result<(), AppError> { let content = config::generate::generate_reference_config() .map_err(|e| AppError::RuntimeError(format!("Failed to generate config: {e}")))?; @@ -595,7 +601,10 @@ async fn mark_duplicate_ecus_by_address( } } -#[allow(clippy::too_many_arguments)] +#[allow( + clippy::too_many_arguments, + reason = "database loading setup passes several independent configuration inputs" +)] #[tracing::instrument( skip_all, fields( @@ -808,7 +817,10 @@ async fn create_state_coordinator( /// Creates a new UDS manager for the webserver. // type alias does not allow specifying hasher, we set the hasher globally. -#[allow(clippy::implicit_hasher)] +#[allow( + clippy::implicit_hasher, + reason = "this API uses the workspace HashMap alias with the default hasher" +)] #[tracing::instrument(skip_all, fields( database_count = databases.len(), @@ -976,6 +988,11 @@ pub fn cda_version() -> &'static str { env!("CARGO_PKG_VERSION") } +/// Run the CDA with an already-resolved configuration. +/// +/// # Errors +/// +/// Returns [`AppError`] if tracing, webserver startup, database loading, or route setup fails. pub async fn run_with_config(config: Configuration) -> Result<(), AppError> { let _tracing_guards = setup_tracing(&config)?; tracing::info!("Starting CDA - version {}", cda_version()); @@ -1069,6 +1086,11 @@ async fn register_version_endpoints(dynamic_router: &cda_sovd::dynamic_router::D .await; } +/// Run the CDA from parsed command-line arguments. +/// +/// # Errors +/// +/// Returns [`AppError`] if config loading, validation, or runtime initialization fails. pub async fn run(args: AppArgs) -> Result<(), AppError> { if let Some(Command::GenerateConfig { output }) = args.command.as_ref() { return generate_config_cmd(output.as_ref()); @@ -1083,6 +1105,11 @@ pub async fn run(args: AppArgs) -> Result<(), AppError> { run_with_config(config).await } +/// Parse CLI arguments and run the CDA. +/// +/// # Errors +/// +/// Returns [`AppError`] if argument-driven startup or runtime initialization fails. pub async fn run_from_cli() -> Result<(), AppError> { Box::pin(run(AppArgs::parse())).await } diff --git a/cda-main/src/mdd.rs b/cda-main/src/mdd.rs index eab86da78..6f1848c82 100644 --- a/cda-main/src/mdd.rs +++ b/cda-main/src/mdd.rs @@ -28,15 +28,31 @@ use cda_interfaces::{ storage_api::{Collection, CollectionName, DirectFileAccess, Storage}, }; use cda_plugin_security::SecurityPlugin; +use figment::{Figment, providers::Serialized}; use tokio::sync::RwLock; use crate::{ AppError, DatabaseMap, FileManagerMap, - config::configfile::{Configuration, EcuConfig}, - resolve_com_params, + config::configfile::{Configuration, EcuComParams, EcuConfig}, }; -pub(crate) const DB_HEALTH_COMPONENT_KEY: &str = "database"; +pub(crate) fn resolve_com_params( + ecu_name: &str, + global: &ComParams, + ecu_overrides: Option<&EcuComParams>, +) -> Option { + let Some(ecu_overrides) = ecu_overrides else { + return Some(global.clone()); + }; + + Figment::from(Serialized::defaults(global.clone())) + .merge(Serialized::defaults(ecu_overrides)) + .extract::() + .map_err(|error| { + tracing::error!(ecu_name, %error, "Failed to resolve ECU communication parameters"); + }) + .ok() +} #[derive(Debug, thiserror::Error)] pub enum MddLoadingError { @@ -659,8 +675,6 @@ fn insert_or_update_ecu( #[cfg(test)] mod tests { - use crate::resolve_com_params; - #[test] fn resolve_com_params_returns_none_on_figment_extraction_failure() { use cda_interfaces::datatypes::ComParams; diff --git a/cda-sovd/src/sovd/functions/functional_groups/operations.rs b/cda-sovd/src/sovd/functions/functional_groups/operations.rs index 8771f9a3a..be7f6b054 100644 --- a/cda-sovd/src/sovd/functions/functional_groups/operations.rs +++ b/cda-sovd/src/sovd/functions/functional_groups/operations.rs @@ -1148,7 +1148,7 @@ pub(crate) mod diag_service { std::marker::PhantomData, ), UseApi( - axum_extra::extract::Host("localhost".to_string()), + ExtractHost("localhost".to_string()), std::marker::PhantomData, ), axum::extract::OriginalUri( @@ -1205,7 +1205,7 @@ pub(crate) mod diag_service { std::marker::PhantomData, ), UseApi( - axum_extra::extract::Host("localhost".to_string()), + ExtractHost("localhost".to_string()), std::marker::PhantomData, ), axum::extract::OriginalUri( @@ -1263,7 +1263,7 @@ pub(crate) mod diag_service { std::marker::PhantomData, ), UseApi( - axum_extra::extract::Host("localhost".to_string()), + ExtractHost("localhost".to_string()), std::marker::PhantomData, ), axum::extract::OriginalUri( @@ -1320,7 +1320,7 @@ pub(crate) mod diag_service { std::marker::PhantomData, ), UseApi( - axum_extra::extract::Host("localhost".to_string()), + ExtractHost("localhost".to_string()), std::marker::PhantomData, ), axum::extract::OriginalUri( @@ -1388,7 +1388,7 @@ pub(crate) mod diag_service { std::marker::PhantomData, ), UseApi( - axum_extra::extract::Host("localhost".to_string()), + ExtractHost("localhost".to_string()), std::marker::PhantomData, ), axum::extract::OriginalUri( @@ -1465,7 +1465,7 @@ pub(crate) mod diag_service { std::marker::PhantomData, ), UseApi( - axum_extra::extract::Host("localhost".to_string()), + ExtractHost("localhost".to_string()), std::marker::PhantomData, ), axum::extract::OriginalUri( @@ -1782,7 +1782,7 @@ pub(crate) mod diag_service { std::marker::PhantomData, ), UseApi( - axum_extra::extract::Host("localhost".to_string()), + ExtractHost("localhost".to_string()), std::marker::PhantomData, ), axum::extract::OriginalUri( @@ -1832,7 +1832,7 @@ pub(crate) mod diag_service { std::marker::PhantomData, ), UseApi( - axum_extra::extract::Host("localhost".to_string()), + ExtractHost("localhost".to_string()), std::marker::PhantomData, ), axum::extract::OriginalUri( @@ -1902,7 +1902,7 @@ pub(crate) mod diag_service { std::marker::PhantomData, ), UseApi( - axum_extra::extract::Host("localhost".to_string()), + ExtractHost("localhost".to_string()), std::marker::PhantomData, ), axum::extract::OriginalUri( diff --git a/opensovd-axum-extra/BUILD.bazel b/opensovd-axum-extra/BUILD.bazel index d696aef23..6c907a857 100644 --- a/opensovd-axum-extra/BUILD.bazel +++ b/opensovd-axum-extra/BUILD.bazel @@ -1,4 +1,5 @@ # SPDX-License-Identifier: Apache-2.0 +# SPDX-FileCopyrightText: 2025 The Contributors to Eclipse OpenSOVD (see CONTRIBUTORS) # # See the NOTICE file(s) distributed with this work for additional # information regarding copyright ownership. diff --git a/third_party/BUILD.bazel b/third_party/BUILD.bazel index 2c4814f23..e8dbc4ea6 100644 --- a/third_party/BUILD.bazel +++ b/third_party/BUILD.bazel @@ -1,4 +1,5 @@ # SPDX-License-Identifier: Apache-2.0 +# SPDX-FileCopyrightText: 2025 The Contributors to Eclipse OpenSOVD (see CONTRIBUTORS) # # See the NOTICE file(s) distributed with this work for additional # information regarding copyright ownership. diff --git a/third_party/mbedtls/BUILD.bazel b/third_party/mbedtls/BUILD.bazel index 74ece77a5..3e8eb3dcf 100644 --- a/third_party/mbedtls/BUILD.bazel +++ b/third_party/mbedtls/BUILD.bazel @@ -1,4 +1,5 @@ # SPDX-License-Identifier: Apache-2.0 +# SPDX-FileCopyrightText: 2025 The Contributors to Eclipse OpenSOVD (see CONTRIBUTORS) # # See the NOTICE file(s) distributed with this work for additional # information regarding copyright ownership. diff --git a/third_party/mbedtls/overlay/BUILD.bazel b/third_party/mbedtls/overlay/BUILD.bazel index eafed57d5..6e487a1ae 100644 --- a/third_party/mbedtls/overlay/BUILD.bazel +++ b/third_party/mbedtls/overlay/BUILD.bazel @@ -1,4 +1,5 @@ # SPDX-License-Identifier: Apache-2.0 +# SPDX-FileCopyrightText: 2025 The Contributors to Eclipse OpenSOVD (see CONTRIBUTORS) # # See the NOTICE file(s) distributed with this work for additional # information regarding copyright ownership. From 1bb1e20a0f38b6b0641047ebeeb9b6fbba57ac0e Mon Sep 17 00:00:00 2001 From: Frank Scholter Peres Date: Mon, 13 Jul 2026 10:54:25 +0000 Subject: [PATCH 12/14] Fix CI: reuse hook, formatting, resolver scope Exclude extensionless Bazel files from reuse-annotate, apply checkstyle formatting in config tests, and import resolve_com_params in mdd tests to fix unresolved symbol errors in Rust CI. --- .pre-commit-config.yaml | 1 + cda-main/src/config/configfile.rs | 9 +++------ cda-main/src/config/generate.rs | 9 +++------ cda-main/src/mdd.rs | 2 +- 4 files changed, 8 insertions(+), 13 deletions(-) diff --git a/.pre-commit-config.yaml b/.pre-commit-config.yaml index a67491632..87518fd10 100644 --- a/.pre-commit-config.yaml +++ b/.pre-commit-config.yaml @@ -54,6 +54,7 @@ repos: rev: 07140bdd84f20b66fd4aff58a83c5148deec388c hooks: - id: reuse-annotate + exclude: '(^|/)(BUILD\.bazel|MODULE\.bazel)$' - id: no-unicode-check args: - --allowed-chars=µ,§ diff --git a/cda-main/src/config/configfile.rs b/cda-main/src/config/configfile.rs index 734388b3d..7aced3389 100644 --- a/cda-main/src/config/configfile.rs +++ b/cda-main/src/config/configfile.rs @@ -562,12 +562,9 @@ value = 65535 .get("TMCC3000") .expect("TMCC3000 ecu config should be present"); let ecu_com_params = tmcc.com_params.as_ref().expect("com_params should be Some"); - let resolved = crate::mdd::resolve_com_params( - "TMCC3000", - &config.com_params, - Some(ecu_com_params), - ) - .expect("resolve should succeed"); + let resolved = + crate::mdd::resolve_com_params("TMCC3000", &config.com_params, Some(ecu_com_params)) + .expect("resolve should succeed"); assert_eq!( resolved.doip.logical_gateway_address.value, 12288u16, diff --git a/cda-main/src/config/generate.rs b/cda-main/src/config/generate.rs index c00a92f4c..353c34c1c 100644 --- a/cda-main/src/config/generate.rs +++ b/cda-main/src/config/generate.rs @@ -773,12 +773,9 @@ mod tests { .as_ref() .expect("FLXC1000 should have com_params"); - let resolved = crate::mdd::resolve_com_params( - "FLXC1000", - &config.com_params, - Some(ecu_overrides), - ) - .expect("resolve_com_params should succeed for FLXC1000"); + let resolved = + crate::mdd::resolve_com_params("FLXC1000", &config.com_params, Some(ecu_overrides)) + .expect("resolve_com_params should succeed for FLXC1000"); assert_eq!( resolved.uds.timeout_default.value, diff --git a/cda-main/src/mdd.rs b/cda-main/src/mdd.rs index 6f1848c82..ce4dce6c4 100644 --- a/cda-main/src/mdd.rs +++ b/cda-main/src/mdd.rs @@ -695,7 +695,7 @@ mod tests { use cda_interfaces::storage_api::{Collection as _, CollectionName, DirectFileAccess, Storage}; use cda_storage::LocalStorage; - use super::{resolve_mdd_paths, seed_storage_from_database_path}; + use super::{resolve_com_params, resolve_mdd_paths, seed_storage_from_database_path}; /// Helper: create a temp dir with `.mdd` files containing given data. fn create_database_dir(files: &[(&str, &[u8])]) -> tempfile::TempDir { From c7b455fba0808f1e25187574ae6fbf5dc87879bf Mon Sep 17 00:00:00 2001 From: Frank Scholter Peres Date: Mon, 13 Jul 2026 12:18:18 +0000 Subject: [PATCH 13/14] Fix post-merge CI regressions Restore DB_HEALTH_COMPONENT_KEY used by cda-main and apply end-of-file fixer update for cda-plugin-runtime-update/BUILD.bazel. --- cda-main/src/mdd.rs | 2 ++ cda-plugin-runtime-update/BUILD.bazel | 2 +- 2 files changed, 3 insertions(+), 1 deletion(-) diff --git a/cda-main/src/mdd.rs b/cda-main/src/mdd.rs index ce4dce6c4..1124b20bd 100644 --- a/cda-main/src/mdd.rs +++ b/cda-main/src/mdd.rs @@ -36,6 +36,8 @@ use crate::{ config::configfile::{Configuration, EcuComParams, EcuConfig}, }; +pub(crate) const DB_HEALTH_COMPONENT_KEY: &str = "database"; + pub(crate) fn resolve_com_params( ecu_name: &str, global: &ComParams, diff --git a/cda-plugin-runtime-update/BUILD.bazel b/cda-plugin-runtime-update/BUILD.bazel index 56ff1a4a2..af96a0187 100644 --- a/cda-plugin-runtime-update/BUILD.bazel +++ b/cda-plugin-runtime-update/BUILD.bazel @@ -21,4 +21,4 @@ workspace_rust_library( "//cda-interfaces", "//cda-sovd-interfaces:sovd-interfaces", ], -) \ No newline at end of file +) From 04fad499fc9e2137c2d2919a1e9384c593720b73 Mon Sep 17 00:00:00 2001 From: Frank Scholter Peres Date: Mon, 13 Jul 2026 12:52:59 +0000 Subject: [PATCH 14/14] Fix pre-commit REUSE hook stability Exclude extensionless legal docs from reuse-annotate and align SPDX header format on Bazel files/workflow to match hook expectations. --- .bazelrc | 5 +++-- .github/workflows/bazel.yml | 5 +++-- .pre-commit-config.yaml | 2 +- bazel/rust_crate.bzl | 5 +++-- bazel/workspace_status.sh | 5 +++-- 5 files changed, 13 insertions(+), 9 deletions(-) diff --git a/.bazelrc b/.bazelrc index f87626718..a2db69ca2 100644 --- a/.bazelrc +++ b/.bazelrc @@ -1,5 +1,4 @@ -# SPDX-License-Identifier: Apache-2.0 -# SPDX-FileCopyrightText: 2025 The Contributors to Eclipse OpenSOVD (see CONTRIBUTORS) +# SPDX-FileCopyrightText: 2025 Copyright (c) Contributors to the Eclipse Foundation # # See the NOTICE file(s) distributed with this work for additional # information regarding copyright ownership. @@ -7,6 +6,8 @@ # This program and the accompanying materials are made available under the # terms of the Apache License Version 2.0 which is available at # https://www.apache.org/licenses/LICENSE-2.0 +# +# SPDX-License-Identifier: Apache-2.0 # Classic Diagnostic Adapter - Bazel Configuration # diff --git a/.github/workflows/bazel.yml b/.github/workflows/bazel.yml index 1371fc83a..30b658571 100644 --- a/.github/workflows/bazel.yml +++ b/.github/workflows/bazel.yml @@ -1,5 +1,4 @@ -# SPDX-License-Identifier: Apache-2.0 -# SPDX-FileCopyrightText: 2025 The Contributors to Eclipse OpenSOVD (see CONTRIBUTORS) +# SPDX-FileCopyrightText: 2025 Copyright (c) Contributors to the Eclipse Foundation # # See the NOTICE file(s) distributed with this work for additional # information regarding copyright ownership. @@ -7,6 +6,8 @@ # This program and the accompanying materials are made available under the # terms of the Apache License Version 2.0 which is available at # https://www.apache.org/licenses/LICENSE-2.0 +# +# SPDX-License-Identifier: Apache-2.0 name: Bazel Build diff --git a/.pre-commit-config.yaml b/.pre-commit-config.yaml index 87518fd10..fcfb106b8 100644 --- a/.pre-commit-config.yaml +++ b/.pre-commit-config.yaml @@ -54,7 +54,7 @@ repos: rev: 07140bdd84f20b66fd4aff58a83c5148deec388c hooks: - id: reuse-annotate - exclude: '(^|/)(BUILD\.bazel|MODULE\.bazel)$' + exclude: '(^|/)(BUILD\.bazel|MODULE\.bazel|LICENSE|NOTICE|CONTRIBUTORS)$' - id: no-unicode-check args: - --allowed-chars=µ,§ diff --git a/bazel/rust_crate.bzl b/bazel/rust_crate.bzl index fc1f2a976..2b14f32ae 100644 --- a/bazel/rust_crate.bzl +++ b/bazel/rust_crate.bzl @@ -1,5 +1,4 @@ -# SPDX-License-Identifier: Apache-2.0 -# SPDX-FileCopyrightText: 2026 The Contributors to Eclipse OpenSOVD (see CONTRIBUTORS) +# SPDX-FileCopyrightText: 2026 Copyright (c) Contributors to the Eclipse Foundation # # See the NOTICE file(s) distributed with this work for additional # information regarding copyright ownership. @@ -7,6 +6,8 @@ # This program and the accompanying materials are made available under the # terms of the Apache License Version 2.0 which is available at # https://www.apache.org/licenses/LICENSE-2.0 +# +# SPDX-License-Identifier: Apache-2.0 """Workspace-local wrappers for common rules_rust target patterns.""" diff --git a/bazel/workspace_status.sh b/bazel/workspace_status.sh index 45e294e9f..9b05c83b4 100755 --- a/bazel/workspace_status.sh +++ b/bazel/workspace_status.sh @@ -1,6 +1,5 @@ #!/usr/bin/env bash -# SPDX-License-Identifier: Apache-2.0 -# SPDX-FileCopyrightText: 2025 The Contributors to Eclipse OpenSOVD (see CONTRIBUTORS) +# SPDX-FileCopyrightText: 2025 Copyright (c) Contributors to the Eclipse Foundation # # See the NOTICE file(s) distributed with this work for additional # information regarding copyright ownership. @@ -8,6 +7,8 @@ # This program and the accompanying materials are made available under the # terms of the Apache License Version 2.0 which is available at # https://www.apache.org/licenses/LICENSE-2.0 +# +# SPDX-License-Identifier: Apache-2.0 # Workspace status script for Bazel. # Provides git metadata used by the cda-main build.rs (via SOURCE_DATE_EPOCH / SOURCE_GIT_SHA).