Skip to content

Commit 7a28c60

Browse files
committed
Merge branch 'main' into ebclfsa_integration_demo
2 parents b286a7d + ff40e5f commit 7a28c60

File tree

451 files changed

+22620
-10422
lines changed

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

451 files changed

+22620
-10422
lines changed

.bazelrc

Lines changed: 25 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -12,19 +12,40 @@
1212
# *******************************************************************************
1313

1414
# use mw/log stub implementation by default
15-
common --@score-baselibs//score/mw/log/detail/flags:KUse_Stub_Implementation_Only=False
16-
common --@score-baselibs//score/mw/log/flags:KRemote_Logging=False
17-
common --@score-baselibs//score/json:base_library=nlohmann
15+
common --@score_baselibs//score/mw/log/detail/flags:KUse_Stub_Implementation_Only=False
16+
common --@score_baselibs//score/mw/log/flags:KRemote_Logging=False
17+
common --@score_baselibs//score/json:base_library=nlohmann
1818
common --//score/mw/com/flags:tracing_library=stub
1919
common --extra_toolchains=@gcc_toolchain//:aarch64_gcc_13
2020
build --incompatible_strict_action_env
21-
test --test_tag_filters=-manual
21+
test --test_output=errors
22+
build --experimental_retain_test_configuration_across_testonly #https://github.com/bazelbuild/bazel/issues/6842
2223

2324
# unshare /dev/shm and /tmp
2425
test --sandbox_tmpfs_path=/dev/shm
2526
test --sandbox_tmpfs_path=/tmp
2627

28+
# Tests require to be run in a sandbox. Otherwise some will be flaky.
29+
test --nosandbox_default_allow_network
30+
2731
build:aarch64 --platforms=@score_toolchains_gcc//platforms:aarch64-linux
2832

2933
common --registry=https://raw.githubusercontent.com/eclipse-score/bazel_registry/refs/heads/main/
3034
common --registry=https://bcr.bazel.build
35+
36+
# With this instrumentation filter for our two main components, we ensure that `bazel coverage //...` is yielding the correct results
37+
coverage --instrumentation_filter="^//score/message_passing[/:],^//score/mw/com[/:],-//score/mw/com/performance_benchmarks[/:],-//score/mw/.*/test[/:]".
38+
coverage --experimental_generate_llvm_lcov
39+
coverage --experimental_use_llvm_covmap
40+
coverage --combined_report=lcov
41+
coverage --coverage_report_generator=@bazel_tools//tools/test/CoverageOutputGenerator/java/com/google/devtools/coverageoutputgenerator:Main
42+
coverage --extra_toolchains=@llvm_toolchain//:cc-toolchain-x86_64-linux
43+
coverage --test_env=COVERAGE_GCOV_OPTIONS=-bcu
44+
# TODO set toolchain feature once possible
45+
# These compile time options are required to cover abnormal termination cases. In GCC one can use `__gcc_dump()`, but this does not work with LLVM
46+
# LLVM provided these compile-time options in combination with a specific profile setting which is enabled in bazel via `LLVM_PROFILE_CONTINUOUS_MODE`
47+
coverage --test_env=LLVM_PROFILE_CONTINUOUS_MODE=1
48+
coverage --cxxopt -mllvm
49+
coverage --cxxopt -runtime-counter-relocation
50+
51+
import quality/sanitizer/sanitizer.bazelrc

.clang-format

