Skip to content
Draft
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
5 changes: 2 additions & 3 deletions .bazelrc
Original file line number Diff line number Diff line change
Expand Up @@ -25,12 +25,11 @@ build --tool_java_language_version=17
build --java_runtime_version=remotejdk_17
build --tool_java_runtime_version=remotejdk_17

build --@score_baselibs_rust//src/log:safety_level=qm
build --@score_baselibs//score/json:base_library=nlohmann
build --@score_baselibs//score/mw/log/flags:KRemote_Logging=False

# ToDo: needed for "wrong" implicit dependencies
build --@score-baselibs//score/json:base_library=nlohmann
build --@score-baselibs//score/mw/log/flags:KRemote_Logging=False
common --extra_toolchains=@gcc_toolchain//:host_gcc_12

# Clippy linting (enabled by default)
build --aspects=@rules_rust//rust:defs.bzl%rust_clippy_aspect
Expand Down
14 changes: 7 additions & 7 deletions .github/workflows/check.yml
Original file line number Diff line number Diff line change
Expand Up @@ -33,12 +33,12 @@ jobs:

- uses: dtolnay/rust-toolchain@stable
with:
toolchain: 1.83.0
toolchain: 1.90.0
components: clippy, rustfmt

- name: Cargo Clippy
run: |
cargo clippy --all-targets --all-features
cargo clippy --all-targets --features stdout_logger -- -D warnings

- name: Cargo Fmt
run: |
Expand All @@ -57,7 +57,7 @@ jobs:

- uses: dtolnay/rust-toolchain@stable
with:
toolchain: nightly-2024-12-17
toolchain: nightly-2025-12-15
components: miri, rust-src

- name: Install Clang
Expand All @@ -67,7 +67,7 @@ jobs:

- name: Cargo Miri
run: |
cargo +nightly-2024-12-17 miri test
cargo +nightly-2025-12-15 miri test

cargo-coverage:
runs-on: ubuntu-latest
Expand All @@ -76,16 +76,16 @@ jobs:

- uses: dtolnay/rust-toolchain@stable
with:
toolchain: nightly-2024-12-17
toolchain: nightly-2025-12-15
components: llvm-tools-preview, rust-src

- name: Install cargo-llvm-cov
run: |
cargo +nightly-2024-12-17 install cargo-llvm-cov --locked
cargo +nightly-2025-12-15 install cargo-llvm-cov --locked

- name: Cargo llvm-cov
run: |
cargo +nightly-2024-12-17 llvm-cov --branch --tests --lib
cargo +nightly-2025-12-15 llvm-cov --branch --tests --lib

rust-bazel:
runs-on: ubuntu-latest
Expand Down
2 changes: 1 addition & 1 deletion .github/workflows/component_integration_tests.yml
Original file line number Diff line number Diff line change
Expand Up @@ -34,7 +34,7 @@ jobs:
- name: Setup Rust build environment
uses: dtolnay/rust-toolchain@stable
with:
toolchain: 1.83.0
toolchain: 1.90.0

- name: Setup Bazel
uses: bazel-contrib/[email protected]
Expand Down
4 changes: 2 additions & 2 deletions BUILD
Original file line number Diff line number Diff line change
Expand Up @@ -20,8 +20,8 @@ load("//:project_config.bzl", "PROJECT_CONFIG")
# - `:docs` for building documentation at build-time
docs(
data = [
"@score_platform//:needs_json",
"@score_process//:needs_json",
# "@score_platform//:needs_json",
# "@score_process//:needs_json",
],
source_dir = "docs",
)
Expand Down
42 changes: 40 additions & 2 deletions Cargo.lock

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

3 changes: 3 additions & 0 deletions Cargo.toml
Original file line number Diff line number Diff line change
Expand Up @@ -15,6 +15,9 @@ edition = "2021"
[workspace.dependencies]
rust_kvs = { path = "src/rust/rust_kvs" }
rust_kvs_tool = { path = "src/rust/rust_kvs_tool" }
mw_log = { git = "https://github.com/eclipse-score/baselibs_rust.git", rev = "54e2af036603107039a2eca4912413763ab112e7", features = [
"qm",
] }

