Skip to content

Commit a2af2d0

Browse files
committed
Integrate EB corbos Linux for Safety Applications
This uses the ipc_bridge example of communication as example / test.
1 parent e461d64 commit a2af2d0

23 files changed

+1810
-0
lines changed

.devcontainer/devcontainer.json

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,5 @@
1+
{
2+
"name": "eclipse-s-core",
3+
"image": "ghcr.io/eclipse-score/devcontainer:latest",
4+
"postStartCommand": "ssh-keygen -f '/home/vscode/.ssh/known_hosts' -R '[localhost]:2222' || true"
5+
}

ebclfsa/.bazelrc

Lines changed: 10 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,10 @@
1+
common --@score-baselibs//score/mw/log/detail/flags:KUse_Stub_Implementation_Only=False
2+
common --@score-baselibs//score/mw/log/flags:KRemote_Logging=False
3+
common --@score-baselibs//score/json:base_library=nlohmann
4+
common --@communication//score/mw/com/flags:tracing_library=stub
5+
6+
common --registry=https://raw.githubusercontent.com/eclipse-score/bazel_registry/main/
7+
common --registry=https://bcr.bazel.build
8+
9+
common --extra_toolchains=@gcc_toolchain//:aarch64_gcc_13
10+
build:aarch64 --platforms=@score_toolchains_gcc//platforms:aarch64-linux

ebclfsa/BUILD

Lines changed: 13 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,13 @@
1+
# *******************************************************************************
2+
# Copyright (c) 2025 Contributors to the Eclipse Foundation
3+
#
4+
# See the NOTICE file(s) distributed with this work for additional
5+
# information regarding copyright ownership.
6+
#
7+
# This program and the accompanying materials are made available under the
8+
# terms of the Apache License Version 2.0 which is available at
9+
# https://www.apache.org/licenses/LICENSE-2.0
10+
#
11+
# SPDX-License-Identifier: Apache-2.0
12+
13+
# *******************************************************************************

ebclfsa/MODULE.bazel

Lines changed: 83 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,83 @@
1+
# *******************************************************************************
2+
# Copyright (c) 2025 Contributors to the Eclipse Foundation
3+
#
4+
# See the NOTICE file(s) distributed with this work for additional
5+
# information regarding copyright ownership.
6+
#
7+
# This program and the accompanying materials are made available under the
8+
# terms of the Apache License Version 2.0 which is available at
9+
# https://www.apache.org/licenses/LICENSE-2.0
10+
#
11+
# SPDX-License-Identifier: Apache-2.0
12+
# *******************************************************************************
13+
14+
"EB corbos Linux for Safety Applications - S-CORE Reference Integration"
15+
16+
17+
module(
18+
name = "reference_integration_ebclfsa",
19+
version = "0.1",
20+
compatibility_level = 0,
21+
)
22+
23+
24+
bazel_dep(name = "rules_cc", version = "0.2.0")
25+
26+
bazel_dep(name = "score_toolchains_gcc", version = "0.4", dev_dependency=True)
27+
git_override(
28+
module_name = "score_toolchains_gcc",
29+
remote = "https://github.com/Elektrobit/eclipse-score_toolchains_gcc.git",
30+
commit = "fb009e490b9b8f28805d587f50d0bf6d885f3414",
31+
)
32+
gcc = use_extension("@score_toolchains_gcc//extentions:gcc.bzl", "gcc", dev_dependency=True)
33+
gcc.toolchain(
34+
url = "https://linux.elektrobit.com/tmp/score/fastdev-sdk-ubuntu-ebcl-deb-qemu-arm64.tar.xz",
35+
sha256 = "cf8d277a2b95bbdad3e177c488fa77d01723510690a911218ef33747574d78fe",
36+
strip_prefix = "fastdev-sdk-ubuntu-ebcl-deb-qemuarm64",
37+
)
38+
39+
# TODO to be moved to toolchain. https://github.com/eclipse-score/toolchains_gcc/issues/11
40+
gcc.extra_features(
41+
features = [
42+
"minimal_warnings",
43+
"treat_warnings_as_errors",
44+
],
45+
)
46+
gcc.warning_flags(
47+
minimal_warnings = ["-Wall", "-Wno-error=deprecated-declarations"],
48+
strict_warnings = ["-Wextra", "-Wpedantic"],
49+
treat_warnings_as_errors = ["-Werror"],
50+
)
51+
52+
use_repo(gcc, "gcc_toolchain", "gcc_toolchain_gcc")
53+
54+
55+
bazel_dep(name = "rules_boost", repo_name = "com_github_nelhage_rules_boost")
56+
archive_override(
57+
module_name = "rules_boost",
58+
urls = ["https://github.com/nelhage/rules_boost/archive/refs/heads/master.tar.gz"],
59+
strip_prefix = "rules_boost-master",
60+
)
61+
62+
bazel_dep(name = "boost.program_options", version = "1.87.0")
63+
64+
bazel_dep(name = "score-baselibs", version = "0.0.0")
65+
git_override(
66+
module_name = "score-baselibs",
67+
remote = "https://github.com/Elektrobit/eclipse-score_baselibs.git",
68+
commit = "8fad3bceb53dc5d6120cc190b51b8b04a3f8d31f",
69+
)
70+
bazel_dep(name = "communication", version = "0.0.0")
71+
git_override(
72+
module_name = "communication",
73+
remote = "https://github.com/Elektrobit/eclipse-score_communication.git",
74+
commit = "0c6c62b0d3f49a87d66f3dddcac8548f55c9e43e",
75+
)
76+
77+
# TRLC dependency for requirements traceability
78+
bazel_dep(name = "trlc", version = "0.0.0")
79+
git_override(
80+
module_name = "trlc",
81+
remote = "https://github.com/bmw-software-engineering/trlc.git",
82+
commit = "650b51a47264a4f232b3341f473527710fc32669", # trlc-2.0.2 release
83+
)

