diff --git a/.bazelrc b/.bazelrc index d06421f2e6..a47392fb22 100644 --- a/.bazelrc +++ b/.bazelrc @@ -66,6 +66,9 @@ build:ferrocene-coverage --@rules_rust//rust/settings:extra_exec_rustc_flag=-Cco build:ferrocene-coverage --@rules_rust//rust/settings:extra_exec_rustc_flag=-Cdebuginfo=2 test:ferrocene-coverage --run_under=@score_tooling//coverage:llvm_profile_wrapper +# Coverage needs to have all intermediate .rlibs to be able to proceed +build:ferrocene-coverage --remote_download_all + test:unit-tests --config=linux-x86_64 test:unit-tests --build_tests_only test:unit-tests --test_tag_filters=-manual @@ -76,3 +79,6 @@ coverage --combined_report=lcov # user specific overrides (like proxy settings) try-import %workspace%/user.bazelrc + +# Try import setting from home (CI setup-bazel action for caching uses this to provide proper args like --disk-cache) +try-import ~/.bazelrc diff --git a/.github/codeql/codeql-config.yml b/.github/codeql/codeql-config.yml index 2c41924f66..0e0e1b88c9 100644 --- a/.github/codeql/codeql-config.yml +++ b/.github/codeql/codeql-config.yml @@ -4,4 +4,5 @@ paths-ignore: - "**/*test*" - "**/*mock*" - "**/test/**" - - "**/mock/**" \ No newline at end of file + - "**/mock/**" + - "**/codeql-coding-standards-repo/**" diff --git a/.github/workflows/codeql-multiple-repo-scan.yml b/.github/workflows/codeql-multiple-repo-scan.yml index c23e71b83f..35f45d6387 100644 --- a/.github/workflows/codeql-multiple-repo-scan.yml +++ b/.github/workflows/codeql-multiple-repo-scan.yml @@ -140,7 +140,7 @@ jobs: (cd "$path" && git checkout "$ref") else echo " Detected branch/tag. Cloning with --branch." - git clone --depth 1 --branch "$ref" "$url" "$path" + git clone --depth 1 --branch v"$ref" "$url" "$path" fi # Append the path to the list, separated by commas diff --git a/BUILD b/BUILD index 78223a1ed5..e54b90d0e0 100644 --- a/BUILD +++ b/BUILD @@ -25,7 +25,6 @@ docs( # "@score_lifecycle_health//:needs_json", # unreadable images - relative paths issue # "@score_logging//:needs_json", # duplicated labels "@score_logging//:needs_json", - # "@score_feo//:needs_json", # Tools "@score_platform//:needs_json", "@score_process//:needs_json", diff --git a/README.md b/README.md index c58358601f..5069bbeba8 100644 --- a/README.md +++ b/README.md @@ -1,16 +1,16 @@ # Score Reference Integration -This workspace integrates multiple Eclipse Score modules (baselibs, communication, persistency, orchestrator, feo, etc.) to validate cross-repository builds and detect integration issues early in the development cycle. +This workspace integrates multiple Eclipse Score modules (baselibs, communication, persistency, orchestrator, etc.) to validate cross-repository builds and detect integration issues early in the development cycle. ## Overview The reference integration workspace serves as a single Bazel build environment to: + - Validate cross-module dependency graphs - Detect label and repository boundary issues - Test toolchain and platform support (Linux, QNX, LLVM/GCC) - Prepare for release validation workflows - ## Get started Simply run `./score_starter` and select which integration You want to run. Once running, You will be guided by our welcome cli to run selected examples. @@ -20,48 +20,56 @@ Simply run `./score_starter` and select which integration You want to run. Once Intention for each folder is described below ### bazel_common + Used to keep a common bazel functionalities for `images` like: + - toolchain setups - common tooling deps - common S-CORE modules deps - common `.bzl` extensions needed to streamline images - ### showcases + Used to keep `S-CORE` wide **showcases** implementation to showcase S-CORE in certain deployments (images). Contains: + - proxy target bundling all `standalone` examples from all `S-CORE` repos to deploy then as single bazel target into image - implementation of certain **showcases** that shall be deployed into images #### cli -Contains a CLI tool to be used on runner that is showcasing the S-CORE functionality. It will provide superior user experience and will guide user to run examples. -How to use it in Your image, look [here](./showcases/cli/README.md) +Contains a CLI tool to be used on runner that is showcasing the S-CORE functionality. It will provide superior user experience and will guide user to run examples. +How to use it in Your image, look [here] (./showcases/cli/README.md) ### images + Used to keep concrete `images` for given target platform as bazel modules. Each platform shall have it's own folder with name `{platform}_{arch}` ie. `qnx_aarch64`. This `images` shall: - - deploy all `showcases` into image so they can be run inside - - other specific code for given `image` + +- deploy all `showcases` into image so they can be run inside +- other specific code for given `image` ### runners + Used to keep thin logic ro reuse `runners` between images, like docker runner etc. ## Docs To generate a full documentation of all integrated modules, run: + ```bash bazel run //:docs_combo_experimental ``` + ## Operating system integrations > [!NOTE] > Please refer to the README documents in the respective sub-directories for details about the specific integration. -* [QNX](./images/qnx_x86_64//README.md) -* [Red Hat AutoSD](./images/autosd_x86_64/build/README.md) -* [Elektrobit corbos Linux for Safety Applications](./images/ebclfsa_aarch64/README.md) -* [Linux x86_64]() +- [QNX](./images/qnx_x86_64//README.md) +- [Red Hat AutoSD](./images/autosd_x86_64/build/README.md) +- [Elektrobit corbos Linux for Safety Applications](./images/ebclfsa_aarch64/README.md) +- Linux x86_64 ## Workspace support @@ -73,48 +81,33 @@ This helps with cross-module development, debugging, and generally "trying out t > You can do this manually as well, of course (e.g. if you do not use the devcontainer). > Take a look at `.devcontainer/prepare_workspace.sh`, which contains the setup script. -> [!NOTE] -> Not all Bazel targets are supported yet. -> Running `./scripts/integration_test.sh` will work, though. -> Take a look at the [Known Issues](#known-issues-๏ธ) below to see which Bazel targets are available and working. - -The supported workspace managers are: - -| Name | Description | -|------|-------------| -| [Gita](https://github.com/nosarthur/gita) | "a command-line tool to manage multiple git repos" | - -A description of how to use these workspace managers, together with their advantages and drawbacks, is beyond the scope of this document. -In case of doubt, choose the first. - ### Initialization of the workspace -> [!WARNING] -> This will change the file `score_modules.MODULE.bazel`. -> Do **not** commit these changes! - 1. Switch to local path overrides, using the VSCode Task (`Terminal`->`Run Task...`) "Switch Bazel modules to `local_path_overrides`". Note that you can switch back to `git_overrides` (the default) using the task "Switch Bazel modules to `git_overrides`" - + **Command line:** + ```bash python3 scripts/known_good/update_module_from_known_good.py --override-type local_path ``` - + 2. Update workspace metadata from known good, using the VSCode Task "Update workspace metadata from known good". This will generate the `.gita-workspace.csv` file based on `known_good.json`. - + **Command line:** + ```bash python3 scripts/known_good/known_good_to_workspace_metadata.py ``` - + 3. Run VSCode Task "<Name>: Generate workspace", e.g. "Gita: Generate workspace". This will clone all modules using the chosen workspace manager. The modules will be in sub-directories starting with `score_`. Note that the usage of different workspace managers is mutually exclusive. - + **Command line:** + ```bash gita clone --preserve-path --from-file .gita-workspace.csv ``` @@ -124,67 +117,34 @@ You can make local changes to each module, which will be directly reflected in t ## Known Issues โš ๏ธ -### Orchestrator -**Issue:** Direct toolchain loading at `BUILD:14` -``` -load("@score_toolchains_qnx//rules/fs:ifs.bzl", "qnx_ifs") -``` -**Resolution needed:** Refactor to use proper toolchain resolution instead of direct load statements. - -**Issue:** clang needs to be installed -``` -sudo apt install clang -``` -**Resolution needed:** why is this happening with -extra_toolchains=@gcc_toolchain//:host_gcc_12 ? - ### Communication + **Module:** `score/mw/com/requirements` **Issues when building from external repository:** + 1. **Label inconsistency:** Some `BUILD` files use `@//third_party` instead of `//third_party` (repository-qualified vs. local label). Should standardize on local labels within the module. 2. **Outdated path reference:** `runtime_test.cpp:get_path` checks for `safe_posix_platform` (likely obsolete module name) instead of `external/score_communication+/`. -### Persistency -**Test failures in `src/cpp/tests`:** -1. **Dependency misconfiguration:** `google_benchmark` should not be a dev-only dependency if required by tests. Consider separating benchmark targets. -2. **Compiler-specific issue in `test_kvs.cpp`:** Contains GCC-specific self-move handling that is incorrect and fails with GCC (only builds with LLVM). Needs portable fix or removal of undefined behavior. - -## Build Blockers ๐Ÿšง - -The following builds are currently failing: +### Coverage -### FEO (Full Build) -```bash -bazel build @feo//... --verbose_failures -``` - -### Persistency (Full Build) -```bash -bazel build --config x86_64-linux @score_persistency//src/... --verbose_failures -``` +Running coverage has to be executed on Ubuntu 22.04, newer versions are not supported and might have issues. ## System Dependencies -### Required Packages for FEO -Install the following system packages before building FEO: +Install the following system packages: + ```bash sudo apt-get update -sudo apt-get install -y protobuf-compiler libclang-dev +sudo apt-get install -y protobuf-compiler libclang-dev lcov ``` -## Pending Tasks ๐Ÿงช - -- [ ] Add test targets once cross-repository visibility constraints are clarified -- [ ] Normalize third-party label usage across all `BUILD` files -- [ ] Resolve FEO build failures -- [ ] Fix Persistency full build -- [ ] Address compiler-specific issues in test suites - ## Proxy & External Dependencies ๐ŸŒ ### Current Issue The `starpls.bzl` file ([source](https://github.com/eclipse-score/tooling/blob/main/starpls/starpls.bzl)) uses `curl` directly for downloading dependencies, which: + - Bypasses Bazel's managed fetch lifecycle and dependency tracking - Breaks reproducibility and remote caching expectations - May fail in corporate proxy-restricted environments @@ -201,19 +161,13 @@ export HTTPS_PROXY=http://127.0.0.1:3128 ``` Add this to your `MODULE.bazel`: + ```python local_path_override(module_name = "score_tooling", path = "../tooling") ``` -### Suggested Improvements -- Replace raw `curl` calls with Bazel `http_archive` or `repository_ctx.download` for reproducibility. -- Parameterize proxy usage via environment or Bazel config flags. - ## IDE support ### Rust Use `scripts/generate_rust_analyzer_support.sh` to generate rust_analyzer settings that will let VS Code work. - -## ๐Ÿ—‚ Notes -Keep this file updated as integration issues are resolved. Prefer converting ad-hoc shell steps into Bazel rules or documented scripts under `scripts/` for repeatability. \ No newline at end of file diff --git a/bazel_common/score_modules_target_sw.MODULE.bazel b/bazel_common/score_modules_target_sw.MODULE.bazel index b35cb7467d..63b3d3c853 100644 --- a/bazel_common/score_modules_target_sw.MODULE.bazel +++ b/bazel_common/score_modules_target_sw.MODULE.bazel @@ -15,10 +15,9 @@ # Do not edit manually - use scripts/known_good/update_module_from_known_good.py bazel_dep(name = "score_baselibs") -git_override( +single_version_override( module_name = "score_baselibs", - remote = "https://github.com/eclipse-score/baselibs.git", - commit = "158fe6a7b791c58f6eac5f7e4662b8db0cf9ac6e", + version = "0.2.4", patches = [ "//patches/baselibs:003-acl-fixes-for-aarch64.patch", ], @@ -26,10 +25,9 @@ git_override( ) bazel_dep(name = "score_baselibs_rust") -git_override( +single_version_override( module_name = "score_baselibs_rust", - remote = "https://github.com/eclipse-score/baselibs_rust.git", - commit = "9f781acfb6d1a8fa06012ce772b0befb304acf31", + version = "0.1.0", ) bazel_dep(name = "score_communication") @@ -44,40 +42,36 @@ git_override( ) bazel_dep(name = "score_persistency") -git_override( +single_version_override( module_name = "score_persistency", - remote = "https://github.com/eclipse-score/persistency.git", - commit = "9692dadab51c677183262e8870c5425ab1797c4f", + version = "0.3.0", patches = [ "//patches/persistency:fix-duplicated-needs-name.patch", + "//patches/persistency:fix-bazel-dev-dep.patch", ], patch_strip = 1, ) bazel_dep(name = "score_orchestrator") -git_override( +single_version_override( module_name = "score_orchestrator", - remote = "https://github.com/eclipse-score/orchestrator.git", - commit = "675007a2baa226fad1e2979ed732360dc111d056", + version = "0.1.0", ) bazel_dep(name = "score_kyron") -git_override( +single_version_override( module_name = "score_kyron", - remote = "https://github.com/eclipse-score/kyron.git", - commit = "d4d0afc1dd733a0c8a4aba9cc2b2b3a58d38ebf6", + version = "0.1.1", ) bazel_dep(name = "score_lifecycle_health") -git_override( +single_version_override( module_name = "score_lifecycle_health", - remote = "https://github.com/eclipse-score/lifecycle.git", - commit = "14ee704eeac03e03ca10bece5de8b694d3c5e2dd", + version = "0.1.0", ) bazel_dep(name = "score_logging") -git_override( +single_version_override( module_name = "score_logging", - remote = "https://github.com/qorix-group/logging.git", - commit = "3718923aafc273531b1d0b3a240d821db24afbbc", + version = "0.1.0", ) diff --git a/bazel_common/score_modules_tooling.MODULE.bazel b/bazel_common/score_modules_tooling.MODULE.bazel index 8d907db7eb..8ad1252cad 100644 --- a/bazel_common/score_modules_tooling.MODULE.bazel +++ b/bazel_common/score_modules_tooling.MODULE.bazel @@ -46,10 +46,9 @@ single_version_override( ) bazel_dep(name = "score_test_scenarios") -git_override( +single_version_override( module_name = "score_test_scenarios", - remote = "https://github.com/eclipse-score/testing_tools.git", - commit = "6b5e85863e8fb5687251c19f5bb81e0a3afdf581", + version = "0.4.0", ) bazel_dep(name = "score_docs_as_code") @@ -63,8 +62,7 @@ single_version_override( ) bazel_dep(name = "score_process") -git_override( +single_version_override( module_name = "score_process", - remote = "https://github.com/eclipse-score/process_description.git", - commit = "6c772cf05a493218a5ac6071361bf0b66c5427b2", + version = "1.4.3", ) diff --git a/known_good.json b/known_good.json index a10dd355c6..8474bccf43 100644 --- a/known_good.json +++ b/known_good.json @@ -3,7 +3,7 @@ "target_sw": { "score_baselibs": { "repo": "https://github.com/eclipse-score/baselibs.git", - "hash": "158fe6a7b791c58f6eac5f7e4662b8db0cf9ac6e", + "version": "0.2.4", "bazel_patches": [ "//patches/baselibs:003-acl-fixes-for-aarch64.patch" ], @@ -25,7 +25,7 @@ }, "score_baselibs_rust": { "repo": "https://github.com/eclipse-score/baselibs_rust.git", - "hash": "9f781acfb6d1a8fa06012ce772b0befb304acf31", + "version": "0.1.0", "metadata": { "code_root_path": "//src/...", "exclude_test_targets": [ @@ -54,9 +54,10 @@ }, "score_persistency": { "repo": "https://github.com/eclipse-score/persistency.git", - "hash": "9692dadab51c677183262e8870c5425ab1797c4f", + "version": "0.3.0", "bazel_patches": [ - "//patches/persistency:fix-duplicated-needs-name.patch" + "//patches/persistency:fix-duplicated-needs-name.patch", + "//patches/persistency:fix-bazel-dev-dep.patch" ], "metadata": { "code_root_path": "//src/...", @@ -67,7 +68,7 @@ }, "score_orchestrator": { "repo": "https://github.com/eclipse-score/orchestrator.git", - "hash": "675007a2baa226fad1e2979ed732360dc111d056", + "version": "0.1.0", "metadata": { "code_root_path": "//src/...", "langs": [ @@ -77,7 +78,7 @@ }, "score_kyron": { "repo": "https://github.com/eclipse-score/kyron.git", - "hash": "d4d0afc1dd733a0c8a4aba9cc2b2b3a58d38ebf6", + "version": "0.1.1", "metadata": { "code_root_path": "//src/...", "langs": [ @@ -87,20 +88,20 @@ }, "score_lifecycle_health": { "repo": "https://github.com/eclipse-score/lifecycle.git", - "hash": "14ee704eeac03e03ca10bece5de8b694d3c5e2dd", + "version": "0.1.0", "metadata": { "code_root_path": "//src/..." } }, "score_logging": { - "repo": "https://github.com/qorix-group/logging.git", - "hash": "3718923aafc273531b1d0b3a240d821db24afbbc", + "repo": "https://github.com/eclipse-score/logging.git", + "version": "0.1.0", "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:enable_dynamic_configuration=False", "//score/datarouter/build_configuration_flags:file_transfer=False", "//score/datarouter/build_configuration_flags:use_local_vlan=True" ], @@ -137,7 +138,7 @@ }, "score_test_scenarios": { "repo": "https://github.com/eclipse-score/testing_tools.git", - "hash": "6b5e85863e8fb5687251c19f5bb81e0a3afdf581" + "version": "0.4.0" }, "score_docs_as_code": { "repo": "https://github.com/eclipse-score/docs-as-code.git", @@ -148,7 +149,7 @@ }, "score_process": { "repo": "https://github.com/eclipse-score/process_description.git", - "hash": "6c772cf05a493218a5ac6071361bf0b66c5427b2" + "version": "1.4.3" } } }, diff --git a/patches/persistency/fix-bazel-dev-dep.patch b/patches/persistency/fix-bazel-dev-dep.patch new file mode 100644 index 0000000000..c398a4c0a8 --- /dev/null +++ b/patches/persistency/fix-bazel-dev-dep.patch @@ -0,0 +1,14 @@ +diff --git a/MODULE.bazel b/MODULE.bazel +index 45cd5c0..da5aa9e 100644 +--- a/MODULE.bazel ++++ b/MODULE.bazel +@@ -66,8 +66,8 @@ bazel_dep(name = "platforms", version = "1.0.0") + ## S-CORE bazel registry + bazel_dep(name = "score_baselibs", version = "0.2.4") + bazel_dep(name = "score_bazel_platforms", version = "0.0.4") ++bazel_dep(name = "score_docs_as_code", version = "3.0.0") + +-bazel_dep(name = "score_docs_as_code", version = "3.0.0", dev_dependency = True) + bazel_dep(name = "score_platform", version = "0.5.3", dev_dependency = True) + bazel_dep(name = "score_process", version = "1.4.3", dev_dependency = True) + diff --git a/patches/persistency/fix-duplicated-needs-name.patch b/patches/persistency/fix-duplicated-needs-name.patch index 410aa312f8..b9caf7c2c6 100644 --- a/patches/persistency/fix-duplicated-needs-name.patch +++ b/patches/persistency/fix-duplicated-needs-name.patch @@ -1,9 +1,10 @@ diff --git a/docs/persistency/kvs/docs/requirements/statistics.rst b/docs/persistency/kvs/docs/requirements/statistics.rst -index b109225..20f8fb6 100644 +index b109225..3b56254 100644 --- a/docs/persistency/kvs/docs/requirements/statistics.rst +++ b/docs/persistency/kvs/docs/requirements/statistics.rst @@ -1,12 +1,12 @@ - .. _statistics: +-.. _statistics: ++.. _persistency_statistics: -Component Requirements Statistics -=================================