-
Notifications
You must be signed in to change notification settings - Fork 61
Add baselibs feature request #1098
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Changes from all commits
File filter
Filter by extension
Conversations
Jump to
Diff view
Diff view
There are no files selected for viewing
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,76 @@ | ||
.. | ||
# ******************************************************************************* | ||
# Copyright (c) 2025 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 | ||
# ******************************************************************************* | ||
|
||
Requirements | ||
############ | ||
|
||
.. feat_req:: Core Software Utilities | ||
:id: feat_req__baselibs__core_utilities | ||
:reqtype: Functional | ||
:security: NO | ||
:safety: QM | ||
:satisfies: stkh_req__functional_req__base_libraries | ||
:status: valid | ||
|
||
The base libraries shall include core software utilities and common infrastructure components needed by multiple platform modules. | ||
|
||
.. feat_req:: Safety Relevance | ||
:id: feat_req__baselibs__safety | ||
:reqtype: Functional | ||
:security: NO | ||
:safety: ASIL_B | ||
:satisfies: stkh_req__functional_req__base_libraries | ||
:status: valid | ||
|
||
The base libraries shall implement functionality necessary to support safety-relevant platform components up to ASIL-B. | ||
|
||
.. feat_req:: Multi-Language APIs | ||
:id: feat_req__baselibs__multi_language_apis | ||
:reqtype: Functional | ||
:security: NO | ||
:safety: QM | ||
:satisfies: stkh_req__functional_req__base_libraries, stkh_req__dev_experience__prog_languages | ||
:status: valid | ||
|
||
The base libraries shall provide APIs for C++, Rust, or both, depending on the requirements of consuming platform components. | ||
|
||
.. feat_req:: Consistent APIs | ||
:id: feat_req__baselibs__consistent_apis | ||
:reqtype: Functional | ||
:security: NO | ||
:safety: QM | ||
:satisfies: stkh_req__functional_req__base_libraries, stkh_req__dev_experience__prog_languages, stkh_req__overall_goals__reuse_of_app_soft | ||
:status: valid | ||
|
||
The base libraries shall provide consistent APIs while respecting language-specific idioms. | ||
|
||
.. feat_req:: Maintainable Design | ||
:id: feat_req__baselibs__maintainable_design | ||
:reqtype: Non-Functional | ||
:security: NO | ||
:safety: QM | ||
:satisfies: stkh_req__functional_req__base_libraries, stkh_req__overall_goals__reuse_of_app_soft | ||
:status: valid | ||
|
||
The base libraries shall be designed for maintainability and code reuse. | ||
|
||
.. feat_req:: Security Robustness | ||
:id: feat_req__baselibs__security | ||
:reqtype: Non-Functional | ||
:security: YES | ||
:safety: QM | ||
:satisfies: stkh_req__functional_req__base_libraries | ||
:status: valid | ||
|
||
The base libraries shall adhere to secure coding standards to prevent vulnerabilities across platform components. |
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,147 @@ | ||
.. | ||
# ******************************************************************************* | ||
# Copyright (c) 2025 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 | ||
# ******************************************************************************* | ||
|
||
.. _baselibs_feature: | ||
|
||
Base Libraries | ||
############## | ||
|
||
.. document:: Base Libraries | ||
:id: doc__baselibs | ||
:status: valid | ||
:safety: ASIL_B | ||
:tags: feature_request | ||
|
||
|
||
.. toctree:: | ||
:hidden: | ||
|
||
docs/requirements/index.rst | ||
|
||
|
||
Feature flag | ||
============ | ||
|
||
To activate this feature, use the following feature flag: | ||
|
||
``experimental_baselibs`` | ||
|
||
Abstract | ||
======== | ||
|
||
This feature provides a set of base libraries for both C++ and Rust that can be used by S-CORE | ||
components. | ||
These libraries offer common functionality, ensuring consistent implementations, reducing code | ||
duplication, and promoting interoperability between components. | ||
|
||
The base libraries include utilities for bit manipulation, concurrency management, containers, | ||
JSON processing, filesystem operations, memory handling, OS abstraction, error handling, | ||
serialization, logging, and various other common utilities needed across the S-CORE system. | ||
|
||
Motivation | ||
========== | ||
|
||
Base libraries are essential to ensure consistency, reduce code duplication, and improve quality | ||
across S-CORE components. | ||
|
||
Rationale | ||
========= | ||
|
||
A base library is developed only if it is required by at least two S-CORE components. | ||
This ensures that the effort to create and maintain a base library is justified by real, | ||
shared needs across the platform. | ||
|
||
Each base library may provide an API for Rust, C++, or both, depending on the requirements of | ||
the consuming components. When possible, a library should be implemented once in either Rust | ||
or C++ and provide bindings to the other language to maximize maintainability and consistency. | ||
However, if there are strong technical reasons (such as language-specific performance or safety | ||
requirements), a library may be implemented separately in both Rust and C++. | ||
|
||
Specification | ||
============= | ||
|
||
The base libraries feature consists of the following libraries, all of which are currently implemented in C++: | ||
|
||
- **bitmanipulation**: Utilities for bit manipulation. | ||
- **concurrency**: Provides a generic interface to execute any C++ callable in a parallel context, | ||
supporting various execution strategies (e.g., thread pool, timed execution), thread safety, | ||
interruption handling, and periodic/delayed task execution. | ||
- **containers**: Offers a ``DynamicArray`` (fixed-size array with dynamic construction-time size) | ||
and an intrusive linked list implementation conforming to the | ||
`P0406R1 proposal <https://www.open-std.org/jtc1/sc22/wg21/docs/papers/2016/p0406r1.html>`_. | ||
- **json**: JSON abstraction layer that can switch between different parsers/serializers under the hood. | ||
- **filesystem**: Filesystem manipulation library similar to ``std::filesystem``. | ||
- **futurecpp**: Extends the C++14 Standard Library with features from newer C++ standards up to C++26, | ||
as well as selected proposals for the C++ Standard Library. | ||
- **safecpp/aborts_upon_exception**: Globally prevents creation of exception objects by calling ``std::abort()`` | ||
4og marked this conversation as resolved.
Show resolved
Hide resolved
|
||
immediately. | ||
- **safecpp/coverage_termination_handler**: Helper library to enable collective code coverage information in | ||
GTest death tests. | ||
- **safecpp/safe_math**: Provides safe implementations for arithmetic and related operations for | ||
signed/unsigned integral types and floating point types. | ||
- **safecpp/scoped_function**: Allows developers to consciously limit when an enclosed callable | ||
(function) can be invoked. | ||
- **memory**: Utility library for memory handling, including an abstraction layer for shared memory. | ||
- **os**: OS Abstraction Layer (OSAL) to interface with different POSIX-like operating systems such | ||
as Linux and QNX. | ||
- **result**: Provides a unified approach to error handling without exceptions, conforming to C++23 | ||
``std::expected``. | ||
- **static_reflection_with_serialization**: A header-only library for binary serialization, | ||
deserialization, and compile-time type reflection of heterogenuous C++ data structures with focus | ||
on compile-time safety and efficiency of serialization, as well as efficiency of filtering by | ||
content during deserialization. | ||
- **mw::log**: Logging library. | ||
- **utils**: Provides a collection of small, reusable utilities that do not fit into the other | ||
base libraries. | ||
|
||
Backwards Compatibility | ||
======================= | ||
|
||
As this is a new feature, there are no backwards compatibility concerns. | ||
|
||
Security Impact | ||
=============== | ||
|
||
Base libraries present varying security risks as vulnerabilities could affect multiple components | ||
4og marked this conversation as resolved.
Show resolved
Hide resolved
|
||
simultaneously. | ||
Each library requires individual security impact analysis based on its functionality and usage patterns. | ||
|
||
Safety Impact | ||
============= | ||
|
||
- Due to wide usage of the base libraries throughout the platform, extra care is needed in design, | ||
implementation, and testing to minimize safety impact. | ||
- Libraries are developed at various integrity levels from QM (non-safety) up to ASIL-B, | ||
depending on their intended use cases. | ||
|
||
License Impact | ||
============== | ||
|
||
The base libraries are licensed under Apache License 2.0. | ||
|
||
How to Teach This | ||
================= | ||
|
||
Each library is expected to have a user manual that includes an API reference and usage examples | ||
where necessary. | ||
|
||
Rejected Ideas | ||
============== | ||
|
||
There are no rejected ideas related to the base libraries feature at this time. | ||
|
||
Open Issues | ||
=========== | ||
|
||
There are currently no open issues related to the base libraries feature. |
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -120,6 +120,17 @@ Functional requirements | |
The platform shall support safe computation. | ||
|
||
|
||
.. stkh_req:: Base Libraries | ||
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. I am not sure if we need a stakeholder requirements for this. Do the stakeholders care? I think it is a mere design decision and could be linked to existing stkh_req__quality__assumptions_and_dd. There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. I was not sure about this one. I added this stakeholder requirement for two reasons:
I'm also fine with removing |
||
:id: stkh_req__functional_req__base_libraries | ||
:reqtype: Functional | ||
:security: YES | ||
:safety: ASIL_B | ||
:rationale: Common libraries reduce duplication, improve consistency and quality across components. | ||
:status: valid | ||
|
||
The software platform shall provide a set of base libraries offering common functionality for platform components. | ||
|
||
|
||
.. stkh_req:: Hardware Accelerated Computation | ||
:id: stkh_req__functional_req__hardware_comput | ||
:reqtype: Functional | ||
|
Uh oh!
There was an error while loading. Please reload this page.