adler32 = "1.2.0"
tinyjson = "2.5.1"
Expand Down
42 changes: 34 additions & 8 deletions MODULE.bazel
Original file line number Diff line number Diff line change
Expand Up @@ -46,7 +46,7 @@ bazel_dep(name = "score_rust_policies", version = "0.0.2", dev_dependency = True
rust = use_extension("@rules_rust//rust:extensions.bzl", "rust", dev_dependency = True)
rust.toolchain(
edition = "2021",
versions = ["1.85.0"],
versions = ["1.90.0"],
)

# bazel cc rules
Expand Down Expand Up @@ -85,16 +85,19 @@ bazel_dep(name = "google_benchmark", version = "1.9.4", dev_dependency = True)
bazel_dep(name = "platforms", version = "1.0.0")

## S-CORE bazel registry
bazel_dep(name = "score_baselibs", version = "0.1.2")
bazel_dep(name = "score_bazel_platforms", version = "0.0.2")
bazel_dep(name = "score_docs_as_code", version = "2.2.0")
bazel_dep(name = "score_platform", version = "0.5.0")
bazel_dep(name = "score_baselibs", version = "0.2.2")
bazel_dep(name = "score_baselibs_rust", version = "0.0.1")

# TODO: replace with stable version.
git_override(
module_name = "score_platform",
commit = "9d30b718db22ad335cccbcfd72f96e5b37fa58f1", # obsolete by 0.5.1+
remote = "https://github.com/eclipse-score/score.git",
module_name = "score_baselibs_rust",
commit = "54e2af036603107039a2eca4912413763ab112e7",
remote = "https://github.com/eclipse-score/baselibs_rust.git",
)

bazel_dep(name = "score_bazel_platforms", version = "0.0.2")
bazel_dep(name = "score_docs_as_code", version = "2.2.0")
bazel_dep(name = "score_platform", version = "0.5.0")
bazel_dep(name = "score_process", version = "1.3.2")
bazel_dep(name = "score_python_basics", version = "0.3.4")
bazel_dep(name = "score_tooling", version = "1.0.3")
Expand All @@ -107,6 +110,13 @@ git_override(
remote = "https://github.com/eclipse-score/tooling.git",
)

bazel_dep(name = "score_logging", version = "0.0.3")
git_override(
module_name = "score_logging",
commit = "cd7528ce86c6eb5215a53dbbd3cdc761451e5a4b",
remote = "https://github.com/eclipse-score/logging.git",
)

# ToDo: implicit dependencies for score_tooling, but needed directly here??
bazel_dep(name = "aspect_rules_lint", version = "1.10.2")
bazel_dep(name = "buildifier_prebuilt", version = "8.2.0.2")
Expand Down Expand Up @@ -156,6 +166,22 @@ archive_override(
],
)

# TODO: remove once inherited properly from `score_logging`.
bazel_dep(name = "trlc")
git_override(
module_name = "trlc",
commit = "650b51a47264a4f232b3341f473527710fc32669", # trlc-2.0.2 release
remote = "https://github.com/bmw-software-engineering/trlc.git",
)

# TODO: remove once inherited properly from `score_logging`.
bazel_dep(name = "score_communication", version = "0.1.2")
git_override(
module_name = "score_communication",
commit = "5a70133dd8bd632f5c07f200a5ee4bc9f507c23b",
remote = "https://github.com/eclipse-score/communication.git",
)

Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

we wait with PR until logging is fixed.

# Registers the custom Rust toolchain wired to @qnx_rust
register_toolchains(
"@score_toolchains_rust//toolchains/aarch64-unknown-qnx8_0:toolchain_aarch64_qnx8_0",
Expand Down
1 change: 1 addition & 0 deletions src/rust/rust_kvs/BUILD
Original file line number Diff line number Diff line change
Expand Up @@ -17,6 +17,7 @@ rust_library(
srcs = glob(["src/**/*.rs"]),
visibility = ["//visibility:public"],
deps = [
"@score_baselibs_rust//src/log/mw_log",
"@score_crates//:adler32",
"@score_crates//:tinyjson",
],
Expand Down
1 change: 1 addition & 0 deletions src/rust/rust_kvs/Cargo.toml
Original file line number Diff line number Diff line change
Expand Up @@ -7,6 +7,7 @@ edition.workspace = true
[dependencies]
adler32.workspace = true
tinyjson.workspace = true
mw_log.workspace = true


[dev-dependencies]
Expand Down
11 changes: 6 additions & 5 deletions src/rust/rust_kvs/src/error_code.rs
Original file line number Diff line number Diff line change
Expand Up @@ -11,11 +11,12 @@

extern crate alloc;

use crate::log::{error, ScoreDebug};
use alloc::string::FromUtf8Error;
use core::array::TryFromSliceError;

/// Runtime Error Codes
#[derive(Debug, PartialEq)]
#[derive(Debug, PartialEq, ScoreDebug)]
pub enum ErrorCode {
/// Error that was not yet mapped
UnmappedError,
Expand Down Expand Up @@ -93,7 +94,7 @@ impl From<std::io::Error> for ErrorCode {
match kind {
std::io::ErrorKind::NotFound => ErrorCode::FileNotFound,
_ => {
eprintln!("error: unmapped error: {kind}");
error!("Unmapped IO error: {:?}", kind.to_string());
ErrorCode::UnmappedError
}
}
Expand All @@ -102,21 +103,21 @@ impl From<std::io::Error> for ErrorCode {

impl From<FromUtf8Error> for ErrorCode {
fn from(cause: FromUtf8Error) -> Self {
eprintln!("error: UTF-8 conversion failed: {cause:#?}");
error!("Conversion from UTF-8 failed: {:#?}", cause);
ErrorCode::ConversionFailed
}
}

impl From<TryFromSliceError> for ErrorCode {
fn from(cause: TryFromSliceError) -> Self {
eprintln!("error: try_into from slice failed: {cause:#?}");
error!("Conversion from slice failed: {:#?}", cause);
ErrorCode::ConversionFailed
}
}

impl From<Vec<u8>> for ErrorCode {
fn from(cause: Vec<u8>) -> Self {
eprintln!("error: try_into from u8 vector failed: {cause:#?}");
error!("Conversion from vector of u8 failed: {:#?}", cause);
ErrorCode::ConversionFailed
}
}
Expand Down
Loading
Loading