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
7 changes: 7 additions & 0 deletions .bazelrc
Original file line number Diff line number Diff line change
Expand Up @@ -82,3 +82,10 @@ import %workspace%/quality/static_analysis/static_analysis.bazelrc

# Use native sphinx_build_binary instead of the wrapper
build --//docs/sphinx/utils:use_native_sphinx_build

# Configure system JDK for plantuml
build --java_language_version=21
build --tool_java_language_version=21
build --java_runtime_version=remotejdk_21
build --tool_java_runtime_version=remotejdk_21

10 changes: 8 additions & 2 deletions .gitignore
Original file line number Diff line number Diff line change
Expand Up @@ -2,15 +2,21 @@ bazel-*
examples/bazel-*
MODULE.bazel.lock
user.bazelrc
.clwb_aspects
.clwb
_build

# ignore folders created by IDEs
.vscode
.idea
.clwb_aspects
.clwb

# Ignore clangd's config
.clangd

# Compilation databases for code completion in IDEs
.cache/*
compile_commands.json
rust-project.json

# docs-as-code
docs/ubproject.toml
2 changes: 1 addition & 1 deletion MODULE.bazel
Original file line number Diff line number Diff line change
Expand Up @@ -40,7 +40,7 @@ download_archive(
bazel_dep(name = "score_tooling")
git_override(
module_name = "score_tooling",
commit = "0160d13fff81ee20643769339036505b853e2bb0",
commit = "bc5233fc59242fa1bbc17e9d37edf043931f87bb",
remote = "https://github.com/eclipse-score/tooling.git",
)
Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

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

you will need to adapt the example folder as well, for this to work when you remove the dev dependency.


Expand Down
5 changes: 4 additions & 1 deletion bazel/toolchains/BUILD
Original file line number Diff line number Diff line change
Expand Up @@ -9,7 +9,9 @@ load(
py_binary(
name = "sphinx_build",
srcs = ["@score_tooling//bazel/rules/rules_score:src/sphinx_wrapper.py"],
data = [],
data = [
"@score_tooling//tools/sphinx:plantuml",
],
main = "@score_tooling//bazel/rules/rules_score:src/sphinx_wrapper.py",
visibility = ["//:__subpackages__"],
deps = [
Expand All @@ -21,6 +23,7 @@ py_binary(
"//third_party/sphinx:sphinx-needs",
"//third_party/sphinx:sphinxcontrib-plantuml",
"//third_party/sphinx_rtd_theme",
"@rules_python//python/runfiles",
"@score_tooling//bazel/rules/rules_score:bazel_sphinx_needs",
"@score_tooling//bazel/rules/rules_score:sphinx_module_ext",
"@score_tooling//plantuml/sphinx/clickable_plantuml",
Expand Down
35 changes: 34 additions & 1 deletion bazel/toolchains/template/conf.template.py
Original file line number Diff line number Diff line change
Expand Up @@ -20,6 +20,14 @@

import bazel_sphinx_needs

from pathlib import Path
import os

from python.runfiles import Runfiles
from sphinx.util import logging

logger = logging.getLogger(__name__)

# Project configuration - {PROJECT_NAME} will be replaced by the module name during build
project = "{PROJECT_NAME}"
author = "S-CORE"
Expand Down Expand Up @@ -113,7 +121,32 @@
needs_external_needs = bazel_sphinx_needs.load_external_needs()
bazel_sphinx_needs.log_config_info(project)

# Resolve the PlantUML binary via Bazel runfiles.
# The plantuml java_binary target is in data of the local sphinx_build binary
# (//bazel/toolchains:sphinx_build), so it is accessible under the _main repo.
r = Runfiles.Create()
if r is None:
raise ValueError("Could not initialize Bazel runfiles.")

_plantuml_path = None
# Use source_repo="" (the root module's canonical source repo key in repo_mapping)
# so Bazel resolves the apparent name "score_tooling" to the correct canonical
# name regardless of how the dep is declared (local_path_override → "score_tooling+",
# BCR/git_repository → "score_tooling").
_candidate = r.Rlocation("score_tooling/tools/sphinx/plantuml", source_repo="")
if _candidate and Path(_candidate).exists():
_plantuml_path = Path(_candidate)
logger.info(f"PlantUML resolved from runfiles: {_plantuml_path}")

if _plantuml_path is None:
logger.warning(
"PlantUML binary not found in runfiles — diagrams will not be rendered. "
"Ensure @score_tooling//tools/sphinx:plantuml is in sphinx_build data."
)
else:
plantuml = str(_plantuml_path)
plantuml_output_format = "svg_obj"


def setup(app):
return bazel_sphinx_needs.setup_sphinx_extension(app, needs_external_needs)

2 changes: 2 additions & 0 deletions docs/sphinx/BUILD
Original file line number Diff line number Diff line change
Expand Up @@ -49,6 +49,7 @@ filter_execpath(
# Build Sphinx documentation
sphinx_module(
name = "sphinx_doc",
testonly = True,
srcs =
[
"how_to_document.rst",
Expand All @@ -73,5 +74,6 @@ sphinx_module(
index = "index.rst",
visibility = ["//visibility:public"],
deps = [
"//score/message_passing/dependability:dependable_element_message_passing_doc",
],
)
3 changes: 2 additions & 1 deletion docs/sphinx/safety_reports.rst
Original file line number Diff line number Diff line change
Expand Up @@ -9,5 +9,6 @@ Safety documentation reports

* - Report
- Description
... Add references to safety reports in the style of <safety_software_seooc_example_doc/index.html>
* - `Message Passing Dependable Element <dependable_element_message_passing_doc/index.html>`_
- Message Passing

52 changes: 51 additions & 1 deletion score/message_passing/BUILD
Original file line number Diff line number Diff line change
Expand Up @@ -14,6 +14,7 @@
load("@rules_cc//cc:defs.bzl", "cc_library")
load("@score_baselibs//:bazel/unit_tests.bzl", "cc_gtest_unit_test")
load("@score_baselibs//third_party/itf:py_unittest_qnx_test.bzl", "py_unittest_qnx_test")
load("@score_tooling//bazel/rules/rules_score:rules_score.bzl", "unit")

py_unittest_qnx_test(
name = "unit_tests_qnx",
Expand Down Expand Up @@ -41,7 +42,10 @@ test_suite(
"@score_communication//score/message_passing/log:unit_test_suite_host",
"@score_communication//score/message_passing/non_allocating_future:unit_test_suite_host",
],
visibility = ["//score/message_passing:__pkg__"],
visibility = [
"//score/message_passing:__pkg__",
"//score/message_passing/dependability:__pkg__",
],
)

cc_library(
Expand Down Expand Up @@ -124,6 +128,21 @@ cc_library(
],
)

unit(
name = "client_connection",
scope = [
":message_passing_common",
],
tests = [
"//score/message_passing:client_connection_test",
],
unit_design = ["//score/message_passing/dependability/software_unit_design:client_connection_unit_design"],
visibility = ["//score/message_passing/dependability:__pkg__"],
implementation = [
"//score/message_passing:message_passing_common",
],
)

cc_library(
name = "message_passing_unix_domain",
srcs = [
Expand Down Expand Up @@ -157,6 +176,21 @@ cc_library(
],
)

unit(
name = "unix_domain",
scope = [
":message_passing_unix_domain",
],
tests = [
":unix_domain_test",
],
unit_design = ["//score/message_passing/dependability/software_unit_design:unix_domain_unit_design"],
visibility = ["//score/message_passing/dependability:__pkg__"],
implementation = [
":message_passing_unix_domain",
],
)

cc_library(
name = "qnx_resource_path",
srcs = [
Expand Down Expand Up @@ -214,6 +248,21 @@ cc_library(
],
)

unit(
name = "qnx_dispatch",
scope = [
"//score/message_passing:message_passing_qnx_dispatch",
],
tests = [
":qnx_dispatch_test",
],
unit_design = ["//score/message_passing/dependability/software_unit_design:qnx_dispatch_unit_design"],
visibility = ["//score/message_passing/dependability:__pkg__"],
implementation = [
":message_passing_qnx_dispatch",
],
)

cc_library(
name = "mock",
testonly = True,
Expand Down Expand Up @@ -283,6 +332,7 @@ cc_gtest_unit_test(
"resource_manager_fixture_base.h",
],
target_compatible_with = ["@platforms//os:qnx"],
visibility = ["//score/message_passing/dependability:__pkg__"],
deps = [
":message_passing_qnx_dispatch",
"@score_baselibs//score/concurrency",
Expand Down
1 change: 1 addition & 0 deletions score/message_passing/client_connection_test.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -332,6 +332,7 @@ class ClientConnectionTest : public ::testing::Test

TEST_F(ClientConnectionTest, Constructed)
{
::testing::Test::RecordProperty("lobster-tracing", "MessagePassingComponent.REQ_MP_COMP_001");
detail::ClientConnection connection(engine_, protocol_config_, client_config_);
EXPECT_EQ(connection.GetState(), State::kStopped);
EXPECT_EQ(connection.GetStopReason(), StopReason::kInit);
Expand Down
82 changes: 82 additions & 0 deletions score/message_passing/dependability/BUILD
Original file line number Diff line number Diff line change
@@ -0,0 +1,82 @@
# *******************************************************************************
# Copyright (c) 2026 Contributors to the Eclipse Foundation
#
# 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
#
# SPDX-License-Identifier: Apache-2.0
# *******************************************************************************

load(
"@score_tooling//bazel/rules/rules_score:rules_score.bzl",
"component",
"dependable_element",
)

component(
name = "component_message_passing",
components = [
":client",
":server",
],
requirements = [
"//score/message_passing/dependability/requirements:component_requirements",
],
tags = ["manual"],
tests = [],
)

# Component: client
# Covers the client-side connection management and common messaging infrastructure
component(
name = "client",
components = [
"//score/message_passing:client_connection",
],
requirements = [
"//score/message_passing/dependability/requirements:component_requirements",
],
tags = ["manual"],
tests = [],
)

# Component: server
# Covers the platform-specific server implementations (QNX dispatch and Unix domain)
component(
name = "server",
components = select({
"@platforms//os:qnx": [
"//score/message_passing:qnx_dispatch",
"//score/message_passing:unix_domain",
],
"//conditions:default": ["//score/message_passing:unix_domain"],
}),
requirements = [
"//score/message_passing/dependability/requirements:component_requirements",
],
tags = ["manual"],
tests = [],
)

dependable_element(
name = "dependable_element_message_passing",
architectural_design = ["//score/message_passing/dependability/software_architectural_design:message_passing_architectural_design"],
assumptions_of_use = ["//score/message_passing/dependability/assumed_system:aous"],
components = [":component_message_passing"],
dependability_analysis = ["//score/message_passing/dependability/safety_analysis:message_passing_dependability_analysis"],
integrity_level = "B",
maturity = "development",
requirements = [
"//score/message_passing/dependability/requirements:feature_requirements",
"//score/message_passing/dependability/assumed_system:assumed_system_requirements",
],
tags = ["manual"],
tests = [
"//score/message_passing:unit_tests",
],
visibility = ["//visibility:public"],
)
42 changes: 42 additions & 0 deletions score/message_passing/dependability/assumed_system/BUILD
Original file line number Diff line number Diff line change
@@ -0,0 +1,42 @@
# *******************************************************************************
# Copyright (c) 2026 Contributors to the Eclipse Foundation
#
# 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
#
# SPDX-License-Identifier: Apache-2.0
# *******************************************************************************

load(
"@score_tooling//bazel/rules/rules_score:rules_score.bzl",
"assumed_system_requirements",
"assumptions_of_use",
)
load("@trlc//:trlc.bzl", "trlc_requirements")

trlc_requirements(
name = "aous_trlc",
srcs = [
"aous.trlc",
],
spec = [
"@score_tooling//bazel/rules/rules_score/trlc/config:score_requirements_model",
],
visibility = ["//score/message_passing/dependability:__subpackages__"],
)

assumptions_of_use(
name = "aous",
srcs = [":aous_trlc"],
visibility = ["//score/message_passing/dependability:__subpackages__"],
)

assumed_system_requirements(
name = "assumed_system_requirements",
srcs = ["assumed_system_requirements.trlc"],
visibility = ["//score/message_passing/dependability:__subpackages__"],
)
27 changes: 27 additions & 0 deletions score/message_passing/dependability/assumed_system/aous.trlc
Original file line number Diff line number Diff line change
@@ -0,0 +1,27 @@
/********************************************************************************
* Copyright (c) 2026 Contributors to the Eclipse Foundation
*
* 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
*
* SPDX-License-Identifier: Apache-2.0
********************************************************************************/
package MessagePassing

import ScoreReq

// TODO: Add Assumptions of Use (AoU) for message passing
// Example:

ScoreReq.AoU ExampleAoU {
description = "Example assumption description"
safety = ScoreReq.Asil.B
note = "Example note"
version = 1
mitigates = "FailureModeName"
}

Loading
Loading