Lines changed: 50 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,50 @@
1+
---
2+
BasedOnStyle: Google
3+
AccessModifierOffset: -2
4+
AllowAllParametersOfDeclarationOnNextLine: false
5+
AllowShortBlocksOnASingleLine: Empty
6+
AllowShortCaseLabelsOnASingleLine: false
7+
AllowShortEnumsOnASingleLine: false
8+
# Empty is required in AllowShortFunctionsOnASingleLine over Inline because Inline contradicts with AUTOSAR rule A7-1-7
9+
# Such rule is no longer existing in MISRA C++:2023, once we are fully migrated to MISRA C++:2023, switching to Inline
10+
# could be reconsidered
11+
AllowShortFunctionsOnASingleLine: Empty
12+
AllowShortIfStatementsOnASingleLine: Never
13+
AllowShortLambdasOnASingleLine: Empty
14+
AllowShortLoopsOnASingleLine: false
15+
BinPackArguments: false
16+
BinPackParameters: false
17+
BraceWrapping:
18+
AfterCaseLabel: true
19+
AfterClass: true
20+
AfterControlStatement: Always
21+
AfterEnum: true
22+
AfterFunction: true
23+
AfterNamespace: true
24+
AfterObjCDeclaration: true
25+
AfterStruct: true
26+
AfterUnion: true
27+
BeforeCatch: true
28+
BeforeElse: true
29+
IndentBraces: false
30+
BreakBeforeBraces: Custom
31+
ColumnLimit: 120
32+
DerivePointerAlignment: false
33+
IncludeBlocks: Preserve
34+
IncludeCategories:
35+
- Regex: '^(<|")(assert|complex|ctype|errno|fenv|float|inttypes|iso646|limits|locale|math|setjmp|signal|stdalign|stdargh|stdatomic|stdbool|stddef|stdint|stdio|stdlib|stdnoreturn|string|tgmath|threads|time|uchar|wchar|wctype)\.h(>|")$'
36+
Priority: 2
37+
- Regex: '^(<|")(cstdlib|csignal|csetjmp|cstdarg|typeinfo|typeindex|type_traits|bitset|functional|utility|ctime|chrono|cstddef|initializer_list|tuple|any|optional|variant|new|memory|scoped_allocator|memory_resource|climits|cfloat|cstdint|cinttypes|limits|exception|stdexcept|cassert|system_error|cerrno|cctype|cwctype|cstring|cwchar|cuchar|string|string_view|array|vector|deque|list|forward_list|set|map|unordered_set|unordered_map|stack|queue|algorithm|execution|teratorslibrary|iterator|cmath|complex|valarray|random|numeric|ratio|cfenv|iosfwd|ios|istream|ostream|iostream|fstream|sstream|strstream|iomanip|streambuf|cstdio|locale|clocale|codecvt|regex|atomic|thread|mutex|shared_mutex|future|condition_variable|filesystem|ciso646|ccomplex|ctgmath|cstdalign|cstdbool)(>|")$'
38+
Priority: 3
39+
- Regex: '^(<|").*(>|")$'
40+
Priority: 1
41+
IndentWidth: 4
42+
InsertNewlineAtEOF: true
43+
KeepEmptyLinesAtTheStartOfBlocks: true
44+
QualifierAlignment: Left
45+
CommentPragmas: '^.*A2Lfactory:'
46+
---
47+
# Make sure language specific settings are below the generic settings to be compatible to all languages.
48+
Language: Cpp
49+
Standard: c++17
50+
...

.devcontainer/alt_container_docker_on_windows/devcontainer.json

Lines changed: 0 additions & 5 deletions
This file was deleted.

.devcontainer/devcontainer.json

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

.github/workflows/build_and_test_host_gcc.yml

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -22,7 +22,8 @@ on:
2222
types: [checks_requested]
2323
jobs:
2424
build_and_test_gcc_host_gcc12:
25-
runs-on: ubuntu-24.04
25+
# Starting with Ubuntu 24.04 apparmor breaks Bazels linux-sandbox: https://github.com/bazelbuild/bazel/issues/24081
26+
runs-on: ubuntu-22.04
2627
steps:
2728
- uses: bazel-contrib/[email protected]
2829
with:

.gitignore

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,7 @@
11
bazel-*
22
MODULE.bazel.lock
33
user.bazelrc
4+
.clwb_aspects
45

