diff --git a/MODULE.bazel.lock b/MODULE.bazel.lock index d12bbf84f24..c94654024cc 100644 --- a/MODULE.bazel.lock +++ b/MODULE.bazel.lock @@ -342,7 +342,6 @@ "https://bcr.bazel.build/modules/pybind11_bazel/2.13.6/source.json": "6aa0703de8efb20cc897bbdbeb928582ee7beaf278bcd001ac253e1605bddfae", "https://bcr.bazel.build/modules/rapidjson/1.1.0.bcr.20241007/MODULE.bazel": "82fbcb2e42f9e0040e76ccc74c06c3e46dfd33c64ca359293f8b84df0e6dff4c", "https://bcr.bazel.build/modules/rapidjson/1.1.0.bcr.20241007/source.json": "5c42389ad0e21fc06b95ad7c0b730008271624a2fa3292e0eab5f30e15adeee3", - "https://bcr.bazel.build/modules/rapidjson/1.1.0/MODULE.bazel": "0367b53ebffe290358729893e7c435da379397738e09ae45c845e1e4f59fa3fc", "https://bcr.bazel.build/modules/re2/2021-09-01/MODULE.bazel": "bcb6b96f3b071e6fe2d8bed9cc8ada137a105f9d2c5912e91d27528b3d123833", "https://bcr.bazel.build/modules/re2/2023-09-01/MODULE.bazel": "cb3d511531b16cfc78a225a9e2136007a48cf8a677e4264baeab57fe78a80206", "https://bcr.bazel.build/modules/re2/2024-05-01/MODULE.bazel": "55a3f059538f381107824e7d00df5df6d061ba1fb80e874e4909c0f0549e8f3e", @@ -786,7 +785,6 @@ "https://raw.githubusercontent.com/eclipse-score/bazel_registry/main/modules/pybind11_bazel/2.12.0/MODULE.bazel": "not found", "https://raw.githubusercontent.com/eclipse-score/bazel_registry/main/modules/pybind11_bazel/2.13.6/MODULE.bazel": "not found", "https://raw.githubusercontent.com/eclipse-score/bazel_registry/main/modules/rapidjson/1.1.0.bcr.20241007/MODULE.bazel": "not found", - "https://raw.githubusercontent.com/eclipse-score/bazel_registry/main/modules/rapidjson/1.1.0/MODULE.bazel": "not found", "https://raw.githubusercontent.com/eclipse-score/bazel_registry/main/modules/re2/2021-09-01/MODULE.bazel": "not found", "https://raw.githubusercontent.com/eclipse-score/bazel_registry/main/modules/re2/2023-09-01/MODULE.bazel": "not found", "https://raw.githubusercontent.com/eclipse-score/bazel_registry/main/modules/re2/2024-05-01/MODULE.bazel": "not found", diff --git a/bazel_common/score_modules_target_sw.MODULE.bazel b/bazel_common/score_modules_target_sw.MODULE.bazel index 8a89f364cbc..1ae6e5111c8 100644 --- a/bazel_common/score_modules_target_sw.MODULE.bazel +++ b/bazel_common/score_modules_target_sw.MODULE.bazel @@ -72,6 +72,11 @@ git_override( bazel_dep(name = "score_logging") git_override( module_name = "score_logging", - commit = "0e9187f79a9935ca192779234b82f9d00dc4e335", + commit = "254fdfe0e35a2738917fb16d41bb70acc83f32ad", + patch_strip = 1, + patches = [ + "//patches/logging:001-logging-example-visibility.patch", + "//patches/logging:002-deps-visibility.patch", + ], remote = "https://github.com/eclipse-score/logging.git", ) diff --git a/known_good.json b/known_good.json index 46303c75ca5..101e3ead615 100644 --- a/known_good.json +++ b/known_good.json @@ -97,7 +97,10 @@ }, "score_logging": { "repo": "https://github.com/eclipse-score/logging.git", - "hash": "0e9187f79a9935ca192779234b82f9d00dc4e335", + "hash": "254fdfe0e35a2738917fb16d41bb70acc83f32ad", + "bazel_patches": [ + "//patches/logging:001-logging-example-visibility.patch", + "//patches/logging:002-deps-visibility.patch"], "metadata": { "extra_test_config": [ "@score_logging//score/datarouter/build_configuration_flags:persistent_logging=False", diff --git a/patches/logging/001-logging-example-visibility.patch b/patches/logging/001-logging-example-visibility.patch new file mode 100644 index 00000000000..fc4650310fb --- /dev/null +++ b/patches/logging/001-logging-example-visibility.patch @@ -0,0 +1,38 @@ +diff --git a/score/test/component/dlt_generator_app/BUILD b/score/test/component/dlt_generator_app/BUILD +index 9736cac..a60ebd6 100644 +--- a/score/test/component/dlt_generator_app/BUILD ++++ b/score/test/component/dlt_generator_app/BUILD +@@ -29,9 +29,14 @@ load("@rules_pkg//pkg:tar.bzl", "pkg_tar") + cc_binary( + name = "dlt_generator", + srcs = ["dlt_generator.cpp"], ++ visibility = ["//visibility:public"], + deps = ["//score/mw/log"], + ) + ++exports_files([ ++ "etc/logging.json", ++]) ++ + pkg_tar( + name = "dlt_generator_bin_pkg", + srcs = [":dlt_generator"], +diff --git a/score/test/component/logging_app/BUILD b/score/test/component/logging_app/BUILD +index de63c65..f9f3346 100644 +--- a/score/test/component/logging_app/BUILD ++++ b/score/test/component/logging_app/BUILD +@@ -29,9 +29,14 @@ load("@rules_pkg//pkg:tar.bzl", "pkg_tar") + cc_binary( + name = "logging_app", + srcs = ["logging_app.cpp"], ++ visibility = ["//visibility:public"], + deps = ["//score/mw/log"], + ) + ++exports_files([ ++ "etc/logging.json", ++]) ++ + pkg_tar( + name = "logging_app_bin_pkg", + srcs = [":logging_app"], diff --git a/patches/logging/002-deps-visibility.patch b/patches/logging/002-deps-visibility.patch new file mode 100644 index 00000000000..c3336a45923 --- /dev/null +++ b/patches/logging/002-deps-visibility.patch @@ -0,0 +1,13 @@ +diff --git a/MODULE.bazel b/MODULE.bazel +index 5eed2f9..06fb222 100644 +--- a/MODULE.bazel ++++ b/MODULE.bazel +@@ -47,7 +47,7 @@ bazel_dep(name = "score_itf", version = "0.4.0", dev_dependency = True) + + # OCI / Docker image rules for integration tests + bazel_dep(name = "rules_oci", version = "2.2.7", dev_dependency = True) +-bazel_dep(name = "rules_pkg", version = "1.2.0", dev_dependency = True) ++bazel_dep(name = "rules_pkg", version = "1.2.0") + + # QNX image filesystem rules for QNX integration tests + bazel_dep(name = "score_rules_imagefs", version = "0.0.1", dev_dependency = True) diff --git a/patches/logging/BUILD b/patches/logging/BUILD new file mode 100644 index 00000000000..e69de29bb2d diff --git a/showcases/BUILD b/showcases/BUILD index 514b36add06..8bfb1f0f2d2 100644 --- a/showcases/BUILD +++ b/showcases/BUILD @@ -18,6 +18,7 @@ score_pkg_bundle( other_package_files = [ "//showcases/standalone:comm_pkg_files", "//showcases/standalone:kyron_pkg_files", + "//showcases/standalone:logging_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 aae7c225607..305d23136ac 100644 --- a/showcases/standalone/BUILD +++ b/showcases/standalone/BUILD @@ -36,3 +36,19 @@ score_pkg_bundle( ], package_dir = "standalone", ) + +score_pkg_bundle( + name = "logging", + bins = [ + "@score_logging//score/test/component/logging_app:logging_app", + "@score_logging//score/test/component/dlt_generator_app:dlt_generator", + ], + config_data = [ + "//showcases/standalone:logging.score.json", + ], + custom_layout = { + "@score_logging//score/test/component/logging_app:etc/logging.json": "logging_app/etc/logging.json", + "@score_logging//score/test/component/dlt_generator_app:etc/logging.json": "dlt_generator/etc/logging.json", + }, + package_dir = "standalone", +) diff --git a/showcases/standalone/logging.score.json b/showcases/standalone/logging.score.json new file mode 100644 index 00000000000..9d84e1dfa0a --- /dev/null +++ b/showcases/standalone/logging.score.json @@ -0,0 +1,34 @@ +[ + { + "name": "Logging example", + "description": "Example for running logging with all log levels via remote and console", + "apps": [ + { + "path": "/bin/sh", + "args": [ + "-c", + "cd /usr/bin/datarouter && ./datarouter --no_adaptive_runtime >/dev/null 2>&1 &" + ], + "env": {} + }, + { + "path": "/showcases/bin/logging_app", + "args": [], + "env": {}, + "dir": "/showcases/data/logging/logging_app/etc" + } + ] + }, + { + "name": "logging : dlt Generator example", + "description": "Example for generating DLT log messages", + "apps": [ + { + "path": "/showcases/bin/dlt_generator", + "args": [], + "env": {}, + "dir": "/showcases/data/logging/dlt_generator/etc" + } + ] + } +] \ No newline at end of file