diff --git a/.bazelrc b/.bazelrc index 80cfd77a93..48b177fec6 100644 --- a/.bazelrc +++ b/.bazelrc @@ -4,7 +4,7 @@ # common --registry=https://raw.githubusercontent.com/eclipse-score/bazel_registry/main/ common --registry=https://bcr.bazel.build -common --credential_helper=*.qnx.com=%workspace%/scripts/qnx_credential_helper.py +common --credential_helper=*.qnx.com=%workspace%/.github/tools/qnx_credential_helper.py common --credential_helper_timeout="60s" # Java @@ -13,7 +13,6 @@ build --tool_java_language_version=17 build --java_runtime_version=remotejdk_17 build --tool_java_runtime_version=remotejdk_17 -build:_common --@score_baselibs//score/mw/log/detail/flags:KUse_Stub_Implementation_Only=False build:_common --@score_baselibs//score/mw/log/flags:KRemote_Logging=False build:_common --@score_baselibs//score/json:base_library=nlohmann build:_common --@score_baselibs//score/memory/shared/flags:use_typedshmd=False @@ -60,6 +59,7 @@ build:autosd-x86_64 --extra_toolchains=@rules_rpm//toolchains:linux_x86_64 test:unit-tests --config=linux-x86_64 test:unit-tests --build_tests_only +test:unit-tests --test_tag_filters=-manual # Coverage configuration for C++ coverage --features=coverage diff --git a/.github/workflows/build_and_test_autosd.yml b/.github/workflows/build_and_test_autosd.yml index f642827587..445c628f24 100644 --- a/.github/workflows/build_and_test_autosd.yml +++ b/.github/workflows/build_and_test_autosd.yml @@ -30,6 +30,9 @@ jobs: runs-on: ubuntu-latest steps: + - name: Clean disk space + uses: eclipse-score/more-disk-space@v1 + - name: Checkout repository uses: actions/checkout@v4 diff --git a/.github/workflows/build_and_test_ebclfsa.yml b/.github/workflows/build_and_test_ebclfsa.yml index 88a7f662e8..c84d186282 100644 --- a/.github/workflows/build_and_test_ebclfsa.yml +++ b/.github/workflows/build_and_test_ebclfsa.yml @@ -30,6 +30,9 @@ jobs: image: ghcr.io/eclipse-score/devcontainer:v1.1.0 steps: + - name: Clean disk space + uses: eclipse-score/more-disk-space@v1 + - name: Checkout repository uses: actions/checkout@v4 diff --git a/.github/workflows/build_and_test_linux.yml b/.github/workflows/build_and_test_linux.yml index 317deb7d84..09c9802112 100644 --- a/.github/workflows/build_and_test_linux.yml +++ b/.github/workflows/build_and_test_linux.yml @@ -27,25 +27,8 @@ jobs: contents: write # required to upload release assets steps: - - name: Show disk space before build - run: | - echo 'Disk space before build:' - df -h - - - name: Removing unneeded software - run: | - echo "Removing unneeded software... " - if [ -d /usr/share/dotnet ]; then echo "Removing dotnet..."; start=$(date +%s); sudo rm -rf /usr/share/dotnet; end=$(date +%s); echo "Duration: $((end-start))s"; fi - #if [ -d /usr/local/lib/android ]; then echo "Removing android..."; start=$(date +%s); sudo rm -rf /usr/local/lib/android; end=$(date +%s); echo "Duration: $((end-start))s"; fi - if [ -d /opt/ghc ]; then echo "Removing haskell (ghc)..."; start=$(date +%s); sudo rm -rf /opt/ghc; end=$(date +%s); echo "Duration: $((end-start))s"; fi - if [ -d /usr/local/.ghcup ]; then echo "Removing haskell (ghcup)..."; start=$(date +%s); sudo rm -rf /usr/local/.ghcup; end=$(date +%s); echo "Duration: $((end-start))s"; fi - if [ -d /usr/share/swift ]; then echo "Removing swift..."; start=$(date +%s); sudo rm -rf /usr/share/swift; end=$(date +%s); echo "Duration: $((end-start))s"; fi - if [ -d /usr/local/share/chromium ]; then echo "Removing chromium..."; start=$(date +%s); sudo rm -rf /usr/local/share/chromium; end=$(date +%s); echo "Duration: $((end-start))s"; fi - - - name: Show disk space after cleanup - run: | - echo 'Disk space after cleanup:' - df -h + - name: Clean disk space + uses: eclipse-score/more-disk-space@v1 - name: Checkout repository uses: actions/checkout@v4.2.2 diff --git a/.github/workflows/test_and_docs.yml b/.github/workflows/test_and_docs.yml index 536b01f371..366339ce7e 100644 --- a/.github/workflows/test_and_docs.yml +++ b/.github/workflows/test_and_docs.yml @@ -209,4 +209,4 @@ jobs: uses: eclipse-score/cicd-workflows/.github/actions/deploy-versioned-pages@main with: source_folder: extracted_docs/_build - deployment_type: ${{ inputs.deployment_type }} + deployment_type: workflow diff --git a/bazel_common/score_modules_target_sw.MODULE.bazel b/bazel_common/score_modules_target_sw.MODULE.bazel index f55d192e31..61f88f087d 100644 --- a/bazel_common/score_modules_target_sw.MODULE.bazel +++ b/bazel_common/score_modules_target_sw.MODULE.bazel @@ -15,13 +15,12 @@ # Do not edit manually - use scripts/known_good/update_module_from_known_good.py bazel_dep(name = "score_baselibs") -single_version_override( +git_override( module_name = "score_baselibs", - version = "0.1.3", + remote = "https://github.com/eclipse-score/baselibs.git", + commit = "158fe6a7b791c58f6eac5f7e4662b8db0cf9ac6e", patches = [ "//patches/baselibs:003-acl-fixes-for-aarch64.patch", - "//patches/baselibs:0001-RH-exception-header.patch", - "//patches/baselibs:0002-RH-algorithm-header.patch", ], patch_strip = 1, ) @@ -30,46 +29,51 @@ bazel_dep(name = "score_baselibs_rust") git_override( module_name = "score_baselibs_rust", remote = "https://github.com/eclipse-score/baselibs_rust.git", - commit = "0eba2934fa8b0e1a343ec6bf6f7ff00cec27d81c", + commit = "9f781acfb6d1a8fa06012ce772b0befb304acf31", ) bazel_dep(name = "score_communication") -single_version_override( +git_override( module_name = "score_communication", - version = "0.1.1", + remote = "https://github.com/eclipse-score/communication.git", + commit = "56448a5589a5f7d3921b873e8127b824a8c1ca95", + patches = [ + "//patches/communication:001-expose-comm-examples.patch", + ], + patch_strip = 1, ) bazel_dep(name = "score_persistency") git_override( module_name = "score_persistency", remote = "https://github.com/eclipse-score/persistency.git", - commit = "0037034bf853e5f955f028fab54ed319fb0441c3", + commit = "9692dadab51c677183262e8870c5425ab1797c4f", ) bazel_dep(name = "score_orchestrator") git_override( module_name = "score_orchestrator", remote = "https://github.com/eclipse-score/orchestrator.git", - commit = "18e136c34750c5db707f27f917d52efc7541e087", + commit = "675007a2baa226fad1e2979ed732360dc111d056", ) bazel_dep(name = "score_kyron") git_override( module_name = "score_kyron", remote = "https://github.com/eclipse-score/kyron.git", - commit = "ed312bdc6a50abc73f97b8c7e2ad4726fed06e81", + commit = "d4d0afc1dd733a0c8a4aba9cc2b2b3a58d38ebf6", ) bazel_dep(name = "score_lifecycle_health") git_override( module_name = "score_lifecycle_health", remote = "https://github.com/eclipse-score/lifecycle.git", - commit = "84303c2e48c7e8e2481752170efe82d0afd45f1e", + commit = "14ee704eeac03e03ca10bece5de8b694d3c5e2dd", ) -bazel_dep(name = "score_scrample") +bazel_dep(name = "score_logging") git_override( - module_name = "score_scrample", - remote = "https://github.com/eclipse-score/scrample.git", - commit = "0c2e72fc2a72a7dce4d9ddeec8470a861b08d5e1", + module_name = "score_logging", + remote = "https://github.com/qorix-group/logging.git", + commit = "3718923aafc273531b1d0b3a240d821db24afbbc", ) diff --git a/images/autosd_x86_64/BUILD.bazel b/images/autosd_x86_64/BUILD.bazel index 7d57b6b322..6c71e0e90e 100644 --- a/images/autosd_x86_64/BUILD.bazel +++ b/images/autosd_x86_64/BUILD.bazel @@ -27,7 +27,6 @@ rpm_package( "//showcases/cli:cli", "//showcases/kyron:kyron_example", "//showcases/orchestration_persistency:orch_per_example", - "@score_scrample//src:scrample" ], config_dir = "/etc/score", data = [ diff --git a/images/ebclfsa_aarch64/scrample_integration/BUILD b/images/ebclfsa_aarch64/scrample_integration/BUILD index 84fe2cfa9f..b310ca159f 100644 --- a/images/ebclfsa_aarch64/scrample_integration/BUILD +++ b/images/ebclfsa_aarch64/scrample_integration/BUILD @@ -12,9 +12,10 @@ # ******************************************************************************* load("@score_baselibs//score/language/safecpp:toolchain_features.bzl", "COMPILER_WARNING_FEATURES") +# TODO: Port image to CLI and all showcases as for other images genrule( name = "scrample_sil_r", - srcs = ["@score_scrample//src:scrample"], + srcs = ["@score_communication//score/mw/com/example/ipc_bridge:ipc_bridge_cpp"], outs = ["scrample_sil"], cmd = "cp $(SRCS) $@ && \ chmod ugo+w $@ && \ @@ -44,7 +45,6 @@ cc_binary( ], features = COMPILER_WARNING_FEATURES, deps = [ - "@score_scrample//src:scrample", ], ) @@ -68,11 +68,11 @@ genrule( genrule( name = "upload", srcs = [ - "@score_scrample//src:scrample", + "@score_communication//score/mw/com/example/ipc_bridge:ipc_bridge_cpp", ":scrample_sil", ":hi_app", ":fastdev-image", - "etc/mw_com_config.json", + "@score_communication//score/mw/com/example/ipc_bridge:etc/mw_com_config.json", "etc/logging.json", "run_qemu.sh", ], @@ -82,9 +82,9 @@ genrule( $(location run_qemu.sh) $(RULEDIR)/ebcl-qemuarm64-modified -pidfile $(RULEDIR)/qemu.pid > $(RULEDIR)/qemu_upload.log &\ sleep 30 ; \ sshpass -p linux scp -o StrictHostKeyChecking=no -P 2222 $(location :scrample_sil) root@localhost:/usr/bin &&\ - sshpass -p linux scp -o StrictHostKeyChecking=no -P 2222 $(location @score_scrample//src:scrample) root@localhost:/usr/bin &&\ + sshpass -p linux scp -o StrictHostKeyChecking=no -P 2222 $(location @score_communication//score/mw/com/example/ipc_bridge:ipc_bridge_cpp) root@localhost:/usr/bin &&\ sshpass -p linux scp -o StrictHostKeyChecking=no -P 2222 $(location :hi_app) root@localhost:/usr/bin &&\ - sshpass -p linux scp -o StrictHostKeyChecking=no -P 2222 $(location etc/mw_com_config.json) root@localhost:/etc/ &&\ + sshpass -p linux scp -o StrictHostKeyChecking=no -P 2222 $(location @score_communication//score/mw/com/example/ipc_bridge:etc/mw_com_config.json) root@localhost:/etc/ &&\ sshpass -p linux scp -o StrictHostKeyChecking=no -P 2222 $(location etc/logging.json) root@localhost:/etc/ &&\ sshpass -p linux ssh -o StrictHostKeyChecking=no -p 2222 root@localhost sync &&\ sshpass -p linux ssh -o StrictHostKeyChecking=no -p 2222 root@localhost crinit-ctl poweroff || true \ diff --git a/images/ebclfsa_aarch64/scrample_integration/etc/mw_com_config.json b/images/ebclfsa_aarch64/scrample_integration/etc/mw_com_config.json deleted file mode 100644 index 1e104bd484..0000000000 --- a/images/ebclfsa_aarch64/scrample_integration/etc/mw_com_config.json +++ /dev/null @@ -1,63 +0,0 @@ -{ - "serviceTypes": [ - { - "serviceTypeName": "/score/MapApiLanesStamped", - "version": { - "major": 1, - "minor": 0 - }, - "bindings": [ - { - "binding": "SHM", - "serviceId": 6432, - "events": [ - { - "eventName": "map_api_lanes_stamped", - "eventId": 1 - }, - { - "eventName": "dummy_data_stamped", - "eventId": 2 - } - ] - } - ] - } - ], - "serviceInstances": [ - { - "instanceSpecifier": "score/MapApiLanesStamped", - "serviceTypeName": "/score/MapApiLanesStamped", - "version": { - "major": 1, - "minor": 0 - }, - "instances": [ - { - "instanceId": 1, - "allowedConsumer": { - "QM": [ - 4002, - 0 - ] - }, - "allowedProvider": { - "QM": [ - 4001, - 0 - ] - }, - "asil-level": "QM", - "binding": "SHM", - "events": [ - { - "eventName": "map_api_lanes_stamped", - "numberOfSampleSlots": 10, - "maxSubscribers": 3 - } - ] - } - ] - } - ] -} diff --git a/images/ebclfsa_aarch64/scrample_integration/src/main.cc b/images/ebclfsa_aarch64/scrample_integration/src/main.cc index 72d6400215..4e4296a743 100644 --- a/images/ebclfsa_aarch64/scrample_integration/src/main.cc +++ b/images/ebclfsa_aarch64/scrample_integration/src/main.cc @@ -18,7 +18,7 @@ int main() { std::cout << "HI_App: Starting scrample_sil" << std::endl; const char *c_args[] = { - "/usr/bin/scrample_sil", + "/usr/bin/ipc_bridge_cpp", "-n", "10", "-m", "recv", "-t", "200", @@ -26,7 +26,7 @@ int main() { nullptr }; - execve("/usr/bin/scrample_sil", const_cast(c_args), nullptr); + execve("/usr/bin/ipc_bridge_cpp", const_cast(c_args), nullptr); std::cerr << "execve failed, sleeping... Reason: " << strerror(errno) << std::endl; diff --git a/known_good.json b/known_good.json index 6052df4856..5235f5eede 100644 --- a/known_good.json +++ b/known_good.json @@ -3,44 +3,55 @@ "target_sw": { "score_baselibs": { "repo": "https://github.com/eclipse-score/baselibs.git", - "hash": "ffd1c812213c66a436ed982632f6942528b58be8", - "version": "0.1.3", + "hash": "158fe6a7b791c58f6eac5f7e4662b8db0cf9ac6e", "bazel_patches": [ - "//patches/baselibs:003-acl-fixes-for-aarch64.patch", - "//patches/baselibs:0001-RH-exception-header.patch", - "//patches/baselibs:0002-RH-algorithm-header.patch" + "//patches/baselibs:003-acl-fixes-for-aarch64.patch" ], "metadata": { + "extra_test_config": [ + "//score/json:base_library=nlohmann", + "//score/memory/shared/flags:use_typedshmd=False" + ], "exclude_test_targets": [ "//score/language/safecpp/aborts_upon_exception:abortsuponexception_toolchain_test", "//score/containers:dynamic_array_test", "//score/mw/log/configuration:*", "//score/json/examples:*" ], - "langs": ["cpp"] + "langs": [ + "cpp" + ] } }, "score_baselibs_rust": { "repo": "https://github.com/eclipse-score/baselibs_rust.git", - "hash": "0eba2934fa8b0e1a343ec6bf6f7ff00cec27d81c", + "hash": "9f781acfb6d1a8fa06012ce772b0befb304acf31", "metadata": { "code_root_path": "//src/...", - "langs": ["rust"] + "langs": [ + "rust" + ] } }, "score_communication": { "repo": "https://github.com/eclipse-score/communication.git", - "hash": "0c0ea032995eaa766f5bdcec031bc02ee10d4587", - "version": "0.1.1", + "hash": "56448a5589a5f7d3921b873e8127b824a8c1ca95", + "bazel_patches": [ + "//patches/communication:001-expose-comm-examples.patch" + ], "metadata": { + "code_root_path": "//score/mw/com/impl/...", "exclude_test_targets": [ - "//score/*" + "//score/mw/com/impl:unit_test_runtime_single_exec", + "//score/mw/com/impl/configuration:config_parser_test", + "//score/mw/com/impl/configuration:configuration_test", + "//score/mw/com/impl/tracing/configuration:tracing_filter_config_parser_test" ] } }, "score_persistency": { "repo": "https://github.com/eclipse-score/persistency.git", - "hash": "0037034bf853e5f955f028fab54ed319fb0441c3", + "hash": "9692dadab51c677183262e8870c5425ab1797c4f", "metadata": { "code_root_path": "//src/...", "exclude_test_targets": [ @@ -50,30 +61,51 @@ }, "score_orchestrator": { "repo": "https://github.com/eclipse-score/orchestrator.git", - "hash": "18e136c34750c5db707f27f917d52efc7541e087", + "hash": "675007a2baa226fad1e2979ed732360dc111d056", "metadata": { "code_root_path": "//src/...", - "langs": ["rust"] + "langs": [ + "rust" + ] } }, "score_kyron": { "repo": "https://github.com/eclipse-score/kyron.git", - "hash": "ed312bdc6a50abc73f97b8c7e2ad4726fed06e81", + "hash": "d4d0afc1dd733a0c8a4aba9cc2b2b3a58d38ebf6", "metadata": { "code_root_path": "//src/...", - "langs": ["rust"] + "langs": [ + "rust" + ] } }, "score_lifecycle_health": { "repo": "https://github.com/eclipse-score/lifecycle.git", - "hash": "84303c2e48c7e8e2481752170efe82d0afd45f1e", + "hash": "14ee704eeac03e03ca10bece5de8b694d3c5e2dd", "metadata": { "code_root_path": "//src/..." } }, - "score_scrample": { - "repo": "https://github.com/eclipse-score/scrample.git", - "hash": "0c2e72fc2a72a7dce4d9ddeec8470a861b08d5e1" + "score_logging": { + "repo": "https://github.com/qorix-group/logging.git", + "hash": "3718923aafc273531b1d0b3a240d821db24afbbc", + "metadata": { + "extra_test_config": [ + "//score/datarouter/build_configuration_flags:persistent_logging=False", + "//score/datarouter/build_configuration_flags:persistent_config_feature_enabled=False", + "//score/datarouter/build_configuration_flags:enable_nonverbose_dlt=False", + "//score/datarouter/build_configuration_flags:enable_dynamic_configuration_in_datarouter=False", + "//score/datarouter/build_configuration_flags:file_transfer=False", + "//score/datarouter/build_configuration_flags:use_local_vlan=True" + ], + "exclude_test_targets": [ + "//score/datarouter/test/ut/ut_logging:dltprotocolUT", + "//score/datarouter/test/ut/ut_logging:persistentLogConfigUT", + "//score/datarouter/test/ut/ut_logging:socketserverConfigUT", + "//score/datarouter/test/ut/ut_logging:socketserverUT", + "//score/mw/log/legacy_non_verbose_api:unit_test" + ] + } } }, "tooling": { @@ -95,7 +127,6 @@ }, "score_bazel_platforms": { "repo": "https://github.com/eclipse-score/bazel_platforms.git", - "hash": "3ac1b805ba42b58a13f8960f947b7866c8bcf26c", "version": "0.0.4" }, "score_test_scenarios": { @@ -104,7 +135,6 @@ }, "score_docs_as_code": { "repo": "https://github.com/eclipse-score/docs-as-code.git", - "hash": "ba006429268e6bd9b856088f7a4217742ed09025", "version": "3.0.1" }, "score_process": { @@ -112,8 +142,6 @@ "hash": "6c772cf05a493218a5ac6071361bf0b66c5427b2" } } - - }, "timestamp": "2026-02-10T21:12:42+00:00Z" -} +} \ No newline at end of file diff --git a/patches/baselibs/0001-RH-exception-header.patch b/patches/baselibs/0001-RH-exception-header.patch deleted file mode 100644 index d48191eab2..0000000000 --- a/patches/baselibs/0001-RH-exception-header.patch +++ /dev/null @@ -1,12 +0,0 @@ -diff --git a/score/concurrency/clock.h b/score/concurrency/clock.h -index 0fa7719..365a003 100644 ---- a/score/concurrency/clock.h -+++ b/score/concurrency/clock.h -@@ -15,6 +15,7 @@ - - #include - #include -+#include - - namespace score - { diff --git a/patches/baselibs/0002-RH-algorithm-header.patch b/patches/baselibs/0002-RH-algorithm-header.patch deleted file mode 100644 index 70fc3780a9..0000000000 --- a/patches/baselibs/0002-RH-algorithm-header.patch +++ /dev/null @@ -1,36 +0,0 @@ -diff --git a/score/language/futurecpp/tests/member_iterator_test.cpp b/score/language/futurecpp/tests/member_iterator_test.cpp -index bea1361..6d649d2 100644 ---- a/score/language/futurecpp/tests/member_iterator_test.cpp -+++ b/score/language/futurecpp/tests/member_iterator_test.cpp -@@ -9,6 +9,7 @@ - #include - #include - #include -+#include - - #include - -diff --git a/score/language/futurecpp/tests/multi_span_test.cpp b/score/language/futurecpp/tests/multi_span_test.cpp -index 9b57903..c0da98b 100644 ---- a/score/language/futurecpp/tests/multi_span_test.cpp -+++ b/score/language/futurecpp/tests/multi_span_test.cpp -@@ -11,6 +11,7 @@ - #include - #include - #include -+#include - - #include - -diff --git a/score/mw/log/detail/logging_identifier.h b/score/mw/log/detail/logging_identifier.h -index ec02bac..b15bdfa 100644 ---- a/score/mw/log/detail/logging_identifier.h -+++ b/score/mw/log/detail/logging_identifier.h -@@ -19,6 +19,7 @@ - - #include - #include -+#include - - namespace score - { diff --git a/patches/baselibs/003-acl-fixes-for-aarch64.patch b/patches/baselibs/003-acl-fixes-for-aarch64.patch index 95ea478477..14c0c4cac2 100644 --- a/patches/baselibs/003-acl-fixes-for-aarch64.patch +++ b/patches/baselibs/003-acl-fixes-for-aarch64.patch @@ -1,20 +1,8 @@ -From 37a6329193e94d93fef91fc184e95e9a8b67a98b Mon Sep 17 00:00:00 2001 -From: Pawel Rutka -Date: Mon, 9 Feb 2026 14:51:53 +0100 -Subject: [PATCH] T - -Signed-off-by: Pawel Rutka ---- - MODULE.bazel | 7 +++++++ - third_party/acl/BUILD | 6 +++++- - third_party/acl/acl.BUILD | 7 ++++--- - 3 files changed, 16 insertions(+), 4 deletions(-) - diff --git a/MODULE.bazel b/MODULE.bazel -index f7991cb..b78d618 100644 +index 7b6f319..efa7b1c 100644 --- a/MODULE.bazel +++ b/MODULE.bazel -@@ -64,6 +64,13 @@ deb( +@@ -98,6 +98,13 @@ deb( visibility = ["//visibility:public"], ) @@ -29,10 +17,10 @@ index f7991cb..b78d618 100644 name = "valgrind-deb", build = "//third_party/valgrind:valgrind.BUILD", diff --git a/third_party/acl/BUILD b/third_party/acl/BUILD -index dfcac1e..c76bee3 100644 +index b71d5df..da07995 100644 --- a/third_party/acl/BUILD +++ b/third_party/acl/BUILD -@@ -1,5 +1,9 @@ +@@ -1,5 +1,8 @@ alias( name = "acl", - actual = "@acl-deb//:acl", @@ -40,11 +28,10 @@ index dfcac1e..c76bee3 100644 + "@platforms//cpu:aarch64": "@acl-deb-aarch64//:acl", + "//conditions:default": "@acl-deb//:acl", + }), - visibility = ["//visibility:public"], + visibility = ["//visibility:public"], ) -+ diff --git a/third_party/acl/acl.BUILD b/third_party/acl/acl.BUILD -index 2163068..d86c7f7 100644 +index 718726c..b695a6a 100644 --- a/third_party/acl/acl.BUILD +++ b/third_party/acl/acl.BUILD @@ -1,8 +1,9 @@ @@ -60,6 +47,3 @@ index 2163068..d86c7f7 100644 hdrs = [ "usr/include/acl/libacl.h", "usr/include/sys/acl.h", --- -2.43.0 - diff --git a/patches/baselibs/fix_hard_coded_amd64.patch b/patches/baselibs/fix_hard_coded_amd64.patch deleted file mode 100644 index 91892e1b20..0000000000 --- a/patches/baselibs/fix_hard_coded_amd64.patch +++ /dev/null @@ -1,32 +0,0 @@ -diff --git a/MODULE.bazel b/MODULE.bazel -index 16776ba..683c131 100644 ---- a/MODULE.bazel -+++ b/MODULE.bazel -@@ -70,7 +70,7 @@ deb = use_repo_rule("@download_utils//download/deb:defs.bzl", "download_deb") - deb( - name = "acl-deb", - build = "//third_party/acl:acl.BUILD", -- urls = ["https://archive.ubuntu.com/ubuntu/pool/main/a/acl/libacl1-dev_2.2.52-3build1_amd64.deb"], -+ urls = ["https://launchpadlibrarian.net/581258948/libacl1-dev_2.3.1-1_arm64.deb"], - visibility = ["//visibility:public"], - ) - -diff --git a/third_party/acl/acl.BUILD b/third_party/acl/acl.BUILD -index 718726c..710befd 100644 ---- a/third_party/acl/acl.BUILD -+++ b/third_party/acl/acl.BUILD -@@ -1,7 +1,7 @@ - cc_library( - name = "acl", - srcs = [ -- "usr/lib/libacl.a", -+ "usr/lib/aarch64-linux-gnu/libacl.a", - ], - hdrs = [ - "usr/include/acl/libacl.h", -@@ -9,4 +9,4 @@ cc_library( - ], - includes = ["usr/include/"], - visibility = ["//visibility:public"], --) -+) diff --git a/patches/communication/001-expose-comm-examples.patch b/patches/communication/001-expose-comm-examples.patch new file mode 100644 index 0000000000..ae6b8a0f5b --- /dev/null +++ b/patches/communication/001-expose-comm-examples.patch @@ -0,0 +1,12 @@ +diff --git a/score/mw/com/example/ipc_bridge/BUILD b/score/mw/com/example/ipc_bridge/BUILD +index 525969e..19e0fc3 100644 +--- a/score/mw/com/example/ipc_bridge/BUILD ++++ b/score/mw/com/example/ipc_bridge/BUILD +@@ -31,6 +31,7 @@ cc_binary( + "@score_baselibs//score/language/futurecpp", + "@score_logging//score/mw/log", + ], ++ visibility = ["//visibility:public"], + ) + + cc_library( diff --git a/patches/communication/BUILD b/patches/communication/BUILD new file mode 100644 index 0000000000..e69de29bb2 diff --git a/scripts/known_good/models/module.py b/scripts/known_good/models/module.py index 2180b9fbc8..0ba65add53 100644 --- a/scripts/known_good/models/module.py +++ b/scripts/known_good/models/module.py @@ -14,11 +14,13 @@ class Metadata: Attributes: code_root_path: Root path to the code directory + extra_test_config: List of extra test configuration flags exclude_test_targets: List of test targets to exclude langs: List of languages supported (e.g., ["cpp", "rust"]) """ code_root_path: str = "//score/..." + extra_test_config: list[str] = field(default_factory=lambda: []) exclude_test_targets: list[str] = field(default_factory=lambda: []) langs: list[str] = field(default_factory=lambda: ["cpp", "rust"]) @@ -34,6 +36,7 @@ def from_dict(cls, data: Dict[str, Any]) -> Metadata: """ return cls( code_root_path=data.get("code_root_path", "//score/..."), + extra_test_config=data.get("extra_test_config", []), exclude_test_targets=data.get("exclude_test_targets", []), langs=data.get("langs", ["cpp", "rust"]), ) @@ -46,6 +49,7 @@ def to_dict(self) -> Dict[str, Any]: """ return { "code_root_path": self.code_root_path, + "extra_test_config": self.extra_test_config, "exclude_test_targets": self.exclude_test_targets, "langs": self.langs, } @@ -76,13 +80,14 @@ def from_dict(cls, name: str, module_data: Dict[str, Any]) -> Module: - metadata (dict, optional): Metadata configuration Example: { "code_root_path": "path/to/code/root", + "extra_test_config": [""], "exclude_test_targets": [""], "langs": ["cpp", "rust"] } If not present, uses default Metadata values. - branch (str, optional): Git branch name (default: main) - pin_version (bool, optional): If true, module hash is not updated - to latest HEAD by update scripts (default: false) + to latest HEAD by update scripts (default: false) Returns: Module instance @@ -91,6 +96,12 @@ def from_dict(cls, name: str, module_data: Dict[str, Any]) -> Module: # Support both 'hash' and 'commit' keys commit_hash = module_data.get("hash") or module_data.get("commit", "") version = module_data.get("version") + + if commit_hash and version: + raise ValueError( + f"Module '{name}' has both 'hash' and 'version' set. " + "Use either 'hash' (git_override) or 'version' (single_version_override), not both." + ) # Support both 'bazel_patches' and legacy 'patches' keys bazel_patches = module_data.get("bazel_patches") or module_data.get( "patches", [] @@ -100,6 +111,7 @@ def from_dict(cls, name: str, module_data: Dict[str, Any]) -> Module: metadata_data = module_data.get("metadata") if metadata_data is not None: metadata = Metadata.from_dict(metadata_data) + # Enable once we are able to remove '*' in known_good.json # if any("*" in target for target in metadata.exclude_test_targets): # raise Exception( # f"Module {name} has wildcard '*' in exclude_test_targets, which is not allowed. " @@ -160,7 +172,7 @@ def owner_repo(self) -> str: # Split and validate owner/repo format parts = path.split("/", 2) # Split max 2 times to get owner and repo - if len(parts) < 2 or not parts[0] or not parts[1]: + if len(parts) != 2: raise ValueError(f"Cannot parse owner/repo from: {self.repo}") return f"{parts[0]}/{parts[1]}" @@ -171,13 +183,12 @@ def to_dict(self) -> Dict[str, Any]: Returns: Dictionary with module configuration """ - result: Dict[str, Any] = { - "repo": self.repo, - "hash": self.hash, - "metadata": self.metadata.to_dict(), - } + result: Dict[str, Any] = {"repo": self.repo} if self.version: result["version"] = self.version + else: + result["hash"] = self.hash + result["metadata"] = self.metadata.to_dict() if self.bazel_patches: result["bazel_patches"] = self.bazel_patches if self.branch and self.branch != "main": diff --git a/scripts/known_good/update_module_from_known_good.py b/scripts/known_good/update_module_from_known_good.py index 028e615988..a7b9b25335 100755 --- a/scripts/known_good/update_module_from_known_good.py +++ b/scripts/known_good/update_module_from_known_good.py @@ -6,9 +6,9 @@ Usage: python3 scripts/known_good/update_module_from_known_good.py \ --known known_good.json \ - --output score_modules.MODULE.bazel + --output-dir bazel_common -The generated score_modules.MODULE.bazel file is included by MODULE.bazel. +The generated score_modules_NAME_.MODULE.bazel file is included by MODULE.bazel. Note: To override repository commits before generating the MODULE.bazel file, use scripts/known_good/override_known_good_repo.py first to create an updated known_good.json. diff --git a/scripts/quality_runners.py b/scripts/quality_runners.py index 5383bdd8ce..2dc7b516e3 100644 --- a/scripts/quality_runners.py +++ b/scripts/quality_runners.py @@ -18,26 +18,34 @@ class ProcessResult: exit_code: int +def print_centered(message: str, width: int = 120, fillchar: str = "-") -> None: + print(message.center(width, fillchar)) + + def run_unit_test_with_coverage(module: Module) -> dict[str, str | int]: - print("QR: Running unit tests...") - - call = [ - "bazel", - "coverage", # Call coverage instead of test to get .dat files already - "--test_verbose_timeout_warnings", - "--test_timeout=1200", - "--config=unit-tests", - "--test_summary=testcase", - "--test_output=errors", - "--nocache_test_results", - f"--instrumentation_filter=@{module.name}", - f"@{module.name}{module.metadata.code_root_path}", - "--", - ] + [ - # Exclude test targets specified in module metadata, if any - f"-@{module.name}{target}" - for target in module.metadata.exclude_test_targets - ] + print_centered("QR: Running unit tests") + + call = ( + [ + "bazel", + "coverage", # Call coverage instead of test to get .dat files already + "--test_verbose_timeout_warnings", + "--test_timeout=1200", + "--config=unit-tests", + "--test_summary=testcase", + "--test_output=errors", + "--nocache_test_results", + f"--instrumentation_filter=@{module.name}", + f"@{module.name}{module.metadata.code_root_path}", + ] + + [f"--@{module.name}{target}" for target in module.metadata.extra_test_config] + + ["--"] + + [ + # Exclude test targets specified in module metadata, if any + f"-@{module.name}{target}" + for target in module.metadata.exclude_test_targets + ] + ) result = run_command(call) summary = extract_ut_summary(result.stdout) @@ -45,7 +53,7 @@ def run_unit_test_with_coverage(module: Module) -> dict[str, str | int]: def run_cpp_coverage_extraction(module: Module, output_path: Path) -> int: - print("QR: Running cpp coverage analysis...") + print_centered("QR: Running cpp coverage analysis") result_cpp = cpp_coverage(module, output_path) summary = extract_coverage_summary(result_cpp.stdout) @@ -72,8 +80,6 @@ def cpp_coverage(module: Module, artifact_dir: Path) -> ProcessResult: "genhtml", f"{bazel_coverage_output_directory}/_coverage/_coverage_report.dat", f"--output-directory={output_dir}", - # f"--source-directory={bazel_source_directory}", - # "--synthesize-missing", "--show-details", "--legend", "--function-coverage", @@ -115,7 +121,7 @@ def extract_ut_summary(logs: str) -> dict[str, int]: if match := pattern_summary_line.search(logs): summary_line = match.group(0) else: - print("QR: Summary line not found in logs.") + print_centered("QR: Summary line not found in logs") return summary pattern_passed = re.compile(r"(\d+) passing") @@ -176,7 +182,9 @@ def run_command(command: list[str], **kwargs) -> ProcessResult: stdout_data = [] stderr_data = [] - print(f"QR: Running command: `{' '.join(command)}`") + print_centered("QR: Running command:") + print(f"{' '.join(command)}") + with Popen(command, stdout=PIPE, stderr=PIPE, text=True, bufsize=1, **kwargs) as p: # Use select to read from both streams without blocking streams = { @@ -227,6 +235,12 @@ def parse_arguments() -> argparse.Namespace: default=Path(__file__).parent.parent / "artifacts/coverage", help="Path to the directory for coverage output files", ) + parser.add_argument( + "--modules-to-test", + type=lambda modules: modules.split(","), + default=[], + help="List of modules to test", + ) return parser.parse_args() @@ -239,55 +253,25 @@ def main() -> bool: unit_tests_summary, coverage_summary = {}, {} - CURRENTLY_DISABLED_MODULES = [ - "score_communication", - "score_scrample", - "score_logging", - "score_lifecycle_health", - "score_feo", - ] + if args.modules_to_test: + print_centered( + f"QR: User requested tests only for specified modules: {', '.join(args.modules_to_test)}" + ) for module in known.modules["target_sw"].values(): - if module.name in CURRENTLY_DISABLED_MODULES: - print( - "########################################################################", - flush=True, - ) - print( - f"Skipping module {module.name} as it is currently disabled for unit tests.", - flush=True, - ) - print( - "########################################################################", - flush=True, - ) + if args.modules_to_test and module.name not in args.modules_to_test: + print_centered(f"QR: Skipping module {module.name}") continue - else: - print( - "########################################################################", - flush=True, - ) - print(f"QR: Testing module: {module.name}") - print( - "########################################################################", - flush=True, - ) + print_centered(f"QR: Testing module: {module.name}") unit_tests_summary[module.name] = run_unit_test_with_coverage(module=module) if "cpp" in module.metadata.langs: coverage_summary[module.name] = run_cpp_coverage_extraction( module=module, output_path=args.coverage_output_dir ) - print( - "########################################################################", - flush=True, - ) - print(f"QR: Finished testing module: {module.name}") - print( - "########################################################################", - flush=True, - ) + + print_centered(f"QR: Finished testing module: {module.name}") generate_markdown_report( unit_tests_summary, @@ -295,7 +279,7 @@ def main() -> bool: columns=["module", "passed", "failed", "skipped", "total"], output_path=path_to_docs / "unit_test_summary.md", ) - print("QR: UNIT TEST EXECUTION SUMMARY".center(120, "=")) + print_centered("QR: UNIT TEST EXECUTION SUMMARY", fillchar="=") pprint(unit_tests_summary, width=120) generate_markdown_report( @@ -304,7 +288,7 @@ def main() -> bool: columns=["module", "lines", "functions", "branches"], output_path=path_to_docs / "coverage_summary.md", ) - print("QR: COVERAGE ANALYSIS SUMMARY".center(120, "=")) + print_centered("QR: COVERAGE ANALYSIS SUMMARY", fillchar="=") pprint(coverage_summary, width=120) # Check all exit codes and return non-zero if any test or coverage extraction failed diff --git a/showcases/BUILD b/showcases/BUILD index ef1f3d7a06..a110fe8d22 100644 --- a/showcases/BUILD +++ b/showcases/BUILD @@ -14,10 +14,9 @@ load("//bazel_common:bundlers.bzl", "score_pkg_bundle") score_pkg_bundle( name = "showcases_all", - # package_dir = "", bins = ["//showcases/cli" ], other_package_files = [ - "//showcases/standalone:standalone_pkg_files", + "//showcases/standalone:comm_pkg_files", "//showcases/kyron:kyron_pkg_files", "//showcases/orchestration_persistency:orch_per_pkg_files", "//showcases/simple_lifecycle:simple_lifecycle_pkg_files", diff --git a/showcases/standalone/BUILD b/showcases/standalone/BUILD index 5b4746fb26..ad5cc22a48 100644 --- a/showcases/standalone/BUILD +++ b/showcases/standalone/BUILD @@ -2,7 +2,13 @@ load("//bazel_common:bundlers.bzl", "score_pkg_bundle") score_pkg_bundle( - name = "standalone", + name = "comm", package_dir = "standalone", - bins = ["@score_scrample//src:scrample"], + bins = ["@score_communication//score/mw/com/example/ipc_bridge:ipc_bridge_cpp"], + custom_layout = { + "@score_communication//score/mw/com/example/ipc_bridge:etc/mw_com_config.json": "etc/mw_com_config.json" + }, + config_data = [ + "//showcases/standalone:com.score.json", + ], ) diff --git a/showcases/standalone/com.score.json b/showcases/standalone/com.score.json new file mode 100644 index 0000000000..2e4b57dd26 --- /dev/null +++ b/showcases/standalone/com.score.json @@ -0,0 +1,24 @@ +{ + "name": "Communication Sender Receiver Example", + "description": "Example for running communication sender and receiver", + "apps":[ + { + "path": "/showcases/bin/ipc_bridge_cpp", + "args": [ + "-n", "10", "-t", "100", "-m", "send" + ], + "env": { + }, + "dir": "/showcases/data/comm" + }, + { + "path": "/showcases/bin/ipc_bridge_cpp", + "args": [ + "-n", "5", "-t", "100", "-m", "recv" + ], + "env": { + }, + "dir": "/showcases/data/comm" + } + ] +}