56
# Compilation databases for code completion in IDEs
67
.cache/*

BUILD

Lines changed: 20 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -10,3 +10,23 @@
1010
#
1111
# SPDX-License-Identifier: Apache-2.0
1212
# *******************************************************************************
13+
14+
load("@aspect_rules_lint//format:defs.bzl", "format_multirun", "format_test")
15+
16+
exports_files([
17+
"wait_free_stack_fix.patch",
18+
])
19+
20+
format_multirun(
21+
name = "format",
22+
cc = "@clang_format//:executable",
23+
starlark = "@buildifier_prebuilt//:buildifier",
24+
)
25+
26+
format_test(
27+
name = "format_test",
28+
cc = "@clang_format//:executable",
29+
no_sandbox = True,
30+
starlark = "@buildifier_prebuilt//:buildifier",
31+
workspace = "//:LICENSE",
32+
)

MODULE.bazel

Lines changed: 102 additions & 31 deletions
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,5 @@
11
# *******************************************************************************
2-
# Copyright (c) 2024 Contributors to the Eclipse Foundation
2+
# Copyright (c) 2024-2025 Contributors to the Eclipse Foundation
33
#
44
# See the NOTICE file(s) distributed with this work for additional
55
# information regarding copyright ownership.
@@ -12,7 +12,6 @@
1212
# *******************************************************************************
1313
module(name = "communication")
1414

15-
1615
bazel_dep(name = "platforms", version = "0.0.11")
1716
bazel_dep(name = "score_toolchains_gcc", version = "0.4", dev_dependency=True)
1817
git_override(
@@ -21,7 +20,11 @@ git_override(
2120
commit = "fb009e490b9b8f28805d587f50d0bf6d885f3414",
2221
)
2322

24-
gcc = use_extension("@score_toolchains_gcc//extentions:gcc.bzl", "gcc", dev_dependency=True)
23+
gcc = use_extension(
24+
"@score_toolchains_gcc//extentions:gcc.bzl",
25+
"gcc",
26+
dev_dependency = True,
27+
)
2528
gcc.toolchain(
2629
url = "https://linux.elektrobit.com/tmp/score/fastdev-sdk-ubuntu-ebcl-deb-qemu-arm64.tar.xz",
2730
sha256 = "cf8d277a2b95bbdad3e177c488fa77d01723510690a911218ef33747574d78fe",
@@ -36,66 +39,134 @@ gcc.extra_features(
3639
],
3740
)
3841
gcc.warning_flags(
39-
minimal_warnings = ["-Wall", "-Wno-error=deprecated-declarations"],
40-
strict_warnings = ["-Wextra", "-Wpedantic"],
42+
minimal_warnings = [
43+
"-Wall",
44+
"-Wno-error=deprecated-declarations",
45+
],
46+
strict_warnings = [
47+
"-Wextra",
48+
"-Wpedantic",
49+
],
4150
treat_warnings_as_errors = ["-Werror"],
4251
)
43-
4452
use_repo(gcc, "gcc_toolchain", "gcc_toolchain_gcc")
4553

46-
bazel_dep(name = "googletest", version = "1.15.0")
47-
bazel_dep(name = "google_benchmark", version = "1.9.1")
48-
49-
bazel_dep(name = "rules_rust", version = "0.61.0")
50-
51-
crate = use_extension("@rules_rust//crate_universe:extensions.bzl", "crate")
54+
bazel_dep(name = "toolchains_llvm", version = "1.5.0", dev_dependency = True)
5255

53-
crate.spec(package = "futures", version = "0.3.31")
54-
crate.spec(package = "libc", version = "0.2.155")
55-
crate.spec(package = "clap", version = "4.5.4", features = ["derive"])
56+
llvm = use_extension(
57+
"@toolchains_llvm//toolchain/extensions:llvm.bzl",
58+
"llvm",
59+
dev_dependency = True,
60+
)
61+
llvm.toolchain(
62+
compile_flags = {"": [
63+
"-march=nehalem",
64+
"-ffp-model=strict",
65+
# Security
66+
"-U_FORTIFY_SOURCE", # https://github.com/google/sanitizers/issues/247
67+
"-fstack-protector",
68+
"-fno-omit-frame-pointer",
69+
# Diagnostics
70+
"-fcolor-diagnostics",
71+
"-Wno-deprecated-declarations",
72+
"-Wno-error=self-assign-overloaded",
73+
"-Wthread-safety",
74+
]},
75+
cxx_standard = {"": "c++17"},
76+
link_libs = {"": [
77+
"-lrt",
78+
]},
79+
llvm_version = "16.0.0",
80+
stdlib = {"": "dynamic-stdc++"},
81+
)
82+
use_repo(llvm, "llvm_toolchain")
5683

57-
crate.from_specs(name = "crate_index")
58-
use_repo(crate, "crate_index")
84+
# We use here a pre-compiled fully static and hermetic clang_format binary
85+
# and not the one provided by llvm_toolchain, because the one from llvm_toolchain is not fully hermetic (and different version for now)
86+
download_file = use_repo_rule("@download_utils//download/file:defs.bzl", "download_file")
5987

60-
bazel_dep(name = "rules_boost", repo_name = "com_github_nelhage_rules_boost")
61-
archive_override(
62-
module_name = "rules_boost",
63-
urls = ["https://github.com/nelhage/rules_boost/archive/refs/heads/master.tar.gz"],
64-
strip_prefix = "rules_boost-master",
88+
download_file(
89+
name = "clang_format",
90+
executable = True,
91+
output = "executable",
92+
urls = ["https://github.com/muttleyxd/clang-tools-static-binaries/releases/download/master-2da3e7b/clang-format-19_linux-amd64"],
6593
)
66-
bazel_dep(name = "boost.program_options", version = "1.87.0")
67-
6894

95+
bazel_dep(name = "aspect_rules_lint", version = "1.10.2")
96+
bazel_dep(name = "googletest", version = "1.15.0")
97+
bazel_dep(name = "google_benchmark", version = "1.9.1")
98+
bazel_dep(name = "rules_rust", version = "0.61.0")
99+
bazel_dep(name = "buildifier_prebuilt", version = "6.3.3")
100+
bazel_dep(name = "score_crates", version = "0.0.2", repo_name = "crate_index")
101+
bazel_dep(name = "boost.program_options", version = "1.87.0")
69102
bazel_dep(name = "download_utils", version = "1.0.1")
103+
70104
download_archive = use_repo_rule("@download_utils//download/archive:defs.bzl", "download_archive")
105+
71106
download_archive(
72107
name = "json_schema_validator",
73-
urls = ["https://github.com/pboettch/json-schema-validator/archive/refs/tags/2.1.0.tar.gz"],
74108
build = "//third_party/json_schema_validator:json_schema_validator.BUILD",
75109
strip_prefix = "json-schema-validator-2.1.0",
110+
urls = ["https://github.com/pboettch/json-schema-validator/archive/refs/tags/2.1.0.tar.gz"],
111+
)
112+
113+
download_archive(
114+
name = "jsonschema",
115+
build = "//third_party/jsonschema:jsonschema.BUILD",
116+
strip_prefix = "jsonschema-4.23.0",
117+
urls = ["https://github.com/python-jsonschema/jsonschema/archive/refs/tags/v4.23.0.tar.gz"],
76118
)
77119

78120
bazel_dep(name = "nlohmann_json", version = "3.11.3")
79121
bazel_dep(name = "bazel_skylib", version = "1.7.1")
80-
81-
bazel_dep(name = "score-baselibs", version = "0.0.0")
122+
bazel_dep(name = "rules_doxygen", version = "2.5.0")
123+
bazel_dep(name = "score_baselibs", version = "0.2.0")
82124
git_override(
83-
module_name = "score-baselibs",
125+
module_name = "score_baselibs",
126+
commit = "e9dc2036cbdee3dce0ce51543eb34ea405326f7c",
127+
patch_strip = 1,
128+
patches = [
129+
"//:wait_free_stack_fix.patch",
130+
],
84131
remote = "https://github.com/Elektrobit/eclipse-score_baselibs.git",
85-
commit = "8fad3bceb53dc5d6120cc190b51b8b04a3f8d31f",
86132
)
87133

88-
# Python 3.12 toolchain for Bazel
134+
# Doxygen extension for documentation generation
135+
doxygen_extension = use_extension("@rules_doxygen//:extensions.bzl", "doxygen_extension")
136+
use_repo(doxygen_extension, "doxygen")
137+
138+
# Python 3.12 toolchain for Bazel (required for LOBSTER/TRLC dependencies)
89139
bazel_dep(name = "rules_python", version = "0.32.0")
140+
90141
python = use_extension("@rules_python//python/extensions:python.bzl", "python")
91142
python.toolchain(
92143
python_version = "3.12",
93144
)
94145

146+
# Python pip dependencies for traceability tools
147+
pip = use_extension("@rules_python//python/extensions:pip.bzl", "pip")
148+
pip.parse(
149+
hub_name = "communication_pip",
150+
python_version = "3.12",
151+
requirements_lock = "//third_party/python:requirements.txt",
152+
)
153+
use_repo(pip, "communication_pip")
154+
95155
# TRLC dependency for requirements traceability
96156
bazel_dep(name = "trlc", version = "0.0.0")
97157
git_override(
98158
module_name = "trlc",
99-
remote = "https://github.com/bmw-software-engineering/trlc.git",
100159
commit = "650b51a47264a4f232b3341f473527710fc32669", # trlc-2.0.2 release
160+
remote = "https://github.com/bmw-software-engineering/trlc.git",
161+
)
162+
163+
lobster_ext = use_extension("//third_party/lobster:lobster.bzl", "lobster_ext")
164+
use_repo(lobster_ext, "lobster")
165+
166+
# Use lobster's upstream requirements.txt directly for this module's Python hub
167+
pip.parse(
168+
hub_name = "lobster_dependencies",
169+
python_version = "3.12",
170+
requirements_lock = "@lobster//:requirements.txt",
101171
)
172+
use_repo(pip, "lobster_dependencies")

0 commit comments

Comments
 (0)