ebclfsa/example/ipc_bridge/BUILD

Lines changed: 65 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,65 @@
1+
# *******************************************************************************
2+
# Copyright (c) 2025 Contributors to the Eclipse Foundation
3+
#
4+
# See the NOTICE file(s) distributed with this work for additional
5+
# information regarding copyright ownership.
6+
#
7+
# This program and the accompanying materials are made available under the
8+
# terms of the Apache License Version 2.0 which is available at
9+
# https://www.apache.org/licenses/LICENSE-2.0
10+
#
11+
# SPDX-License-Identifier: Apache-2.0
12+
# *******************************************************************************
13+
#load("@score-baselibs//score/language/safecpp:toolchain_features.bzl", "COMPILER_WARNING_FEATURES")
14+
15+
cc_binary(
16+
name = "ipc_bridge_cpp",
17+
srcs = [
18+
"assert_handler.cpp",
19+
"assert_handler.h",
20+
"main.cpp",
21+
],
22+
data = ["etc/mw_com_config.json"],
23+
#features = COMPILER_WARNING_FEATURES,
24+
deps = [
25+
":sample_sender_receiver",
26+
"@communication//score/mw/com",
27+
"@score-baselibs//score/mw/log",
28+
"@score-baselibs//score/language/futurecpp",
29+
"@boost.program_options",
30+
],
31+
visibility = [
32+
"//visibility:public", # platform_only
33+
],
34+
)
35+
36+
cc_library(
37+
name = "sample_sender_receiver",
38+
srcs = [
39+
"sample_sender_receiver.cpp",
40+
],
41+
hdrs = [
42+
"sample_sender_receiver.h",
43+
],
44+
#features = COMPILER_WARNING_FEATURES,
45+
deps = [
46+
":datatype",
47+
"@communication//score/mw/com",
48+
"@score-baselibs//score/mw/log",
49+
],
50+
)
51+
52+
cc_library(
53+
name = "datatype",
54+
srcs = [
55+
"datatype.cpp",
56+
],
57+
hdrs = [
58+
"datatype.h",
59+
],
60+
#features = COMPILER_WARNING_FEATURES,
61+
deps = [
62+
"@communication//score/mw/com",
63+
"@score-baselibs//score/language/futurecpp",
64+
],
65+
)
Lines changed: 69 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,69 @@
1+
/********************************************************************************
2+
* Copyright (c) 2025 Contributors to the Eclipse Foundation
3+
*
4+
* See the NOTICE file(s) distributed with this work for additional
5+
* information regarding copyright ownership.
6+
*
7+
* This program and the accompanying materials are made available under the
8+
* terms of the Apache License Version 2.0 which is available at
9+
* https://www.apache.org/licenses/LICENSE-2.0
10+
*
11+
* SPDX-License-Identifier: Apache-2.0
12+
********************************************************************************/
13+
#include "assert_handler.h"
14+
15+
#include "score/mw/log/logging.h"
16+
17+
#include <score/assert.hpp>
18+
#include <cstdlib>
19+
#include <cstring>
20+
#include <iostream>
21+
#include <thread>
22+
23+
namespace score::mw::com
24+
{
25+
26+
namespace
27+
{
28+
29+
void assert_handler(const score::cpp::handler_parameters& params)
30+
{
31+
std::cerr << "Assertion \"" << params.condition << "\" failed";
32+
if (params.message != nullptr)
33+
{
34+
std::cerr << ": " << params.message;
35+
}
36+
std::cerr << " (" << params.file << ':' << params.line << ")" << std::endl;
37+
std::cerr.flush();
38+
39+
score::mw::log::LogFatal("AsHa") << params.condition << params.message << params.file << params.line;
40+
std::this_thread::sleep_for(std::chrono::milliseconds(500));
41+
42+
const char* const no_abort = std::getenv("ASSERT_NO_CORE");
43+
if (no_abort != nullptr)
44+
{
45+
std::cerr << "Would not coredump on \"" << no_abort << "\"" << std::endl;
46+
if (std::strcmp(no_abort, params.condition) == 0)
47+
{
48+
std::cerr << "... matched." << std::endl;
49+
std::cerr.flush();
50+
std::quick_exit(1);
51+
}
52+
std::cerr << "... not matched." << std::endl;
53+
}
54+
std::cerr.flush();
55+
}
56+
57+
} // namespace
58+
59+
void SetupAssertHandler()
60+
{
61+
score::cpp::set_assertion_handler(assert_handler);
62+
// in addition, delay the calls to std::terminate() till the datarouter is able to read the logs
63+
std::set_terminate([]() {
64+
std::this_thread::sleep_for(std::chrono::milliseconds(500));
65+
std::abort();
66+
});
67+
}
68+
69+
} // namespace score::mw::com
Lines changed: 23 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,23 @@
1+
/********************************************************************************
2+
* Copyright (c) 2025 Contributors to the Eclipse Foundation
3+
*
4+
* See the NOTICE file(s) distributed with this work for additional
5+
* information regarding copyright ownership.
6+
*
7+
* This program and the accompanying materials are made available under the
8+
* terms of the Apache License Version 2.0 which is available at
9+
* https://www.apache.org/licenses/LICENSE-2.0
10+
*
11+
* SPDX-License-Identifier: Apache-2.0
12+
********************************************************************************/
13+
#ifndef SCORE_MW_IPC_BRIDGE_ASSERTHANDLER_H
14+
#define SCORE_MW_IPC_BRIDGE_ASSERTHANDLER_H
15+
16+
namespace score::mw::com
17+
{
18+
19+
void SetupAssertHandler();
20+
21+
} // namespace score::mw::com
22+
23+
#endif // SCORE_MW_IPC_BRIDGE_ASSERTHANDLER_H
Lines changed: 13 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,13 @@
1+
/********************************************************************************
2+
* Copyright (c) 2025 Contributors to the Eclipse Foundation
3+
*
4+
* See the NOTICE file(s) distributed with this work for additional
5+
* information regarding copyright ownership.
6+
*
7+
* This program and the accompanying materials are made available under the
8+
* terms of the Apache License Version 2.0 which is available at
9+
* https://www.apache.org/licenses/LICENSE-2.0
10+
*
11+
* SPDX-License-Identifier: Apache-2.0
12+
********************************************************************************/
13+
#include "datatype.h"

0 commit comments

Comments
 (0)