From ec1b4085e9d22fcbb196b0d857def8c1e2ebdb0f Mon Sep 17 00:00:00 2001 From: Alexander Lanin Date: Tue, 7 Oct 2025 00:35:01 +0200 Subject: [PATCH 01/33] add basic bazel files --- .bazelrc | 14 ++++ .devcontainer.json | 4 + BUILD | 21 ++++++ MODULE.bazel | 167 ++++++++++++++++++++++++++++++++++++++++++ docs/requirements.txt | 1 + 5 files changed, 207 insertions(+) create mode 100644 .bazelrc create mode 100644 .devcontainer.json create mode 100644 BUILD create mode 100644 MODULE.bazel create mode 100644 docs/requirements.txt diff --git a/.bazelrc b/.bazelrc new file mode 100644 index 000000000..6863d998c --- /dev/null +++ b/.bazelrc @@ -0,0 +1,14 @@ +build --java_language_version=17 +build --tool_java_language_version=17 +build --java_runtime_version=remotejdk_17 +build --tool_java_runtime_version=remotejdk_17 + +test --test_output=errors + +# stop legacy behavior of creating __init__.py files +build --incompatible_default_to_explicit_init_py + +common --registry=https://raw.githubusercontent.com/eclipse-score/bazel_registry/main/ +common --registry=https://bcr.bazel.build + +common --incompatible_disallow_empty_glob diff --git a/.devcontainer.json b/.devcontainer.json new file mode 100644 index 000000000..6627b610d --- /dev/null +++ b/.devcontainer.json @@ -0,0 +1,4 @@ +{ + "image": "ghcr.io/eclipse-score/devcontainer:latest", + "updateContentCommand": "bazel run //:ide_support" +} diff --git a/BUILD b/BUILD new file mode 100644 index 000000000..e5918c348 --- /dev/null +++ b/BUILD @@ -0,0 +1,21 @@ +# ******************************************************************************* +# Copyright (c) 2025 Contributors to the Eclipse Foundation +# +# See the NOTICE file(s) distributed with this work for additional +# information regarding copyright ownership. +# +# This program and the accompanying materials are made available under the +# terms of the Apache License Version 2.0 which is available at +# https://www.apache.org/licenses/LICENSE-2.0 +# +# SPDX-License-Identifier: Apache-2.0 +# ******************************************************************************* + +load("//:docs.bzl", "docs") + +docs( + data = [ + # TODO: add all modules that have docs + ], + source_dir = "docs", +) diff --git a/MODULE.bazel b/MODULE.bazel new file mode 100644 index 000000000..d4d413237 --- /dev/null +++ b/MODULE.bazel @@ -0,0 +1,167 @@ +# ******************************************************************************* +# Copyright (c) 2025 Contributors to the Eclipse Foundation +# +# See the NOTICE file(s) distributed with this work for additional +# information regarding copyright ownership. +# +# This program and the accompanying materials are made available under the +# terms of the Apache License Version 2.0 which is available at +# https://www.apache.org/licenses/LICENSE-2.0 +# +# SPDX-License-Identifier: Apache-2.0 +# ******************************************************************************* + +module( + name = "score_reference_integration", + version = "0.0.0", + compatibility_level = 0, +) + +# Dependencies for integration + +## --- feo --- + +# TODO: rename feo to score_feo +# TODO: feo does not have a single release yet. It's not in the registry. +bazel_dep(name = "feo", version = "0.0.0") +git_override( + module_name = "feo", + remote = "https://github.com/eclipse-score/feo.git", + # 2025-10-07 + commit = "086f3c0971805dd72a963bba7b4f99134b19620f", +) + +## --- logging --- + +# # TODO: wrong repo?? +# # TODO: name it score_logging +# bazel_dep(name = "logging... well they don't have a name yet", version = "0.0.0") + +# # TODO: logging does not have a single release yet. It's not in the registry. +# git_override( +# module_name = "logging... well they don't have a name yet", +# remote = "https://github.com/eclipse-score/logging.git", +# # 2025-10-07 +# commit = "I93394c8d7e6958d4568e26ffe3fb832c2eb63631", +# ) + + +## --- persistency --- + +# TODO: score_persistency does not have a single release yet. It's not in the registry. +# TODO: rename repo inc_mw_per to persistency +bazel_dep(name = "score_persistency", version = "0.1.0") +git_override( + module_name = "score_persistency", + remote = "https://github.com/eclipse-score/inc_mw_per.git", + # 2025-10-07 + commit = "b3023ed3eb0f0eaef601af87f50cea31a992150a", +) + + +## --- platform --- + +# for building documentation, verifying traceability etc. +bazel_dep(name = "score_platform", version = "0.3.0") + +## -- orchestration --- + +# TODO: rename inc_orchestrator to score_orchestrator, introduce semver +# TODO: inc_orchestrator does not have a single release yet. It's not in the registry. +bazel_dep(name = "inc_orchestrator") +git_override( + module_name = "inc_orchestrator", + remote = "https://github.com/eclipse-score/inc_orchestrator.git", + # 2025-10-07 + commit = "9f8ed482bdf786117eb3c4c1be14a1ee58a120ab", +) + +## --- communication --- + +# TODO: rename communication to score_communication, introduce semver +# TODO: communication does not have a single release yet. It's not in the registry. +bazel_dep(name = "communication") +git_override( + module_name = "communication", + remote = "https://github.com/eclipse-score/communication.git", + # 2025-10-07 + commit = "dd17d1229b92fe63a6e7dd7194a8d63ea98a8a4f", +) + +## --- baselibs --- + +# TODO: rename score-baselibs to score_baselibs, use semver +# TODO: score-baselibs does not have a single release yet. It's not in the registry. +bazel_dep(name = "score-baselibs", version = "0.0.0") +git_override( + module_name = "score-baselibs", + remote = "https://github.com/eclipse-score/baselibs.git", + # 2025-10-07 + commit = "f02d7f427df1968df8d5f9f9aa85bf68baeb839e", +) + +# Tooling + +bazel_dep(name="score_docs_as_code", version = "1.3.0") + +# TODO: rename to a better suitable name, with score_ prefix +# TODO: it's not in the registry +# TODO: this is from qorix?? +bazel_dep(name = "testing-utils") +git_override( + module_name = "testing-utils", + commit = "a847c7464cfa47e000141631d1223b92560d2e58", # tag v0.2.0 + remote = "https://github.com/qorix-group/testing_tools.git", +) + +# TODO: whats that? +archive_override( + module_name = "rules_boost", + strip_prefix = "rules_boost-master", + urls = ["https://github.com/nelhage/rules_boost/archive/refs/heads/master.tar.gz"], +) + +# TODO: we cannot use communication without including TRLC here? +bazel_dep(name = "trlc", version = "0.0.0") +git_override( + module_name = "trlc", + remote = "https://github.com/bmw-software-engineering/trlc.git", + commit = "650b51a47264a4f232b3341f473527710fc32669", # trlc-2.0.2 release +) + +# System/Basics + +## Python +bazel_dep(name = "rules_python", version = "1.4.1") + +PYTHON_VERSION = "3.12" + +python = use_extension("@rules_python//python/extensions:python.bzl", "python") +python.toolchain( + configure_coverage_tool = True, + is_default = True, + python_version = PYTHON_VERSION, +) +use_repo(python) + +## Sphinx +pip = use_extension("@rules_python//python/extensions:pip.bzl", "pip") +pip.parse( + envsubst = ["PIP_INDEX_URL"], + extra_pip_args = ["--index-url=${PIP_INDEX_URL:-https://pypi.org/simple/}"], + hub_name = "pip_docs", + python_version = PYTHON_VERSION, + requirements_lock = "//docs:requirements.txt", +) +use_repo(pip, "pip_docs") + +# PlantUML for docs +bazel_dep(name = "rules_java", version = "8.15.1") + +http_jar = use_repo_rule("@bazel_tools//tools/build_defs/repo:http.bzl", "http_jar") + +http_jar( + name = "plantuml", + sha256 = "6f38f70455d08438979451c2257cd5d58647c6460094bb829bc2a12878d47331", + url = "https://github.com/plantuml/plantuml/releases/download/v1.2025.0/plantuml-1.2025.0.jar", +) diff --git a/docs/requirements.txt b/docs/requirements.txt new file mode 100644 index 000000000..fdffa2a0f --- /dev/null +++ b/docs/requirements.txt @@ -0,0 +1 @@ +# placeholder From b8ce356ba7e0e58fe681b6bf84d9784dc6c55fce Mon Sep 17 00:00:00 2001 From: Alexander Lanin Date: Wed, 8 Oct 2025 22:54:45 +0200 Subject: [PATCH 02/33] ignore qnx_qemu --- .bazelignore | 1 + 1 file changed, 1 insertion(+) create mode 100644 .bazelignore diff --git a/.bazelignore b/.bazelignore new file mode 100644 index 000000000..1dc4fc581 --- /dev/null +++ b/.bazelignore @@ -0,0 +1 @@ +qnx_qemu From 39bb13626709d97f12cda3ac3795f81372ee59cb Mon Sep 17 00:00:00 2001 From: Alexander Lanin Date: Wed, 8 Oct 2025 23:27:26 +0200 Subject: [PATCH 03/33] fix docs --- BUILD | 2 +- MODULE.bazel | 53 +++++++++++++++++++++------------------------------- 2 files changed, 22 insertions(+), 33 deletions(-) diff --git a/BUILD b/BUILD index e5918c348..65d2bbbab 100644 --- a/BUILD +++ b/BUILD @@ -11,7 +11,7 @@ # SPDX-License-Identifier: Apache-2.0 # ******************************************************************************* -load("//:docs.bzl", "docs") +load("@score_docs_as_code//:docs.bzl", "docs") docs( data = [ diff --git a/MODULE.bazel b/MODULE.bazel index d4d413237..dbd8cdfdf 100644 --- a/MODULE.bazel +++ b/MODULE.bazel @@ -106,7 +106,7 @@ bazel_dep(name="score_docs_as_code", version = "1.3.0") # TODO: rename to a better suitable name, with score_ prefix # TODO: it's not in the registry -# TODO: this is from qorix?? +# TODO: this is directly from qorix?? bazel_dep(name = "testing-utils") git_override( module_name = "testing-utils", @@ -132,36 +132,25 @@ git_override( # System/Basics ## Python -bazel_dep(name = "rules_python", version = "1.4.1") +# bazel_dep(name = "rules_python", version = "1.4.1") -PYTHON_VERSION = "3.12" +# PYTHON_VERSION = "3.12" -python = use_extension("@rules_python//python/extensions:python.bzl", "python") -python.toolchain( - configure_coverage_tool = True, - is_default = True, - python_version = PYTHON_VERSION, -) -use_repo(python) - -## Sphinx -pip = use_extension("@rules_python//python/extensions:pip.bzl", "pip") -pip.parse( - envsubst = ["PIP_INDEX_URL"], - extra_pip_args = ["--index-url=${PIP_INDEX_URL:-https://pypi.org/simple/}"], - hub_name = "pip_docs", - python_version = PYTHON_VERSION, - requirements_lock = "//docs:requirements.txt", -) -use_repo(pip, "pip_docs") - -# PlantUML for docs -bazel_dep(name = "rules_java", version = "8.15.1") - -http_jar = use_repo_rule("@bazel_tools//tools/build_defs/repo:http.bzl", "http_jar") - -http_jar( - name = "plantuml", - sha256 = "6f38f70455d08438979451c2257cd5d58647c6460094bb829bc2a12878d47331", - url = "https://github.com/plantuml/plantuml/releases/download/v1.2025.0/plantuml-1.2025.0.jar", -) +# python = use_extension("@rules_python//python/extensions:python.bzl", "python") +# python.toolchain( +# configure_coverage_tool = True, +# is_default = True, +# python_version = PYTHON_VERSION, +# ) +# use_repo(python) + +# Once we need python requirements: +# pip = use_extension("@rules_python//python/extensions:pip.bzl", "pip") +# pip.parse( +# envsubst = ["PIP_INDEX_URL"], +# extra_pip_args = ["--index-url=${PIP_INDEX_URL:-https://pypi.org/simple/}"], +# hub_name = "pip_docs", +# python_version = PYTHON_VERSION, +# requirements_lock = "//requirements.txt", +# ) +# use_repo(pip, "pip_docs") From 1c5df3e675e7fd0254f161d80c517a8a0028666b Mon Sep 17 00:00:00 2001 From: Alexander Lanin Date: Thu, 9 Oct 2025 08:05:38 +0200 Subject: [PATCH 04/33] works: bazel query ... --- MODULE.bazel | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/MODULE.bazel b/MODULE.bazel index dbd8cdfdf..552d79a11 100644 --- a/MODULE.bazel +++ b/MODULE.bazel @@ -54,8 +54,8 @@ bazel_dep(name = "score_persistency", version = "0.1.0") git_override( module_name = "score_persistency", remote = "https://github.com/eclipse-score/inc_mw_per.git", - # 2025-10-07 - commit = "b3023ed3eb0f0eaef601af87f50cea31a992150a", + # 2025-10-09, PR-140 + commit = "e5759ddf481e7fb957908dcd077799c85edfe547", ) From f95e892c57bc04a17ca73ff52584e910ff973442 Mon Sep 17 00:00:00 2001 From: "Graeper Kai (ETAS-ECM/XPC-Hi)" Date: Mon, 13 Oct 2025 10:11:23 +0200 Subject: [PATCH 05/33] @score-baselibs//score/... working @feo//... wip --- .bazelrc | 4 + .bazelrc.baselibs | 26 ++++++ .gitignore | 1 + BUILD | 29 +++++-- MODULE.bazel | 208 ++++++++++++++++++++++++++++++++++------------ README.md | 20 +++++ 6 files changed, 227 insertions(+), 61 deletions(-) create mode 100644 .bazelrc.baselibs diff --git a/.bazelrc b/.bazelrc index 6863d998c..fd3b7dbbb 100644 --- a/.bazelrc +++ b/.bazelrc @@ -12,3 +12,7 @@ common --registry=https://raw.githubusercontent.com/eclipse-score/bazel_registry common --registry=https://bcr.bazel.build common --incompatible_disallow_empty_glob + +try-import %workspace%/.bazelrc.baselibs + +try-import %workspace%/.bazelrc.user diff --git a/.bazelrc.baselibs b/.bazelrc.baselibs new file mode 100644 index 000000000..06daeb1bf --- /dev/null +++ b/.bazelrc.baselibs @@ -0,0 +1,26 @@ +# use mw/log stub implementation by default +build:_bl_common_stub --@score-baselibs//score/mw/log/detail/flags:KUse_Stub_Implementation_Only=False +build:_bl_common_stub --@score-baselibs//score/mw/log/flags:KRemote_Logging=False +build:_bl_common_stub --@score-baselibs//score/json:base_library=nlohmann + +# use mw/log stub implementation by default +build:_bl_common --config=_bl_common_stub +build:_bl_common --incompatible_strict_action_env +build:_bl_common --host_platform=@score_bazel_platforms//:x86_64-linux + +# This config us for internal module usage ONLY. +build:bl-x86_64-linux --config=_bl_common +build:bl-x86_64-linux --platforms=@score_bazel_platforms//:x86_64-linux +build:bl-x86_64-linux --extra_toolchains=@gcc_toolchain//:host_gcc_12 + +# This config us for internal module usage ONLY. +build:bl-x86_64-qnx --config=_bl_common +build:bl-x86_64-qnx --platforms=@score_bazel_platforms//:x86_64-qnx +build:bl-x86_64-qnx --extra_toolchains=@toolchains_qnx_qcc//:qcc_x86_64 + +# This config us for internal module usage ONLY. +test:bl-x86_64-linux --config=_bl_common +test:bl-x86_64-linux --build_tests_only +test:bl-x86_64-linux --test_tag_filters=-manual +test:bl-x86_64-linux --test_output=errors + diff --git a/.gitignore b/.gitignore index 6c272cae4..c4061c75b 100644 --- a/.gitignore +++ b/.gitignore @@ -1,6 +1,7 @@ # Bazel bazel-* MODULE.bazel.lock +.bazelrc.user # Ruff .ruff_cache diff --git a/BUILD b/BUILD index 65d2bbbab..5801e6584 100644 --- a/BUILD +++ b/BUILD @@ -11,11 +11,28 @@ # SPDX-License-Identifier: Apache-2.0 # ******************************************************************************* -load("@score_docs_as_code//:docs.bzl", "docs") +# load("@score_docs_as_code//:docs.bzl", "docs") -docs( - data = [ - # TODO: add all modules that have docs - ], - source_dir = "docs", +# docs( +# data = [ +# # TODO: add all modules that have docs +# ], +# source_dir = "docs", +# ) + +# Simple filegroup target to demonstrate the build system works +filegroup( + name = "readme", + srcs = ["README.md"], + visibility = ["//visibility:public"], ) + +# Try to build feo rust components using local cargo +load("@rules_rust//rust:defs.bzl", "rust_library") + +# This might work if we can access the feo source directly +# rust_library( +# name = "feo_integration_test", +# srcs = ["@feo//feo:src/lib.rs"], +# deps = ["@cargo//:tracing"], +# ) diff --git a/MODULE.bazel b/MODULE.bazel index 552d79a11..d045981bc 100644 --- a/MODULE.bazel +++ b/MODULE.bazel @@ -23,13 +23,20 @@ module( # TODO: rename feo to score_feo # TODO: feo does not have a single release yet. It's not in the registry. +# TODO: need to install +# TODO: sudo apt-get install protobuf-compiler +# TODO: sudo apt-get install libclang-dev bazel_dep(name = "feo", version = "0.0.0") -git_override( +local_path_override( module_name = "feo", - remote = "https://github.com/eclipse-score/feo.git", - # 2025-10-07 - commit = "086f3c0971805dd72a963bba7b4f99134b19620f", + path = "../feo" ) +# git_override( +# module_name = "feo", +# remote = "https://github.com/eclipse-score/feo.git", +# # 2025-10-07 +# commit = "086f3c0971805dd72a963bba7b4f99134b19620f", +# ) ## --- logging --- @@ -50,43 +57,43 @@ git_override( # TODO: score_persistency does not have a single release yet. It's not in the registry. # TODO: rename repo inc_mw_per to persistency -bazel_dep(name = "score_persistency", version = "0.1.0") -git_override( - module_name = "score_persistency", - remote = "https://github.com/eclipse-score/inc_mw_per.git", - # 2025-10-09, PR-140 - commit = "e5759ddf481e7fb957908dcd077799c85edfe547", -) +# bazel_dep(name = "score_persistency", version = "0.1.0") +# git_override( +# module_name = "score_persistency", +# remote = "https://github.com/eclipse-score/inc_mw_per.git", +# # 2025-10-09, PR-140 +# commit = "e5759ddf481e7fb957908dcd077799c85edfe547", +# ) ## --- platform --- # for building documentation, verifying traceability etc. -bazel_dep(name = "score_platform", version = "0.3.0") +# bazel_dep(name = "score_platform", version = "0.3.0") ## -- orchestration --- # TODO: rename inc_orchestrator to score_orchestrator, introduce semver # TODO: inc_orchestrator does not have a single release yet. It's not in the registry. -bazel_dep(name = "inc_orchestrator") -git_override( - module_name = "inc_orchestrator", - remote = "https://github.com/eclipse-score/inc_orchestrator.git", - # 2025-10-07 - commit = "9f8ed482bdf786117eb3c4c1be14a1ee58a120ab", -) +# bazel_dep(name = "inc_orchestrator") +# git_override( +# module_name = "inc_orchestrator", +# remote = "https://github.com/eclipse-score/inc_orchestrator.git", +# # 2025-10-07 +# commit = "9f8ed482bdf786117eb3c4c1be14a1ee58a120ab", +# ) ## --- communication --- # TODO: rename communication to score_communication, introduce semver # TODO: communication does not have a single release yet. It's not in the registry. -bazel_dep(name = "communication") -git_override( - module_name = "communication", - remote = "https://github.com/eclipse-score/communication.git", - # 2025-10-07 - commit = "dd17d1229b92fe63a6e7dd7194a8d63ea98a8a4f", -) +# bazel_dep(name = "communication") +# git_override( +# module_name = "communication", +# remote = "https://github.com/eclipse-score/communication.git", +# # 2025-10-07 +# commit = "dd17d1229b92fe63a6e7dd7194a8d63ea98a8a4f", +# ) ## --- baselibs --- @@ -99,50 +106,141 @@ git_override( # 2025-10-07 commit = "f02d7f427df1968df8d5f9f9aa85bf68baeb839e", ) +bazel_dep(name = "score_bazel_platforms", version = "0.0.2") # Tooling +bazel_dep(name = "score_tooling", version = "0.0.0") +local_path_override( + module_name = "score_tooling", + path = "../tooling" +) +# git_override( +# module_name = "score_tooling", +# remote = "https://github.com/eclipse-score/tooling.git", +# # 2025-10-10 +# commit = "b8f58954485d8a19856a3aacdc69a6cbdd12972d", +# ) -bazel_dep(name="score_docs_as_code", version = "1.3.0") +#gcc toolchain for baselibs +bazel_dep(name = "score_toolchains_gcc", version = "0.4", dev_dependency=False) +gcc = use_extension("@score_toolchains_gcc//extentions:gcc.bzl", "gcc", dev_dependency=False) +gcc.toolchain( + url = "https://github.com/eclipse-score/toolchains_gcc_packages/releases/download/0.0.1/x86_64-unknown-linux-gnu_gcc12.tar.gz", + sha256 = "457f5f20f57528033cb840d708b507050d711ae93e009388847e113b11bf3600", + strip_prefix = "x86_64-unknown-linux-gnu", +) +gcc.extra_features( + features = [ + "minimal_warnings", + "treat_warnings_as_errors", + ], +) +gcc.warning_flags( + minimal_warnings = ["-Wall", "-Wno-error=deprecated-declarations", "-Wno-error=narrowing"], + strict_warnings = ["-Wextra", "-Wpedantic"], +) +use_repo(gcc, "gcc_toolchain", "gcc_toolchain_gcc") + +# LLVM Toolchains +bazel_dep(name = "toolchains_llvm", version = "1.4.0") +llvm = use_extension("@toolchains_llvm//toolchain/extensions:llvm.bzl", "llvm") +llvm.toolchain( + cxx_standard = {"": "c++17"}, + llvm_version = "19.1.0", +) +use_repo(llvm, "llvm_toolchain") +use_repo(llvm, "llvm_toolchain_llvm") + +register_toolchains("@llvm_toolchain//:all") + + +# Rust + +bazel_dep(name = "rules_rust", version = "0.63.0") +RUST_EDITION = "2021" + +RUST_VERSION = "1.83.0" +# Expose rust toolchain to downstream repos (feo) by not marking as dev_dependency +rust = use_extension("@rules_rust//rust:extensions.bzl", "rust", dev_dependency=False) +rust.toolchain( + edition = RUST_EDITION, + sha256s = { + "rustc-1.83.0-x86_64-unknown-linux-gnu.tar.xz": "6ec40e0405c8cbed3b786a97d374c144b012fc831b7c22b535f8ecb524f495ad", + "clippy-1.83.0-x86_64-unknown-linux-gnu.tar.xz": "ef6c05abcfd861ff0bca41d408e126dda195dc966ee35abee57645a12d418f5b", + "cargo-1.83.0-x86_64-unknown-linux-gnu.tar.xz": "de834a4062d9cd200f8e0cdca894c0b98afe26f1396d80765df828880a39b98c", + "llvm-tools-1.83.0-x86_64-unknown-linux-gnu.tar.xz": "b931673b309c229e234f03271aaa777ea149c3c41f0fb43f3ef13a272540299a", + "rust-std-1.83.0-x86_64-unknown-linux-gnu.tar.xz": "c88fe6cb22f9d2721f26430b6bdd291e562da759e8629e2b4c7eb2c7cad705f2", + }, + versions = [RUST_VERSION], +) +use_repo(rust, "rust_toolchains") + +# Provide crate universe (Cargo deps) globally (needed by @feo) +crate = use_extension("@rules_rust//crate_universe:extensions.bzl", "crate", dev_dependency=False) +crate.from_cargo( + name = "cargo", + cargo_lockfile = "@feo//:Cargo.lock", + manifests = [ + "@feo//:Cargo.toml", + "@feo//examples/rust/cycle-benchmark:Cargo.toml", + "@feo//examples/rust/mini-adas:Cargo.toml", + "@feo//feo:Cargo.toml", + "@feo//feo-com:Cargo.toml", + "@feo//feo-cpp-build:Cargo.toml", + "@feo//feo-cpp-macros:Cargo.toml", + "@feo//feo-log:Cargo.toml", + "@feo//feo-logger:Cargo.toml", + "@feo//feo-time:Cargo.toml", + "@feo//feo-tracer:Cargo.toml", + "@feo//feo-tracing:Cargo.toml", + "@feo//logd:Cargo.toml", + "@feo//perfetto-model:Cargo.toml", + ], +) +use_repo(crate, "cargo") +# -------- + +# bazel_dep(name="score_docs_as_code", version = "1.3.0") # TODO: rename to a better suitable name, with score_ prefix # TODO: it's not in the registry # TODO: this is directly from qorix?? -bazel_dep(name = "testing-utils") -git_override( - module_name = "testing-utils", - commit = "a847c7464cfa47e000141631d1223b92560d2e58", # tag v0.2.0 - remote = "https://github.com/qorix-group/testing_tools.git", -) +# bazel_dep(name = "testing-utils") +# git_override( +# module_name = "testing-utils", +# commit = "a847c7464cfa47e000141631d1223b92560d2e58", # tag v0.2.0 +# remote = "https://github.com/qorix-group/testing_tools.git", +# ) -# TODO: whats that? -archive_override( - module_name = "rules_boost", - strip_prefix = "rules_boost-master", - urls = ["https://github.com/nelhage/rules_boost/archive/refs/heads/master.tar.gz"], -) +# # TODO: whats that? +# archive_override( +# module_name = "rules_boost", +# strip_prefix = "rules_boost-master", +# urls = ["https://github.com/nelhage/rules_boost/archive/refs/heads/master.tar.gz"], +# ) -# TODO: we cannot use communication without including TRLC here? -bazel_dep(name = "trlc", version = "0.0.0") -git_override( - module_name = "trlc", - remote = "https://github.com/bmw-software-engineering/trlc.git", - commit = "650b51a47264a4f232b3341f473527710fc32669", # trlc-2.0.2 release -) +# # TODO: we cannot use communication without including TRLC here? +# bazel_dep(name = "trlc", version = "0.0.0") +# git_override( +# module_name = "trlc", +# remote = "https://github.com/bmw-software-engineering/trlc.git", +# commit = "650b51a47264a4f232b3341f473527710fc32669", # trlc-2.0.2 release +# ) # System/Basics ## Python -# bazel_dep(name = "rules_python", version = "1.4.1") +bazel_dep(name = "rules_python", version = "1.4.1") -# PYTHON_VERSION = "3.12" +PYTHON_VERSION = "3.12" -# python = use_extension("@rules_python//python/extensions:python.bzl", "python") -# python.toolchain( -# configure_coverage_tool = True, -# is_default = True, -# python_version = PYTHON_VERSION, -# ) -# use_repo(python) +python = use_extension("@rules_python//python/extensions:python.bzl", "python") +python.toolchain( + configure_coverage_tool = True, + is_default = True, + python_version = PYTHON_VERSION, +) +use_repo(python) # Once we need python requirements: # pip = use_extension("@rules_python//python/extensions:pip.bzl", "pip") diff --git a/README.md b/README.md index 9a09bd208..5aeb718c8 100644 --- a/README.md +++ b/README.md @@ -1,2 +1,22 @@ # reference_integration Score project integration repository + +not working: +bazel build @feo//... --verbose_failures +need to install +sudo apt-get install protobuf-compiler +sudo apt-get install libclang-dev + +https://github.com/eclipse-score/tooling/blob/main/starpls/starpls.bzl +uses curl, which does not work with proxy +possible workaround in the script: + local_path_override(module_name = "score_tooling",path = "../tooling") + export "http_proxy=http://127.0.0.1:3128" + export "https_proxy=http://127.0.0.1:3128" + export "HTTP_PROXY=http://127.0.0.1:3128" + export "HTTPS_PROXY=http://127.0.0.1:3128" + + +working: + +bazel build --config bl-x86_64-linux @score-baselibs//score/... --verbose_failures \ No newline at end of file From 3c43c1ccd566cec3fa95c1525144739f11b9757a Mon Sep 17 00:00:00 2001 From: "Graeper Kai (ETAS-ECM/XPC-Hi)" Date: Fri, 17 Oct 2025 14:32:50 +0200 Subject: [PATCH 06/33] com working --- .bazelrc | 14 ++++ MODULE.bazel | 184 ++++++++++++++++++++++++++------------------------- README.md | 30 +++++++-- 3 files changed, 131 insertions(+), 97 deletions(-) diff --git a/.bazelrc b/.bazelrc index fd3b7dbbb..fc504addd 100644 --- a/.bazelrc +++ b/.bazelrc @@ -13,6 +13,20 @@ common --registry=https://bcr.bazel.build common --incompatible_disallow_empty_glob +common --@score-baselibs//score/mw/log/detail/flags:KUse_Stub_Implementation_Only=False +common --@score-baselibs//score/mw/log/flags:KRemote_Logging=False +common --@score-baselibs//score/json:base_library=nlohmann +common --@communication//score/mw/com/flags:tracing_library=stub +common --extra_toolchains=@gcc_toolchain//:host_gcc_12 +build --incompatible_strict_action_env +test --test_tag_filters=-manual +build --experimental_retain_test_configuration_across_testonly #https://github.com/bazelbuild/bazel/issues/6842 + +# unshare /dev/shm and /tmp +test --sandbox_tmpfs_path=/dev/shm +test --sandbox_tmpfs_path=/tmp + try-import %workspace%/.bazelrc.baselibs try-import %workspace%/.bazelrc.user + diff --git a/MODULE.bazel b/MODULE.bazel index d045981bc..ab8e1df20 100644 --- a/MODULE.bazel +++ b/MODULE.bazel @@ -26,11 +26,11 @@ module( # TODO: need to install # TODO: sudo apt-get install protobuf-compiler # TODO: sudo apt-get install libclang-dev -bazel_dep(name = "feo", version = "0.0.0") -local_path_override( - module_name = "feo", - path = "../feo" -) +# bazel_dep(name = "feo", version = "0.0.0") +# local_path_override( +# module_name = "feo", +# path = "../feo" +# ) # git_override( # module_name = "feo", # remote = "https://github.com/eclipse-score/feo.git", @@ -57,43 +57,51 @@ local_path_override( # TODO: score_persistency does not have a single release yet. It's not in the registry. # TODO: rename repo inc_mw_per to persistency -# bazel_dep(name = "score_persistency", version = "0.1.0") -# git_override( -# module_name = "score_persistency", -# remote = "https://github.com/eclipse-score/inc_mw_per.git", -# # 2025-10-09, PR-140 -# commit = "e5759ddf481e7fb957908dcd077799c85edfe547", -# ) +bazel_dep(name = "score_persistency", version = "0.1.0") +git_override( + module_name = "score_persistency", + remote = "https://github.com/eclipse-score/inc_mw_per.git", + # 2025-10-09, PR-140 + commit = "e5759ddf481e7fb957908dcd077799c85edfe547", +) ## --- platform --- +bazel_dep(name = "platforms", version = "0.0.11") + +bazel_dep(name = "rules_cc", version = "0.2.1") +bazel_dep(name = "rules_license", version = "1.0.0") # for building documentation, verifying traceability etc. -# bazel_dep(name = "score_platform", version = "0.3.0") +bazel_dep(name = "score_platform", version = "0.3.0") ## -- orchestration --- # TODO: rename inc_orchestrator to score_orchestrator, introduce semver # TODO: inc_orchestrator does not have a single release yet. It's not in the registry. -# bazel_dep(name = "inc_orchestrator") -# git_override( -# module_name = "inc_orchestrator", -# remote = "https://github.com/eclipse-score/inc_orchestrator.git", -# # 2025-10-07 -# commit = "9f8ed482bdf786117eb3c4c1be14a1ee58a120ab", -# ) +bazel_dep(name = "inc_orchestrator") +git_override( + module_name = "inc_orchestrator", + remote = "https://github.com/eclipse-score/inc_orchestrator.git", + # 2025-10-07 + commit = "9f8ed482bdf786117eb3c4c1be14a1ee58a120ab", +) ## --- communication --- # TODO: rename communication to score_communication, introduce semver # TODO: communication does not have a single release yet. It's not in the registry. -# bazel_dep(name = "communication") +bazel_dep(name = "communication") # git_override( # module_name = "communication", # remote = "https://github.com/eclipse-score/communication.git", # # 2025-10-07 # commit = "dd17d1229b92fe63a6e7dd7194a8d63ea98a8a4f", # ) +local_path_override( + module_name = "communication", + path = "../communication" +) ## --- baselibs --- @@ -138,6 +146,7 @@ gcc.extra_features( gcc.warning_flags( minimal_warnings = ["-Wall", "-Wno-error=deprecated-declarations", "-Wno-error=narrowing"], strict_warnings = ["-Wextra", "-Wpedantic"], + treat_warnings_as_errors = ["-Werror"], # needed by com ) use_repo(gcc, "gcc_toolchain", "gcc_toolchain_gcc") @@ -154,50 +163,55 @@ use_repo(llvm, "llvm_toolchain_llvm") register_toolchains("@llvm_toolchain//:all") +bazel_dep(name = "rules_rust", version = "0.61.0") +bazel_dep(name = "score_crates", version = "0.0.2", repo_name = "crate_index") + +bazel_dep(name = "boost.program_options", version = "1.87.0") + # Rust -bazel_dep(name = "rules_rust", version = "0.63.0") -RUST_EDITION = "2021" - -RUST_VERSION = "1.83.0" -# Expose rust toolchain to downstream repos (feo) by not marking as dev_dependency -rust = use_extension("@rules_rust//rust:extensions.bzl", "rust", dev_dependency=False) -rust.toolchain( - edition = RUST_EDITION, - sha256s = { - "rustc-1.83.0-x86_64-unknown-linux-gnu.tar.xz": "6ec40e0405c8cbed3b786a97d374c144b012fc831b7c22b535f8ecb524f495ad", - "clippy-1.83.0-x86_64-unknown-linux-gnu.tar.xz": "ef6c05abcfd861ff0bca41d408e126dda195dc966ee35abee57645a12d418f5b", - "cargo-1.83.0-x86_64-unknown-linux-gnu.tar.xz": "de834a4062d9cd200f8e0cdca894c0b98afe26f1396d80765df828880a39b98c", - "llvm-tools-1.83.0-x86_64-unknown-linux-gnu.tar.xz": "b931673b309c229e234f03271aaa777ea149c3c41f0fb43f3ef13a272540299a", - "rust-std-1.83.0-x86_64-unknown-linux-gnu.tar.xz": "c88fe6cb22f9d2721f26430b6bdd291e562da759e8629e2b4c7eb2c7cad705f2", - }, - versions = [RUST_VERSION], -) -use_repo(rust, "rust_toolchains") - -# Provide crate universe (Cargo deps) globally (needed by @feo) -crate = use_extension("@rules_rust//crate_universe:extensions.bzl", "crate", dev_dependency=False) -crate.from_cargo( - name = "cargo", - cargo_lockfile = "@feo//:Cargo.lock", - manifests = [ - "@feo//:Cargo.toml", - "@feo//examples/rust/cycle-benchmark:Cargo.toml", - "@feo//examples/rust/mini-adas:Cargo.toml", - "@feo//feo:Cargo.toml", - "@feo//feo-com:Cargo.toml", - "@feo//feo-cpp-build:Cargo.toml", - "@feo//feo-cpp-macros:Cargo.toml", - "@feo//feo-log:Cargo.toml", - "@feo//feo-logger:Cargo.toml", - "@feo//feo-time:Cargo.toml", - "@feo//feo-tracer:Cargo.toml", - "@feo//feo-tracing:Cargo.toml", - "@feo//logd:Cargo.toml", - "@feo//perfetto-model:Cargo.toml", - ], -) -use_repo(crate, "cargo") +# bazel_dep(name = "rules_rust", version = "0.63.0") +# RUST_EDITION = "2021" + +# RUST_VERSION = "1.83.0" +# # Expose rust toolchain to downstream repos (feo) by not marking as dev_dependency +# rust = use_extension("@rules_rust//rust:extensions.bzl", "rust", dev_dependency=False) +# rust.toolchain( +# edition = RUST_EDITION, +# sha256s = { +# "rustc-1.83.0-x86_64-unknown-linux-gnu.tar.xz": "6ec40e0405c8cbed3b786a97d374c144b012fc831b7c22b535f8ecb524f495ad", +# "clippy-1.83.0-x86_64-unknown-linux-gnu.tar.xz": "ef6c05abcfd861ff0bca41d408e126dda195dc966ee35abee57645a12d418f5b", +# "cargo-1.83.0-x86_64-unknown-linux-gnu.tar.xz": "de834a4062d9cd200f8e0cdca894c0b98afe26f1396d80765df828880a39b98c", +# "llvm-tools-1.83.0-x86_64-unknown-linux-gnu.tar.xz": "b931673b309c229e234f03271aaa777ea149c3c41f0fb43f3ef13a272540299a", +# "rust-std-1.83.0-x86_64-unknown-linux-gnu.tar.xz": "c88fe6cb22f9d2721f26430b6bdd291e562da759e8629e2b4c7eb2c7cad705f2", +# }, +# versions = [RUST_VERSION], +# ) +# use_repo(rust, "rust_toolchains") + +# # Provide crate universe (Cargo deps) so that @feo's dev-only crate repo becomes available when building its targets from this integration workspace. +# crate = use_extension("@rules_rust//crate_universe:extensions.bzl", "crate", dev_dependency=False) +# crate.from_cargo( +# name = "cargo", +# cargo_lockfile = "@feo//:Cargo.lock", +# manifests = [ +# "@feo//:Cargo.toml", +# "@feo//examples/rust/cycle-benchmark:Cargo.toml", +# "@feo//examples/rust/mini-adas:Cargo.toml", +# "@feo//feo:Cargo.toml", +# "@feo//feo-com:Cargo.toml", +# "@feo//feo-cpp-build:Cargo.toml", +# "@feo//feo-cpp-macros:Cargo.toml", +# "@feo//feo-log:Cargo.toml", +# "@feo//feo-logger:Cargo.toml", +# "@feo//feo-time:Cargo.toml", +# "@feo//feo-tracer:Cargo.toml", +# "@feo//feo-tracing:Cargo.toml", +# "@feo//logd:Cargo.toml", +# "@feo//perfetto-model:Cargo.toml", +# ], +# ) +# use_repo(crate, "cargo") # -------- # bazel_dep(name="score_docs_as_code", version = "1.3.0") @@ -205,27 +219,27 @@ use_repo(crate, "cargo") # TODO: rename to a better suitable name, with score_ prefix # TODO: it's not in the registry # TODO: this is directly from qorix?? -# bazel_dep(name = "testing-utils") -# git_override( -# module_name = "testing-utils", -# commit = "a847c7464cfa47e000141631d1223b92560d2e58", # tag v0.2.0 -# remote = "https://github.com/qorix-group/testing_tools.git", -# ) +bazel_dep(name = "testing-utils") +git_override( + module_name = "testing-utils", + commit = "a847c7464cfa47e000141631d1223b92560d2e58", # tag v0.2.0 + remote = "https://github.com/qorix-group/testing_tools.git", +) # # TODO: whats that? -# archive_override( -# module_name = "rules_boost", -# strip_prefix = "rules_boost-master", -# urls = ["https://github.com/nelhage/rules_boost/archive/refs/heads/master.tar.gz"], -# ) +archive_override( + module_name = "rules_boost", + strip_prefix = "rules_boost-master", + urls = ["https://github.com/nelhage/rules_boost/archive/refs/heads/master.tar.gz"], +) # # TODO: we cannot use communication without including TRLC here? -# bazel_dep(name = "trlc", version = "0.0.0") -# git_override( -# module_name = "trlc", -# remote = "https://github.com/bmw-software-engineering/trlc.git", -# commit = "650b51a47264a4f232b3341f473527710fc32669", # trlc-2.0.2 release -# ) +bazel_dep(name = "trlc", version = "0.0.0") +git_override( + module_name = "trlc", + remote = "https://github.com/bmw-software-engineering/trlc.git", + commit = "650b51a47264a4f232b3341f473527710fc32669", # trlc-2.0.2 release +) # System/Basics @@ -242,13 +256,3 @@ python.toolchain( ) use_repo(python) -# Once we need python requirements: -# pip = use_extension("@rules_python//python/extensions:pip.bzl", "pip") -# pip.parse( -# envsubst = ["PIP_INDEX_URL"], -# extra_pip_args = ["--index-url=${PIP_INDEX_URL:-https://pypi.org/simple/}"], -# hub_name = "pip_docs", -# python_version = PYTHON_VERSION, -# requirements_lock = "//requirements.txt", -# ) -# use_repo(pip, "pip_docs") diff --git a/README.md b/README.md index 5aeb718c8..a020246a9 100644 --- a/README.md +++ b/README.md @@ -1,22 +1,38 @@ # reference_integration Score project integration repository + + +working: + +bazel build --config bl-x86_64-linux @score-baselibs//score/... --verbose_failures + +bazel build @communication//score/... @communication//third_party/... +# score/mw/com/requirements is causing problems when building from a different repo +- BUILD files contain "@//third_party instead of "//third_party +- runtime_test.cpp:get_path is not checking external/communication+/ instead it is checking safe_posix_platform (old module name?) + + not working: +bazel build @communication//... --verbose_failure +The @communication//... wildcard pattern fails due to: + +Infinite symlink expansion through bazel-communication/external/ directories +Repository visibility conflicts where external repositories in the symlinked directories expect repositories (like @rules_cc, @trlc_dependencies) that aren't visible in the @@communication+ namespace + + +bazel build @score_persistency//... + bazel build @feo//... --verbose_failures need to install sudo apt-get install protobuf-compiler sudo apt-get install libclang-dev https://github.com/eclipse-score/tooling/blob/main/starpls/starpls.bzl -uses curl, which does not work with proxy +uses curl, which does not work with proxy (and is bad for dependency tracking) possible workaround in the script: local_path_override(module_name = "score_tooling",path = "../tooling") export "http_proxy=http://127.0.0.1:3128" export "https_proxy=http://127.0.0.1:3128" export "HTTP_PROXY=http://127.0.0.1:3128" - export "HTTPS_PROXY=http://127.0.0.1:3128" - - -working: - -bazel build --config bl-x86_64-linux @score-baselibs//score/... --verbose_failures \ No newline at end of file + export "HTTPS_PROXY=http://127.0.0.1:3128" \ No newline at end of file From 84de3e4f56c182eca2b5b4014807ccaa6d851d4d Mon Sep 17 00:00:00 2001 From: "Graeper Kai (ETAS-ECM/XPC-Hi)" Date: Fri, 17 Oct 2025 15:37:17 +0200 Subject: [PATCH 07/33] score_persistency --- MODULE.bazel | 15 +++++++++------ README.md | 16 +++++++++------- 2 files changed, 18 insertions(+), 13 deletions(-) diff --git a/MODULE.bazel b/MODULE.bazel index ab8e1df20..abb3dd392 100644 --- a/MODULE.bazel +++ b/MODULE.bazel @@ -58,11 +58,15 @@ module( # TODO: score_persistency does not have a single release yet. It's not in the registry. # TODO: rename repo inc_mw_per to persistency bazel_dep(name = "score_persistency", version = "0.1.0") -git_override( +# git_override( +# module_name = "score_persistency", +# remote = "https://github.com/eclipse-score/inc_mw_per.git", +# # 2025-10-09, PR-140 +# commit = "e5759ddf481e7fb957908dcd077799c85edfe547", +# ) +local_path_override( module_name = "score_persistency", - remote = "https://github.com/eclipse-score/inc_mw_per.git", - # 2025-10-09, PR-140 - commit = "e5759ddf481e7fb957908dcd077799c85edfe547", + path = "../inc_mw_per" ) @@ -151,7 +155,7 @@ gcc.warning_flags( use_repo(gcc, "gcc_toolchain", "gcc_toolchain_gcc") # LLVM Toolchains -bazel_dep(name = "toolchains_llvm", version = "1.4.0") +bazel_dep(name = "toolchains_llvm", version = "1.2.0") # per is using 1.2.0 llvm = use_extension("@toolchains_llvm//toolchain/extensions:llvm.bzl", "llvm") llvm.toolchain( cxx_standard = {"": "c++17"}, @@ -255,4 +259,3 @@ python.toolchain( python_version = PYTHON_VERSION, ) use_repo(python) - diff --git a/README.md b/README.md index a020246a9..f94c8244a 100644 --- a/README.md +++ b/README.md @@ -12,16 +12,18 @@ bazel build @communication//score/... @communication//third_party/... - BUILD files contain "@//third_party instead of "//third_party - runtime_test.cpp:get_path is not checking external/communication+/ instead it is checking safe_posix_platform (old module name?) +bazel build \ + @score_persistency//src/... \ + @score_persistency//tests/cpp_test_scenarios/... \ + @score_persistency//tests/rust_test_scenarios/... \ + --extra_toolchains=@llvm_toolchain//:cc-toolchain-x86_64-linux \ + --copt=-Wno-deprecated-declarations +# The Python tests cannot be built from the integration workspace due to Bazel's repository visibility design. This is a fundamental limitation, not a configuration issue. The pip extension and Python dependencies must be accessed from within their defining module context. (according to Claude Sonnet 4) not working: -bazel build @communication//... --verbose_failure -The @communication//... wildcard pattern fails due to: -Infinite symlink expansion through bazel-communication/external/ directories -Repository visibility conflicts where external repositories in the symlinked directories expect repositories (like @rules_cc, @trlc_dependencies) that aren't visible in the @@communication+ namespace - - -bazel build @score_persistency//... +bazel build @score_persistency//src/cpp/... --extra_toolchains=@llvm_toolchain//:cc-toolchain-x86_64-linux +per is using llvm_toolchain 1.2.0 and baselibs 1.4.0 bazel build @feo//... --verbose_failures need to install From 2226e66ce23cf21b96052f834095f7a79bab0af4 Mon Sep 17 00:00:00 2001 From: "Graeper Kai (ETAS-ECM/XPC-Hi)" Date: Thu, 23 Oct 2025 13:44:09 +0200 Subject: [PATCH 08/33] pointing COM to ETAS-contrib --- MODULE.bazel | 30 +++++++++++++++++++----------- README.md | 9 +++++++++ 2 files changed, 28 insertions(+), 11 deletions(-) diff --git a/MODULE.bazel b/MODULE.bazel index abb3dd392..d85d007e5 100644 --- a/MODULE.bazel +++ b/MODULE.bazel @@ -71,7 +71,7 @@ local_path_override( ## --- platform --- -bazel_dep(name = "platforms", version = "0.0.11") +bazel_dep(name = "platforms", version = "1.0.0") bazel_dep(name = "rules_cc", version = "0.2.1") bazel_dep(name = "rules_license", version = "1.0.0") @@ -102,9 +102,16 @@ bazel_dep(name = "communication") # # 2025-10-07 # commit = "dd17d1229b92fe63a6e7dd7194a8d63ea98a8a4f", # ) -local_path_override( +# local_path_override( +# module_name = "communication", +# path = "../communication" +# ) + +git_override( module_name = "communication", - path = "../communication" + remote = "https://github.com/etas-contrib/score_communication.git", + # 2025-10-07 + commit = "1fff37046712f66fed60216fc9e753c8bf57f0ef", ) ## --- baselibs --- @@ -122,16 +129,16 @@ bazel_dep(name = "score_bazel_platforms", version = "0.0.2") # Tooling bazel_dep(name = "score_tooling", version = "0.0.0") -local_path_override( - module_name = "score_tooling", - path = "../tooling" -) -# git_override( +# local_path_override( # module_name = "score_tooling", -# remote = "https://github.com/eclipse-score/tooling.git", -# # 2025-10-10 -# commit = "b8f58954485d8a19856a3aacdc69a6cbdd12972d", +# path = "../tooling" # ) +git_override( + module_name = "score_tooling", + remote = "https://github.com/eclipse-score/tooling.git", + # 2025-10-10 + commit = "b8f58954485d8a19856a3aacdc69a6cbdd12972d", +) #gcc toolchain for baselibs bazel_dep(name = "score_toolchains_gcc", version = "0.4", dev_dependency=False) @@ -153,6 +160,7 @@ gcc.warning_flags( treat_warnings_as_errors = ["-Werror"], # needed by com ) use_repo(gcc, "gcc_toolchain", "gcc_toolchain_gcc") +register_toolchains("@gcc_toolchain//:all") # LLVM Toolchains bazel_dep(name = "toolchains_llvm", version = "1.2.0") # per is using 1.2.0 diff --git a/README.md b/README.md index f94c8244a..19f0db392 100644 --- a/README.md +++ b/README.md @@ -12,6 +12,9 @@ bazel build @communication//score/... @communication//third_party/... - BUILD files contain "@//third_party instead of "//third_party - runtime_test.cpp:get_path is not checking external/communication+/ instead it is checking safe_posix_platform (old module name?) + +bazel build --config bl-x86_64-linux @communication//score/... @communication//third_party/... + bazel build \ @score_persistency//src/... \ @score_persistency//tests/cpp_test_scenarios/... \ @@ -20,8 +23,14 @@ bazel build \ --copt=-Wno-deprecated-declarations # The Python tests cannot be built from the integration workspace due to Bazel's repository visibility design. This is a fundamental limitation, not a configuration issue. The pip extension and Python dependencies must be accessed from within their defining module context. (according to Claude Sonnet 4) +TBD: + +bazel test @itf//... + not working: + + bazel build @score_persistency//src/cpp/... --extra_toolchains=@llvm_toolchain//:cc-toolchain-x86_64-linux per is using llvm_toolchain 1.2.0 and baselibs 1.4.0 From 5121ff342dad6e8a072c00a321472e0a8b119bba Mon Sep 17 00:00:00 2001 From: "Graeper Kai (ETAS-ECM/XPC-Hi)" Date: Thu, 23 Oct 2025 14:26:05 +0200 Subject: [PATCH 09/33] prettify the README, add sample integration script --- .gitignore | 2 + README.md | 115 +++++++++++++++++++++++++++++++++----------- integration_test.sh | 72 +++++++++++++++++++++++++++ 3 files changed, 162 insertions(+), 27 deletions(-) create mode 100755 integration_test.sh diff --git a/.gitignore b/.gitignore index c4061c75b..d851b946e 100644 --- a/.gitignore +++ b/.gitignore @@ -3,5 +3,7 @@ bazel-* MODULE.bazel.lock .bazelrc.user +_logs + # Ruff .ruff_cache diff --git a/README.md b/README.md index 19f0db392..a6a477937 100644 --- a/README.md +++ b/README.md @@ -1,49 +1,110 @@ -# reference_integration -Score project integration repository +# Reference Integration +Integration workspace for the Eclipse Score project. This repository is used to validate cross-module builds (e.g. baselibs, communication, persistency, feo, etc.) from a single Bazel workspace. +## βœ… Working Build Commands -working: +### Baselibs -bazel build --config bl-x86_64-linux @score-baselibs//score/... --verbose_failures +```bash +bazel build --config bl-x86_64-linux @score-baselibs//... --verbose_failures +``` -bazel build @communication//score/... @communication//third_party/... -# score/mw/com/requirements is causing problems when building from a different repo -- BUILD files contain "@//third_party instead of "//third_party -- runtime_test.cpp:get_path is not checking external/communication+/ instead it is checking safe_posix_platform (old module name?) +### Communication +```bash +bazel build @communication//score/... @communication//third_party/... --verbose_failures +bazel build --config bl-x86_64-linux @communication//score/... @communication//third_party/... --verbose_failures +``` -bazel build --config bl-x86_64-linux @communication//score/... @communication//third_party/... +### Persistency +```bash bazel build \ @score_persistency//src/... \ @score_persistency//tests/cpp_test_scenarios/... \ @score_persistency//tests/rust_test_scenarios/... \ --extra_toolchains=@llvm_toolchain//:cc-toolchain-x86_64-linux \ - --copt=-Wno-deprecated-declarations -# The Python tests cannot be built from the integration workspace due to Bazel's repository visibility design. This is a fundamental limitation, not a configuration issue. The pip extension and Python dependencies must be accessed from within their defining module context. (according to Claude Sonnet 4) + --copt=-Wno-deprecated-declarations \ + --verbose_failures +``` -TBD: +> Note: Python tests for `@score_persistency` cannot be built from this integration workspace due to Bazel external repository visibility limitations. The pip extension and Python dependencies must be accessed within their defining module. -bazel test @itf//... +## ⚠️ Observed Issues -not working: +### score/mw/com/requirements +Problems when building from a different repo: +- Some `BUILD` files use `@//third_party` instead of `//third_party` (repository-qualified vs. local label mismatch). +- `runtime_test.cpp:get_path` is checking `safe_posix_platform` (likely an outdated module name) instead of `external/communication+/`. +- fixed in feature/build_from_reference_repo https://github.com/etas-contrib/score_communication.git +### Toolchain / Version Drift +- Persistency uses `llvm_toolchain 1.2.0` while baselibs uses `1.4.0`. Aligning versions may reduce incompatibilities. +## 🚧 Not Yet Working +```bash bazel build @score_persistency//src/cpp/... --extra_toolchains=@llvm_toolchain//:cc-toolchain-x86_64-linux -per is using llvm_toolchain 1.2.0 and baselibs 1.4.0 bazel build @feo//... --verbose_failures -need to install -sudo apt-get install protobuf-compiler -sudo apt-get install libclang-dev - -https://github.com/eclipse-score/tooling/blob/main/starpls/starpls.bzl -uses curl, which does not work with proxy (and is bad for dependency tracking) -possible workaround in the script: - local_path_override(module_name = "score_tooling",path = "../tooling") - export "http_proxy=http://127.0.0.1:3128" - export "https_proxy=http://127.0.0.1:3128" - export "HTTP_PROXY=http://127.0.0.1:3128" - export "HTTPS_PROXY=http://127.0.0.1:3128" \ No newline at end of file +``` + +### Missing System Packages (for feo build) +Install required system dependencies: +```bash +sudo apt-get update +sudo apt-get install -y protobuf-compiler libclang-dev +``` + +## πŸ§ͺ To Be Done + +```bash +bazel test @itf//... +``` + +Add test targets once cross-repo visibility constraints are clarified. + +## 🌐 Proxy & Dependency Handling + +`starpls.bzl` (see: https://github.com/eclipse-score/tooling/blob/main/starpls/starpls.bzl) uses `curl` directly, which: +- Bypasses Bazel's fetch/dependency tracking. +- May fail in a proxy-restricted environment. + +### Possible Workaround +Use a `local_path_override` and set proxy environment variables before invoking the rule: + +```bash +export http_proxy=http://127.0.0.1:3128 +export https_proxy=http://127.0.0.1:3128 +export HTTP_PROXY=http://127.0.0.1:3128 +export HTTPS_PROXY=http://127.0.0.1:3128 +``` + +Example Bazel module override snippet: +```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. + +## πŸ” Next Investigation Targets +- Normalize third-party label usage (`@//third_party` vs `//third_party`). +- Update `runtime_test.cpp:get_path` logic for new module layout. +- Unify LLVM toolchain versions across modules. +- Introduce integration tests for `@itf` once build succeeds. + +## πŸ“Œ Quick Reference + +| Area | Status | Action | +|------|--------|--------| +| baselibs build | βœ… | Keep as baseline | +| communication build | βœ… | Fix label style inconsistencies | +| persistency (Python tests) | 🚫 | Not supported cross-repo | +| feo build | ❌ | Install system deps + inspect failures | +| itf tests | ⏳ | Add after build stabilization | + +## πŸ—‚ Notes +Keep this file updated as integration issues are resolved. Prefer converting ad-hoc shell steps into Bazel rules or documented scripts under `tools/` for repeatability. diff --git a/integration_test.sh b/integration_test.sh new file mode 100755 index 000000000..f56508e7b --- /dev/null +++ b/integration_test.sh @@ -0,0 +1,72 @@ +#!/usr/bin/env bash +set -euo pipefail + +# Integration build script. +# Captures warning counts for regression tracking. + +CONFIG=${CONFIG:-bl-x86_64-linux} +LOG_DIR=${LOG_DIR:-_logs/logs} +SUMMARY_FILE=${SUMMARY_FILE:-_logs/build_summary.txt} +mkdir -p "${LOG_DIR}" || true + +declare -A BUILD_TARGET_GROUPS=( + [baselibs]="@score-baselibs//..." + [communication]="@communication//score/... @communication//third_party/..." + [persistency]="@score_persistency//src/... @score_persistency//tests/cpp_test_scenarios/... @score_persistency//tests/rust_test_scenarios/..." +) + +warn_count() { + # Grep typical compiler and Bazel warnings; adjust patterns as needed. + local file=$1 + # Count lines with 'warning:' excluding ones from system headers optionally later. + grep -i 'warning:' "$file" | wc -l || true +} + +depr_count() { + local file=$1 + grep -i 'deprecated' "$file" | wc -l || true +} + +timestamp() { date '+%Y-%m-%d %H:%M:%S'; } + +echo "=== Integration Build Started $(timestamp) ===" | tee "${SUMMARY_FILE}" +echo "Config: ${CONFIG}" | tee -a "${SUMMARY_FILE}" + +overall_warn_total=0 +overall_depr_total=0 + +for group in baselibs communication persistency; do + targets="${BUILD_TARGET_GROUPS[$group]}" + log_file="${LOG_DIR}/${group}.log" + echo "--- Building group: ${group} ---" | tee -a "${SUMMARY_FILE}" + start_ts=$(date +%s) + if [[ "$group" == "persistency" ]]; then + # Extra flags only for persistency group. + set +e + bazel build --config "${CONFIG}" \ + ${targets} \ + --extra_toolchains=@llvm_toolchain//:cc-toolchain-x86_64-linux \ + --copt=-Wno-deprecated-declarations \ + --verbose_failures 2>&1 | tee "$log_file" + build_status=${PIPESTATUS[0]} + set -e + else + set +e + bazel build --config "${CONFIG}" ${targets} --verbose_failures 2>&1 | tee "$log_file" + build_status=${PIPESTATUS[0]} + set -e + fi + end_ts=$(date +%s) + duration=$(( end_ts - start_ts )) + w_count=$(warn_count "$log_file") + d_count=$(depr_count "$log_file") + overall_warn_total=$(( overall_warn_total + w_count )) + overall_depr_total=$(( overall_depr_total + d_count )) + echo "Group: ${group} | Status: ${build_status} | Duration: ${duration}s | Warnings: ${w_count} | Deprecated refs: ${d_count}" | tee -a "${SUMMARY_FILE}" +done + +# Display the full build summary explicitly at the end +echo '=== Build Summary (echo) ===' +cat "${SUMMARY_FILE}" || echo "(Could not read summary file ${SUMMARY_FILE})" + +exit 0 \ No newline at end of file From 2f08c1b2d4e9f3b51180eb4c630dc9dad594019b Mon Sep 17 00:00:00 2001 From: "Graeper Kai (ETAS-ECM/XPC-Hi)" Date: Thu, 23 Oct 2025 20:50:50 +0200 Subject: [PATCH 10/33] add dummy int test --- .bazelrc | 19 +--- .github/workflows/test_integration.yml | 30 +++++ MODULE.bazel | 38 +++++-- README.md | 10 +- .bazelrc.baselibs => baselibs.bazelrc | 1 - communication.bazelrc | 15 +++ tools/update_git_override.py | 147 +++++++++++++++++++++++++ user.bazelrc | 4 + 8 files changed, 235 insertions(+), 29 deletions(-) create mode 100644 .github/workflows/test_integration.yml rename .bazelrc.baselibs => baselibs.bazelrc (99%) create mode 100644 communication.bazelrc create mode 100644 tools/update_git_override.py create mode 100644 user.bazelrc diff --git a/.bazelrc b/.bazelrc index fc504addd..f0047d1b6 100644 --- a/.bazelrc +++ b/.bazelrc @@ -11,22 +11,9 @@ build --incompatible_default_to_explicit_init_py common --registry=https://raw.githubusercontent.com/eclipse-score/bazel_registry/main/ common --registry=https://bcr.bazel.build -common --incompatible_disallow_empty_glob -common --@score-baselibs//score/mw/log/detail/flags:KUse_Stub_Implementation_Only=False -common --@score-baselibs//score/mw/log/flags:KRemote_Logging=False -common --@score-baselibs//score/json:base_library=nlohmann -common --@communication//score/mw/com/flags:tracing_library=stub -common --extra_toolchains=@gcc_toolchain//:host_gcc_12 -build --incompatible_strict_action_env -test --test_tag_filters=-manual -build --experimental_retain_test_configuration_across_testonly #https://github.com/bazelbuild/bazel/issues/6842 +try-import %workspace%/baselibs.bazelrc -# unshare /dev/shm and /tmp -test --sandbox_tmpfs_path=/dev/shm -test --sandbox_tmpfs_path=/tmp - -try-import %workspace%/.bazelrc.baselibs - -try-import %workspace%/.bazelrc.user +try-import %workspace%/communication.bazelrc +try-import %workspace%/user.bazelrc diff --git a/.github/workflows/test_integration.yml b/.github/workflows/test_integration.yml new file mode 100644 index 000000000..446261528 --- /dev/null +++ b/.github/workflows/test_integration.yml @@ -0,0 +1,30 @@ +# ******************************************************************************* +# Copyright (c) 2025 Contributors to the Eclipse Foundation +# +# See the NOTICE file(s) distributed with this work for additional +# information regarding copyright ownership. +# +# This program and the accompanying materials are made available under the +# terms of the Apache License Version 2.0 which is available at +# https://www.apache.org/licenses/LICENSE-2.0 +# +# SPDX-License-Identifier: Apache-2.0 +# ******************************************************************************* + +# Workflow configuration for S-CORE CI - Bazel Build & Test baselibs +# This workflow runs Bazel build and test when triggered by specific pull request events. + +name: Bazel Build some repositories +on: + workflow_dispatch: +jobs: + integration_test: + runs-on: ubuntu-latest + steps: + - name: Checkout repository + uses: actions/checkout@v4.2.2 + - name: Setup Bazel + uses: bazel-contrib/setup-bazel@0.9.1 + - name: Bazel build baselibs targets + run: | + ./integration_test.sh \ No newline at end of file diff --git a/MODULE.bazel b/MODULE.bazel index d85d007e5..3dfa6a1d2 100644 --- a/MODULE.bazel +++ b/MODULE.bazel @@ -58,16 +58,16 @@ module( # TODO: score_persistency does not have a single release yet. It's not in the registry. # TODO: rename repo inc_mw_per to persistency bazel_dep(name = "score_persistency", version = "0.1.0") -# git_override( -# module_name = "score_persistency", -# remote = "https://github.com/eclipse-score/inc_mw_per.git", -# # 2025-10-09, PR-140 -# commit = "e5759ddf481e7fb957908dcd077799c85edfe547", -# ) -local_path_override( +git_override( module_name = "score_persistency", - path = "../inc_mw_per" + remote = "https://github.com/eclipse-score/inc_mw_per.git", + # 2025-10-09, PR-140 + commit = "e5759ddf481e7fb957908dcd077799c85edfe547", ) +# local_path_override( +# module_name = "score_persistency", +# path = "../inc_mw_per" +# ) ## --- platform --- @@ -87,8 +87,8 @@ bazel_dep(name = "inc_orchestrator") git_override( module_name = "inc_orchestrator", remote = "https://github.com/eclipse-score/inc_orchestrator.git", - # 2025-10-07 commit = "9f8ed482bdf786117eb3c4c1be14a1ee58a120ab", + # 2025-10-07 ) ## --- communication --- @@ -110,8 +110,8 @@ bazel_dep(name = "communication") git_override( module_name = "communication", remote = "https://github.com/etas-contrib/score_communication.git", - # 2025-10-07 commit = "1fff37046712f66fed60216fc9e753c8bf57f0ef", + # 2025-10-07 ) ## --- baselibs --- @@ -122,8 +122,8 @@ bazel_dep(name = "score-baselibs", version = "0.0.0") git_override( module_name = "score-baselibs", remote = "https://github.com/eclipse-score/baselibs.git", - # 2025-10-07 commit = "f02d7f427df1968df8d5f9f9aa85bf68baeb839e", + # 2025-10-07 ) bazel_dep(name = "score_bazel_platforms", version = "0.0.2") @@ -140,6 +140,22 @@ git_override( commit = "b8f58954485d8a19856a3aacdc69a6cbdd12972d", ) +# QNX toolchain +bazel_dep(name = "score_toolchains_qnx", version = "0.0.1") +# Using local_path_override (patched extension) instead of git_override to avoid duplicate overrides. +local_path_override( + module_name = "score_toolchains_qnx", + path = "../toolchains_qnx", +) +toolchains_qnx = use_extension("@score_toolchains_qnx//:extensions.bzl", "toolchains_qnx") +toolchains_qnx.sdp( + sha256 = "f2e0cb21c6baddbcb65f6a70610ce498e7685de8ea2e0f1648f01b327f6bac63", + strip_prefix = "installation", + url = "https://www.qnx.com/download/download/79858/installation.tgz", +) +use_repo(toolchains_qnx, "toolchains_qnx_sdp") +use_repo(toolchains_qnx, "toolchains_qnx_qcc") + #gcc toolchain for baselibs bazel_dep(name = "score_toolchains_gcc", version = "0.4", dev_dependency=False) gcc = use_extension("@score_toolchains_gcc//extentions:gcc.bzl", "gcc", dev_dependency=False) diff --git a/README.md b/README.md index a6a477937..bcd65f180 100644 --- a/README.md +++ b/README.md @@ -40,7 +40,7 @@ Problems when building from a different repo: - fixed in feature/build_from_reference_repo https://github.com/etas-contrib/score_communication.git ### Toolchain / Version Drift -- Persistency uses `llvm_toolchain 1.2.0` while baselibs uses `1.4.0`. Aligning versions may reduce incompatibilities. +- Persistency uses `llvm_toolchain 1.2.0` while baselibs uses `1.4.0`. Aligning versions may reduce incompatibilities. Also Persistency does not work with `1.4.0`. ## 🚧 Not Yet Working @@ -50,6 +50,12 @@ bazel build @score_persistency//src/cpp/... --extra_toolchains=@llvm_toolchain// bazel build @feo//... --verbose_failures ``` + +```bash +bazel mod graph +``` +It is working with latest baselibs (dev_dependecy = True for score_toolchains_qnx), but communication is not building with it. + ### Missing System Packages (for feo build) Install required system dependencies: ```bash @@ -65,6 +71,8 @@ bazel test @itf//... Add test targets once cross-repo visibility constraints are clarified. +Configuration handling (instead of baseelibs.bazelrc,...) + ## 🌐 Proxy & Dependency Handling `starpls.bzl` (see: https://github.com/eclipse-score/tooling/blob/main/starpls/starpls.bzl) uses `curl` directly, which: diff --git a/.bazelrc.baselibs b/baselibs.bazelrc similarity index 99% rename from .bazelrc.baselibs rename to baselibs.bazelrc index 06daeb1bf..0455f1038 100644 --- a/.bazelrc.baselibs +++ b/baselibs.bazelrc @@ -23,4 +23,3 @@ test:bl-x86_64-linux --config=_bl_common test:bl-x86_64-linux --build_tests_only test:bl-x86_64-linux --test_tag_filters=-manual test:bl-x86_64-linux --test_output=errors - diff --git a/communication.bazelrc b/communication.bazelrc new file mode 100644 index 000000000..de4f5f0ae --- /dev/null +++ b/communication.bazelrc @@ -0,0 +1,15 @@ + +# TODO: move flags from common to specific configs as needed + +common --@score-baselibs//score/mw/log/detail/flags:KUse_Stub_Implementation_Only=False +common --@score-baselibs//score/mw/log/flags:KRemote_Logging=False +common --@score-baselibs//score/json:base_library=nlohmann +common --@communication//score/mw/com/flags:tracing_library=stub +common --extra_toolchains=@gcc_toolchain//:host_gcc_12 +build --incompatible_strict_action_env +test --test_tag_filters=-manual +build --experimental_retain_test_configuration_across_testonly #https://github.com/bazelbuild/bazel/issues/6842 + +# unshare /dev/shm and /tmp +test --sandbox_tmpfs_path=/dev/shm +test --sandbox_tmpfs_path=/tmp \ No newline at end of file diff --git a/tools/update_git_override.py b/tools/update_git_override.py new file mode 100644 index 000000000..cfc2ac122 --- /dev/null +++ b/tools/update_git_override.py @@ -0,0 +1,147 @@ +#!/usr/bin/env python3 +"""Update a commit hash of a git_override stanza in a Bazel MODULE.bazel file. + +!!! Temporary Script !!! + +Usage: + ./tools/update_git_override.py REMOTE@HASH [REMOTE@HASH ...] [--file MODULE.bazel] + +Examples: + ./tools/update_git_override.py https://github.com/eclipse-score/baselibs.git@deadbeef123... + ./tools/update_git_override.py \ + https://github.com/eclipse-score/baselibs.git@deadbeef123... \ + https://github.com/eclipse-score/tooling.git@cafebabefeedface0123... + +Behavior: + - For each REMOTE@HASH argument, finds the git_override( ... ) block whose remote matches REMOTE. + - Updates (or inserts if missing) the commit = "HASH" attribute inside that block. + - Preserves indentation and other attributes. + - If any remote is not found, exits with non-zero status and does not write changes (except still shows diff in --dry-run if partial matches occurred). + +Limitations: + - Does not validate that HASH exists in the remote repo. + - Expects reasonably well-formed Starlark (one git_override per block). + +""" +from __future__ import annotations +import argparse +import re +import sys +from pathlib import Path + +GIT_OVERRIDE_START_RE = re.compile(r"^\s*git_override\s*\(\s*$") +REMOTE_LINE_RE = re.compile(r"^\s*remote\s*=\s*\"(?P[^\"]+)\"\s*,?\s*$") +COMMIT_LINE_RE = re.compile(r"^\s*commit\s*=\s*\"(?P[0-9a-fA-F]+)\"\s*,?\s*$") + +# Simple state machine to collect a git_override block + +def parse_args(): + p = argparse.ArgumentParser(description="Update commit hash(es) for git_override remote(s)") + p.add_argument("remote_and_hash", nargs="+", help="One or more REMOTE@HASH entries e.g. https://github.com/eclipse-score/baselibs.git@abc123...") + p.add_argument("--file", default="MODULE.bazel", help="Path to MODULE.bazel (default: MODULE.bazel)") + p.add_argument("--dry-run", action="store_true", help="Show diff without writing") + return p.parse_args() + + +def main(): + args = parse_args() + # Parse all remote@hash pairs + targets = [] + for item in args.remote_and_hash: + if "@" not in item: + print(f"ERROR: argument must be REMOTE@HASH (got: {item})", file=sys.stderr) + return 2 + remote, new_hash = item.split("@", 1) + targets.append((remote, new_hash)) + module_path = Path(args.file) + if not module_path.exists(): + print(f"ERROR: file not found: {module_path}", file=sys.stderr) + return 2 + + lines = module_path.read_text().splitlines() + + # Track which remotes were updated + requested_remotes = {r for r, _ in targets} + updated_remotes = set() + updated_any = False + i = 0 + while i < len(lines): + line = lines[i] + if GIT_OVERRIDE_START_RE.match(line): + # capture block + block_start = i + i += 1 + # find end: a line with a lone ')' + while i < len(lines) and not lines[i].strip().startswith(")"): + i += 1 + block_end = i # index of line with ')' or end + block = lines[block_start:block_end+1] + + # Determine if this block matches the remote + found_remote = None + commit_idx = None + remote_idx = None + for j, bline in enumerate(block): + m_remote = REMOTE_LINE_RE.match(bline) + if m_remote: + found_remote = m_remote.group("remote") + remote_idx = j + m_commit = COMMIT_LINE_RE.match(bline) + if m_commit: + commit_idx = j + if found_remote and found_remote in requested_remotes: + # Determine target hash for this remote + new_hash = next(h for (r, h) in targets if r == found_remote) + if len(block) > 1: + m_indent = re.match(r"^(\s*)", block[1]) + indent = m_indent.group(1) if m_indent else " " + else: + indent = " " + # Prepare new commit line + new_commit_line = f"{indent}commit = \"{new_hash}\"," if not block[block_end-block_start].strip().startswith(")") else f"{indent}commit = \"{new_hash}\"," # fallback + if commit_idx is not None: + old = block[commit_idx] + block[commit_idx] = re.sub(COMMIT_LINE_RE, new_commit_line, old) + else: + # Insert commit after remote line if available else before closing paren + insert_pos = commit_idx or (remote_idx + 1 if remote_idx is not None else len(block)-1) + block.insert(insert_pos, new_commit_line) + block_end += 1 + # Replace into lines + lines[block_start:block_end+1] = block + updated_any = True + updated_remotes.add(found_remote) + # continue search (in case multiple matching blocks?) but typically one + i += 1 + + missing = requested_remotes - updated_remotes + if missing: + print("ERROR: remote(s) not found: " + ", ".join(sorted(missing)), file=sys.stderr) + if not updated_any: + return 1 + # If some were updated and some missing, still allow diff/write decision below, but exit non-zero. + exit_code_on_missing = 1 + else: + exit_code_on_missing = 0 + + new_content = "\n".join(lines) + "\n" + if args.dry_run: + old_content = module_path.read_text() + if old_content == new_content: + print("No changes.") + return exit_code_on_missing + # rudimentary diff + import difflib + diff = difflib.unified_diff(old_content.splitlines(), new_content.splitlines(), fromfile=str(module_path), tofile=str(module_path)+" (updated)") + for dline in diff: + print(dline) + return exit_code_on_missing + + module_path.write_text(new_content) + if updated_remotes: + for r in sorted(updated_remotes): + print(f"Updated commit for remote {r}") + return exit_code_on_missing + +if __name__ == "__main__": + raise SystemExit(main()) diff --git a/user.bazelrc b/user.bazelrc new file mode 100644 index 000000000..b8ff3e9da --- /dev/null +++ b/user.bazelrc @@ -0,0 +1,4 @@ + +startup --host_jvm_args=-Djavax.net.ssl.trustStore=/etc/ssl/certs/java/cacerts \ + --host_jvm_args=-Djavax.net.ssl.trustStorePassword=changeit + \ No newline at end of file From 48e86e6bad01bbaa47fb63ad2912001f016a7134 Mon Sep 17 00:00:00 2001 From: "Graeper Kai (ETAS-ECM/XPC-Hi)" Date: Thu, 23 Oct 2025 21:10:14 +0200 Subject: [PATCH 11/33] chore(ci): add push/PR triggers for bazel branch --- .github/workflows/test_integration.yml | 9 ++++++++- 1 file changed, 8 insertions(+), 1 deletion(-) diff --git a/.github/workflows/test_integration.yml b/.github/workflows/test_integration.yml index 446261528..6c656c25a 100644 --- a/.github/workflows/test_integration.yml +++ b/.github/workflows/test_integration.yml @@ -16,10 +16,17 @@ name: Bazel Build some repositories on: - workflow_dispatch: + workflow_dispatch: + push: + branches: [ bazel ] + pull_request: + branches: [ bazel ] jobs: integration_test: runs-on: ubuntu-latest + permissions: + contents: read + actions: read steps: - name: Checkout repository uses: actions/checkout@v4.2.2 From 40e3430ae377e600fa8ddf1aa35ce34fbc4dcb39 Mon Sep 17 00:00:00 2001 From: "Graeper Kai (ETAS-ECM/XPC-Hi)" Date: Thu, 23 Oct 2025 21:12:41 +0200 Subject: [PATCH 12/33] remove local_path_override --- MODULE.bazel | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/MODULE.bazel b/MODULE.bazel index 3dfa6a1d2..1e8f9247b 100644 --- a/MODULE.bazel +++ b/MODULE.bazel @@ -142,10 +142,10 @@ git_override( # QNX toolchain bazel_dep(name = "score_toolchains_qnx", version = "0.0.1") -# Using local_path_override (patched extension) instead of git_override to avoid duplicate overrides. -local_path_override( +git_override( module_name = "score_toolchains_qnx", - path = "../toolchains_qnx", + remote = "https://github.com/eclipse-score/toolchains_qnx.git", + commit = "9e2ea88985243231bec59cef023eefb5f6dfd967", ) toolchains_qnx = use_extension("@score_toolchains_qnx//:extensions.bzl", "toolchains_qnx") toolchains_qnx.sdp( From d7d31673711e15ae5af7ab3082c1d70f411a028d Mon Sep 17 00:00:00 2001 From: "Graeper Kai (ETAS-ECM/XPC-Hi)" Date: Thu, 23 Oct 2025 21:37:19 +0200 Subject: [PATCH 13/33] update COM and formatting --- .github/workflows/test_integration.yml | 27 ++++++++++++++++++++------ MODULE.bazel | 2 +- integration_test.sh | 7 ++++++- 3 files changed, 28 insertions(+), 8 deletions(-) diff --git a/.github/workflows/test_integration.yml b/.github/workflows/test_integration.yml index 6c656c25a..67d786a6f 100644 --- a/.github/workflows/test_integration.yml +++ b/.github/workflows/test_integration.yml @@ -19,14 +19,9 @@ on: workflow_dispatch: push: branches: [ bazel ] - pull_request: - branches: [ bazel ] jobs: integration_test: runs-on: ubuntu-latest - permissions: - contents: read - actions: read steps: - name: Checkout repository uses: actions/checkout@v4.2.2 @@ -34,4 +29,24 @@ jobs: uses: bazel-contrib/setup-bazel@0.9.1 - name: Bazel build baselibs targets run: | - ./integration_test.sh \ No newline at end of file + ./integration_test.sh + - name: Publish build summary + if: always() + run: | + if [ -f _logs/build_summary.txt ]; then + { + echo '## Bazel Build Summary' + echo + sed 's/^/ /' _logs/build_summary.txt + } >> "$GITHUB_STEP_SUMMARY" + else + echo "No build summary file found (_logs/build_summary.txt)" >> "$GITHUB_STEP_SUMMARY" + fi + - name: Upload logs artifact + if: always() + uses: actions/upload-artifact@v4 + with: + name: bazel-build-logs + path: _logs/ + if-no-files-found: warn + retention-days: 14 \ No newline at end of file diff --git a/MODULE.bazel b/MODULE.bazel index 1e8f9247b..ee22966f7 100644 --- a/MODULE.bazel +++ b/MODULE.bazel @@ -110,7 +110,7 @@ bazel_dep(name = "communication") git_override( module_name = "communication", remote = "https://github.com/etas-contrib/score_communication.git", - commit = "1fff37046712f66fed60216fc9e753c8bf57f0ef", + commit = "a049e79e1878fc647c47266e4146bda5bb21b4ce", # 2025-10-07 ) diff --git a/integration_test.sh b/integration_test.sh index f56508e7b..33b5bfb99 100755 --- a/integration_test.sh +++ b/integration_test.sh @@ -38,7 +38,9 @@ overall_depr_total=0 for group in baselibs communication persistency; do targets="${BUILD_TARGET_GROUPS[$group]}" log_file="${LOG_DIR}/${group}.log" - echo "--- Building group: ${group} ---" | tee -a "${SUMMARY_FILE}" + echo "--- Building group: ${group} ---" | tee -a "${SUMMARY_FILE}" + # GitHub Actions log grouping start + echo "::group::Bazel build (${group})" start_ts=$(date +%s) if [[ "$group" == "persistency" ]]; then # Extra flags only for persistency group. @@ -56,6 +58,7 @@ for group in baselibs communication persistency; do build_status=${PIPESTATUS[0]} set -e fi + echo "::endgroup::" # End Bazel build group end_ts=$(date +%s) duration=$(( end_ts - start_ts )) w_count=$(warn_count "$log_file") @@ -66,7 +69,9 @@ for group in baselibs communication persistency; do done # Display the full build summary explicitly at the end +echo '::group::Build Summary' echo '=== Build Summary (echo) ===' cat "${SUMMARY_FILE}" || echo "(Could not read summary file ${SUMMARY_FILE})" +echo '::endgroup::' exit 0 \ No newline at end of file From 195d07e3099b4c216813f3cd1b6aec51f29b119c Mon Sep 17 00:00:00 2001 From: "Graeper Kai (ETAS-ECM/XPC-Hi)" Date: Thu, 23 Oct 2025 22:23:02 +0200 Subject: [PATCH 14/33] add caching, remove @communication//third_party/... --- .github/workflows/test_integration.yml | 11 +++++++++-- README.md | 9 +++++++-- integration_test.sh | 2 +- 3 files changed, 17 insertions(+), 5 deletions(-) diff --git a/.github/workflows/test_integration.yml b/.github/workflows/test_integration.yml index 67d786a6f..a553248ac 100644 --- a/.github/workflows/test_integration.yml +++ b/.github/workflows/test_integration.yml @@ -26,8 +26,15 @@ jobs: - name: Checkout repository uses: actions/checkout@v4.2.2 - name: Setup Bazel - uses: bazel-contrib/setup-bazel@0.9.1 - - name: Bazel build baselibs targets + uses: bazel-contrib/setup-bazel@0.15.0 + with: + # Avoid downloading Bazel every time. + bazelisk-cache: true + # Store build cache per workflow. + disk-cache: ${{ github.workflow }} + # Share repository cache between workflows. + repository-cache: true + - name: Bazel build targets run: | ./integration_test.sh - name: Publish build summary diff --git a/README.md b/README.md index bcd65f180..ae78b12e9 100644 --- a/README.md +++ b/README.md @@ -13,7 +13,7 @@ bazel build --config bl-x86_64-linux @score-baselibs//... --verbose_failures ### Communication ```bash -bazel build @communication//score/... @communication//third_party/... --verbose_failures +bazel build @communication//score/... --verbose_failures bazel build --config bl-x86_64-linux @communication//score/... @communication//third_party/... --verbose_failures ``` @@ -33,12 +33,17 @@ bazel build \ ## ⚠️ Observed Issues -### score/mw/com/requirements +### communication: score/mw/com/requirements Problems when building from a different repo: - Some `BUILD` files use `@//third_party` instead of `//third_party` (repository-qualified vs. local label mismatch). - `runtime_test.cpp:get_path` is checking `safe_posix_platform` (likely an outdated module name) instead of `external/communication+/`. - fixed in feature/build_from_reference_repo https://github.com/etas-contrib/score_communication.git +### communication: get_git_info +@communication//third_party/... here get_git_info is causing problems because it cannot find github root from e.g. +/home/runner/.bazel/sandbox/processwrapper-sandbox/1689/execroot/_main/bazel-out/k8-opt-exec-ST-8abfa5a323e1/bin/external/communication+/third_party/traceability/tools/source_code_linker/parsed_source_files_for_source_code_linker.runfiles/communication+/third_party/traceability/tools/source_code_linker/get_git_info.py +is this needed? should we fix it? + ### Toolchain / Version Drift - Persistency uses `llvm_toolchain 1.2.0` while baselibs uses `1.4.0`. Aligning versions may reduce incompatibilities. Also Persistency does not work with `1.4.0`. diff --git a/integration_test.sh b/integration_test.sh index 33b5bfb99..0155d7d70 100755 --- a/integration_test.sh +++ b/integration_test.sh @@ -11,7 +11,7 @@ mkdir -p "${LOG_DIR}" || true declare -A BUILD_TARGET_GROUPS=( [baselibs]="@score-baselibs//..." - [communication]="@communication//score/... @communication//third_party/..." + [communication]="@communication//score/..." [persistency]="@score_persistency//src/... @score_persistency//tests/cpp_test_scenarios/... @score_persistency//tests/rust_test_scenarios/..." ) From 21c52c972cfbe744e98f7a76acdc5ad82a528254 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Kai=20Gr=C3=A4per?= <160226396+kgraeper@users.noreply.github.com> Date: Thu, 23 Oct 2025 22:24:15 +0200 Subject: [PATCH 15/33] Fix indentation in Bazel setup step MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Signed-off-by: Kai GrΓ€per <160226396+kgraeper@users.noreply.github.com> --- .github/workflows/test_integration.yml | 16 ++++++++-------- 1 file changed, 8 insertions(+), 8 deletions(-) diff --git a/.github/workflows/test_integration.yml b/.github/workflows/test_integration.yml index a553248ac..6db3ef981 100644 --- a/.github/workflows/test_integration.yml +++ b/.github/workflows/test_integration.yml @@ -27,13 +27,13 @@ jobs: uses: actions/checkout@v4.2.2 - name: Setup Bazel uses: bazel-contrib/setup-bazel@0.15.0 - with: - # Avoid downloading Bazel every time. - bazelisk-cache: true - # Store build cache per workflow. - disk-cache: ${{ github.workflow }} - # Share repository cache between workflows. - repository-cache: true + with: + # Avoid downloading Bazel every time. + bazelisk-cache: true + # Store build cache per workflow. + disk-cache: ${{ github.workflow }} + # Share repository cache between workflows. + repository-cache: true - name: Bazel build targets run: | ./integration_test.sh @@ -56,4 +56,4 @@ jobs: name: bazel-build-logs path: _logs/ if-no-files-found: warn - retention-days: 14 \ No newline at end of file + retention-days: 14 From c2866354f3b34cdb8908cda92ef5d1fb0db12f37 Mon Sep 17 00:00:00 2001 From: "Graeper Kai (ETAS-ECM/XPC-Hi)" Date: Thu, 23 Oct 2025 22:44:46 +0200 Subject: [PATCH 16/33] change com commit --- .github/workflows/test_integration.yml | 12 ++++++------ MODULE.bazel | 2 +- integration_test.sh | 2 +- 3 files changed, 8 insertions(+), 8 deletions(-) diff --git a/.github/workflows/test_integration.yml b/.github/workflows/test_integration.yml index 6db3ef981..7bce8ba06 100644 --- a/.github/workflows/test_integration.yml +++ b/.github/workflows/test_integration.yml @@ -28,12 +28,12 @@ jobs: - name: Setup Bazel uses: bazel-contrib/setup-bazel@0.15.0 with: - # Avoid downloading Bazel every time. - bazelisk-cache: true - # Store build cache per workflow. - disk-cache: ${{ github.workflow }} - # Share repository cache between workflows. - repository-cache: true + # Avoid downloading Bazel every time. + bazelisk-cache: true + # Store build cache per workflow. + disk-cache: ${{ github.workflow }} + # Share repository cache between workflows. + repository-cache: true - name: Bazel build targets run: | ./integration_test.sh diff --git a/MODULE.bazel b/MODULE.bazel index ee22966f7..c6c74a68d 100644 --- a/MODULE.bazel +++ b/MODULE.bazel @@ -110,7 +110,7 @@ bazel_dep(name = "communication") git_override( module_name = "communication", remote = "https://github.com/etas-contrib/score_communication.git", - commit = "a049e79e1878fc647c47266e4146bda5bb21b4ce", + commit = "e33388384f0ce643f857fbba604dd9d9ec2e0a75", # 2025-10-07 ) diff --git a/integration_test.sh b/integration_test.sh index 0155d7d70..33b5bfb99 100755 --- a/integration_test.sh +++ b/integration_test.sh @@ -11,7 +11,7 @@ mkdir -p "${LOG_DIR}" || true declare -A BUILD_TARGET_GROUPS=( [baselibs]="@score-baselibs//..." - [communication]="@communication//score/..." + [communication]="@communication//score/... @communication//third_party/..." [persistency]="@score_persistency//src/... @score_persistency//tests/cpp_test_scenarios/... @score_persistency//tests/rust_test_scenarios/..." ) From 53d17b02c247e47ad0c680d7eeefc196c5fb79a7 Mon Sep 17 00:00:00 2001 From: "Graeper Kai (ETAS-ECM/XPC-Hi)" Date: Thu, 23 Oct 2025 22:58:43 +0200 Subject: [PATCH 17/33] update com --- MODULE.bazel | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/MODULE.bazel b/MODULE.bazel index c6c74a68d..d38f352f9 100644 --- a/MODULE.bazel +++ b/MODULE.bazel @@ -110,7 +110,7 @@ bazel_dep(name = "communication") git_override( module_name = "communication", remote = "https://github.com/etas-contrib/score_communication.git", - commit = "e33388384f0ce643f857fbba604dd9d9ec2e0a75", + commit = "748fd452824e378cabe579c019e5dd18387c341e", # 2025-10-07 ) From 0c1f9755e400dfb5a3c9ea98dc9adbdf2425d08d Mon Sep 17 00:00:00 2001 From: "Graeper Kai (ETAS-ECM/XPC-Hi)" Date: Thu, 23 Oct 2025 23:30:18 +0200 Subject: [PATCH 18/33] change summary to markdown --- integration_test.sh | 21 ++++++++++++++++++--- 1 file changed, 18 insertions(+), 3 deletions(-) diff --git a/integration_test.sh b/integration_test.sh index 33b5bfb99..f600f1275 100755 --- a/integration_test.sh +++ b/integration_test.sh @@ -6,7 +6,7 @@ set -euo pipefail CONFIG=${CONFIG:-bl-x86_64-linux} LOG_DIR=${LOG_DIR:-_logs/logs} -SUMMARY_FILE=${SUMMARY_FILE:-_logs/build_summary.txt} +SUMMARY_FILE=${SUMMARY_FILE:-_logs/build_summary.md} mkdir -p "${LOG_DIR}" || true declare -A BUILD_TARGET_GROUPS=( @@ -31,6 +31,14 @@ timestamp() { date '+%Y-%m-%d %H:%M:%S'; } echo "=== Integration Build Started $(timestamp) ===" | tee "${SUMMARY_FILE}" echo "Config: ${CONFIG}" | tee -a "${SUMMARY_FILE}" +echo "" >> "${SUMMARY_FILE}" +echo "## Build Groups Summary" >> "${SUMMARY_FILE}" +echo "" >> "${SUMMARY_FILE}" +# Markdown table header +{ + echo "| Group | Status | Duration (s) | Warnings | Deprecated refs |"; + echo "|-------|--------|--------------|----------|-----------------|"; +} >> "${SUMMARY_FILE}" overall_warn_total=0 overall_depr_total=0 @@ -38,7 +46,8 @@ overall_depr_total=0 for group in baselibs communication persistency; do targets="${BUILD_TARGET_GROUPS[$group]}" log_file="${LOG_DIR}/${group}.log" - echo "--- Building group: ${group} ---" | tee -a "${SUMMARY_FILE}" + # Log build group banner only to stdout/stderr (not into summary table file) + echo "--- Building group: ${group} ---" # GitHub Actions log grouping start echo "::group::Bazel build (${group})" start_ts=$(date +%s) @@ -65,7 +74,13 @@ for group in baselibs communication persistency; do d_count=$(depr_count "$log_file") overall_warn_total=$(( overall_warn_total + w_count )) overall_depr_total=$(( overall_depr_total + d_count )) - echo "Group: ${group} | Status: ${build_status} | Duration: ${duration}s | Warnings: ${w_count} | Deprecated refs: ${d_count}" | tee -a "${SUMMARY_FILE}" + # Append as a markdown table row (duration without trailing 's') + if [[ ${build_status} -eq 0 ]]; then + status_symbol="βœ…" + else + status_symbol="❌(${build_status})" + fi + echo "| ${group} | ${status_symbol} | ${duration} | ${w_count} | ${d_count} |" | tee -a "${SUMMARY_FILE}" done # Display the full build summary explicitly at the end From d5111ebde1b3c500e15a617f279edc85f7fe0fe9 Mon Sep 17 00:00:00 2001 From: "Graeper Kai (ETAS-ECM/XPC-Hi)" Date: Thu, 23 Oct 2025 23:36:42 +0200 Subject: [PATCH 19/33] fix path --- .github/workflows/test_integration.yml | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/.github/workflows/test_integration.yml b/.github/workflows/test_integration.yml index 7bce8ba06..401cd355a 100644 --- a/.github/workflows/test_integration.yml +++ b/.github/workflows/test_integration.yml @@ -40,14 +40,14 @@ jobs: - name: Publish build summary if: always() run: | - if [ -f _logs/build_summary.txt ]; then + if [ -f _logs/build_summary.md ]; then { echo '## Bazel Build Summary' echo - sed 's/^/ /' _logs/build_summary.txt + sed 's/^/ /' _logs/build_summary.md } >> "$GITHUB_STEP_SUMMARY" else - echo "No build summary file found (_logs/build_summary.txt)" >> "$GITHUB_STEP_SUMMARY" + echo "No build summary file found (_logs/build_summary.md)" >> "$GITHUB_STEP_SUMMARY" fi - name: Upload logs artifact if: always() From 87553c6015d4309100fdb52be44792a0aaf22fb8 Mon Sep 17 00:00:00 2001 From: "Graeper Kai (ETAS-ECM/XPC-Hi)" Date: Thu, 23 Oct 2025 23:46:16 +0200 Subject: [PATCH 20/33] fix layout --- .github/workflows/test_integration.yml | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/.github/workflows/test_integration.yml b/.github/workflows/test_integration.yml index 401cd355a..f0b6c5a85 100644 --- a/.github/workflows/test_integration.yml +++ b/.github/workflows/test_integration.yml @@ -44,7 +44,8 @@ jobs: { echo '## Bazel Build Summary' echo - sed 's/^/ /' _logs/build_summary.md + # Append the markdown directly so tables render (no leading indentation) + cat _logs/build_summary.md } >> "$GITHUB_STEP_SUMMARY" else echo "No build summary file found (_logs/build_summary.md)" >> "$GITHUB_STEP_SUMMARY" From 2bd49f63987cdf53bad78f050b3738eb55e9f59c Mon Sep 17 00:00:00 2001 From: "Graeper Kai (ETAS-ECM/XPC-Hi)" Date: Tue, 28 Oct 2025 17:19:41 +0100 Subject: [PATCH 21/33] update to latest baselibs - with custom baselibs --- MODULE.bazel | 57 ++++++++++++++++++++++++--------------------- README.md | 2 +- integration_test.sh | 5 ++-- 3 files changed, 35 insertions(+), 29 deletions(-) diff --git a/MODULE.bazel b/MODULE.bazel index d38f352f9..2e05614c6 100644 --- a/MODULE.bazel +++ b/MODULE.bazel @@ -42,15 +42,14 @@ module( # # TODO: wrong repo?? # # TODO: name it score_logging -# bazel_dep(name = "logging... well they don't have a name yet", version = "0.0.0") +bazel_dep(name = "score-mw-log", version = "0.0.0") -# # TODO: logging does not have a single release yet. It's not in the registry. -# git_override( -# module_name = "logging... well they don't have a name yet", -# remote = "https://github.com/eclipse-score/logging.git", -# # 2025-10-07 -# commit = "I93394c8d7e6958d4568e26ffe3fb832c2eb63631", -# ) +git_override( + module_name = "score-mw-log", + remote = "https://github.com/eclipse-score/logging.git", + # 2025-10-24 + commit = "fffdb25cd7784c46a4e6d72b46309790f1fcd9ed", +) ## --- persistency --- @@ -60,9 +59,9 @@ module( bazel_dep(name = "score_persistency", version = "0.1.0") git_override( module_name = "score_persistency", - remote = "https://github.com/eclipse-score/inc_mw_per.git", + remote = "https://github.com/eclipse-score/persistency.git", # 2025-10-09, PR-140 - commit = "e5759ddf481e7fb957908dcd077799c85edfe547", + commit = "c3b737bb45ba9ddc9db0a3940ab2490c75fc3c02", ) # local_path_override( # module_name = "score_persistency", @@ -99,21 +98,21 @@ bazel_dep(name = "communication") # git_override( # module_name = "communication", # remote = "https://github.com/eclipse-score/communication.git", -# # 2025-10-07 -# commit = "dd17d1229b92fe63a6e7dd7194a8d63ea98a8a4f", +# # 2025-10-27 - Updated with tracing enum fixes +# commit = "c721401e2129f6cafdd4aaa24b842cd1f83730f1", # ) -# local_path_override( -# module_name = "communication", -# path = "../communication" -# ) - -git_override( +local_path_override( module_name = "communication", - remote = "https://github.com/etas-contrib/score_communication.git", - commit = "748fd452824e378cabe579c019e5dd18387c341e", - # 2025-10-07 + path = "../communication" ) +# git_override( +# module_name = "communication", +# remote = "https://github.com/etas-contrib/score_communication.git", +# commit = "748fd452824e378cabe579c019e5dd18387c341e", +# # 2025-10-07 +# ) + ## --- baselibs --- # TODO: rename score-baselibs to score_baselibs, use semver @@ -121,10 +120,16 @@ git_override( bazel_dep(name = "score-baselibs", version = "0.0.0") git_override( module_name = "score-baselibs", - remote = "https://github.com/eclipse-score/baselibs.git", - commit = "f02d7f427df1968df8d5f9f9aa85bf68baeb839e", - # 2025-10-07 + #remote = "https://github.com/eclipse-score/baselibs.git", + #commit = "f02d7f427df1968df8d5f9f9aa85bf68baeb839e", # 2025-10-07 + #commit = "c2d9b7e872c1e67b69256214a75c937e00d03601", # 2025-10-23 + remote = "https://github.com/etas-contrib/score_baselibs.git", + commit = "5b3a469d80c6480f633ffc789ffb1277ee89fd7f", # 2025-10-28 ) +# local_path_override( +# module_name = "score-baselibs", +# path = "../baselibs" +# ) bazel_dep(name = "score_bazel_platforms", version = "0.0.2") # Tooling @@ -191,8 +196,8 @@ use_repo(llvm, "llvm_toolchain_llvm") register_toolchains("@llvm_toolchain//:all") -bazel_dep(name = "rules_rust", version = "0.61.0") -bazel_dep(name = "score_crates", version = "0.0.2", repo_name = "crate_index") +#bazel_dep(name = "rules_rust", version = "0.61.0") +#bazel_dep(name = "score_crates", version = "0.0.2", repo_name = "crate_index") bazel_dep(name = "boost.program_options", version = "1.87.0") diff --git a/README.md b/README.md index ae78b12e9..6968ef0d7 100644 --- a/README.md +++ b/README.md @@ -7,7 +7,7 @@ Integration workspace for the Eclipse Score project. This repository is used to ### Baselibs ```bash -bazel build --config bl-x86_64-linux @score-baselibs//... --verbose_failures +bazel build --config bl-x86_64-linux @score-baselibs//score/... --verbose_failures ``` ### Communication diff --git a/integration_test.sh b/integration_test.sh index f600f1275..7b62e199f 100755 --- a/integration_test.sh +++ b/integration_test.sh @@ -10,9 +10,10 @@ SUMMARY_FILE=${SUMMARY_FILE:-_logs/build_summary.md} mkdir -p "${LOG_DIR}" || true declare -A BUILD_TARGET_GROUPS=( - [baselibs]="@score-baselibs//..." + [baselibs]="@score-baselibs//score/..." [communication]="@communication//score/... @communication//third_party/..." [persistency]="@score_persistency//src/... @score_persistency//tests/cpp_test_scenarios/... @score_persistency//tests/rust_test_scenarios/..." + [score-mw-log]="@score-mw-log//src/..." ) warn_count() { @@ -43,7 +44,7 @@ echo "" >> "${SUMMARY_FILE}" overall_warn_total=0 overall_depr_total=0 -for group in baselibs communication persistency; do +for group in "${!BUILD_TARGET_GROUPS[@]}"; do targets="${BUILD_TARGET_GROUPS[$group]}" log_file="${LOG_DIR}/${group}.log" # Log build group banner only to stdout/stderr (not into summary table file) From 15fbe9922cab35ef462783cdc49a51d63f815379 Mon Sep 17 00:00:00 2001 From: "Graeper Kai (ETAS-ECM/XPC-Hi)" Date: Tue, 28 Oct 2025 18:04:56 +0100 Subject: [PATCH 22/33] fix: local_path_override ... --- MODULE.bazel | 18 +++++++++--------- 1 file changed, 9 insertions(+), 9 deletions(-) diff --git a/MODULE.bazel b/MODULE.bazel index 2e05614c6..bd6d8cc8b 100644 --- a/MODULE.bazel +++ b/MODULE.bazel @@ -101,18 +101,18 @@ bazel_dep(name = "communication") # # 2025-10-27 - Updated with tracing enum fixes # commit = "c721401e2129f6cafdd4aaa24b842cd1f83730f1", # ) -local_path_override( - module_name = "communication", - path = "../communication" -) - -# git_override( +# local_path_override( # module_name = "communication", -# remote = "https://github.com/etas-contrib/score_communication.git", -# commit = "748fd452824e378cabe579c019e5dd18387c341e", -# # 2025-10-07 +# path = "../communication" # ) +git_override( + module_name = "communication", + remote = "https://github.com/etas-contrib/score_communication.git", + commit = "f9db227e7e78be748dbd07090886739da38d004c", + # TODO: change to eclipse-score repo and a proper commit +) + ## --- baselibs --- # TODO: rename score-baselibs to score_baselibs, use semver From f9e1913269422dce4e5c344f541379b9ddb4a21c Mon Sep 17 00:00:00 2001 From: "Graeper Kai (ETAS-ECM/XPC-Hi)" Date: Wed, 29 Oct 2025 16:40:38 +0100 Subject: [PATCH 23/33] cleanup --- .bazelrc | 57 +++++++++-- .bazelversion | 1 + .gitignore | 2 +- MODULE.bazel | 182 +---------------------------------- README.md | 1 - baselibs.bazelrc | 25 ----- communication.bazelrc | 15 --- git_override.MODULE.bazel | 65 +++++++++++++ integration_test.sh | 2 +- tools/update_git_override.py | 147 ---------------------------- user.bazelrc | 4 - 11 files changed, 118 insertions(+), 383 deletions(-) create mode 100644 .bazelversion delete mode 100644 baselibs.bazelrc delete mode 100644 communication.bazelrc create mode 100644 git_override.MODULE.bazel delete mode 100644 tools/update_git_override.py delete mode 100644 user.bazelrc diff --git a/.bazelrc b/.bazelrc index f0047d1b6..417e14823 100644 --- a/.bazelrc +++ b/.bazelrc @@ -1,19 +1,58 @@ -build --java_language_version=17 -build --tool_java_language_version=17 -build --java_runtime_version=remotejdk_17 -build --tool_java_runtime_version=remotejdk_17 +# ******************************************************************************* +# Copyright (c) 2025 Contributors to the Eclipse Foundation +# +# See the NOTICE file(s) distributed with this work for additional +# information regarding copyright ownership. +# +# This program and the accompanying materials are made available under the +# terms of the Apache License Version 2.0 which is available at +# https://www.apache.org/licenses/LICENSE-2.0 +# +# SPDX-License-Identifier: Apache-2.0 +# ******************************************************************************* -test --test_output=errors +common --registry=https://raw.githubusercontent.com/eclipse-score/bazel_registry/main/ +common --registry=https://bcr.bazel.build + + +# Flags needed by score-baselibs and communication modules. +# Do not add more! +build --@score-baselibs//score/mw/log/detail/flags:KUse_Stub_Implementation_Only=False +build --@score-baselibs//score/mw/log/flags:KRemote_Logging=False +build --@score-baselibs//score/json:base_library=nlohmann +build --@communication//score/mw/com/flags:tracing_library=stub # stop legacy behavior of creating __init__.py files build --incompatible_default_to_explicit_init_py +build --incompatible_strict_action_env +build --experimental_retain_test_configuration_across_testonly #https://github.com/bazelbuild/bazel/issues/6842 -common --registry=https://raw.githubusercontent.com/eclipse-score/bazel_registry/main/ -common --registry=https://bcr.bazel.build +test --test_tag_filters=-manual +test --test_output=errors + +build:_bl_common --host_platform=@score_bazel_platforms//:x86_64-linux + +# This config us for internal module usage ONLY. +build:bl-x86_64-linux --config=_bl_common +build:bl-x86_64-linux --platforms=@score_bazel_platforms//:x86_64-linux +build:bl-x86_64-linux --extra_toolchains=@gcc_toolchain//:host_gcc_12 + +# This config us for internal module usage ONLY. +build:bl-x86_64-qnx --config=_bl_common +build:bl-x86_64-qnx --platforms=@score_bazel_platforms//:x86_64-qnx +build:bl-x86_64-qnx --extra_toolchains=@toolchains_qnx_qcc//:qcc_x86_64 +# This config us for internal module usage ONLY. +test:bl-x86_64-linux --config=_bl_common +test:bl-x86_64-linux --build_tests_only +test:bl-x86_64-linux --test_tag_filters=-manual +test:bl-x86_64-linux --test_output=errors -try-import %workspace%/baselibs.bazelrc -try-import %workspace%/communication.bazelrc +# config from communication .bazelrc file +# unshare /dev/shm and /tmp +test --sandbox_tmpfs_path=/dev/shm +test --sandbox_tmpfs_path=/tmp +# user specific overrides (like proxy settings) try-import %workspace%/user.bazelrc diff --git a/.bazelversion b/.bazelversion new file mode 100644 index 000000000..56b6be4eb --- /dev/null +++ b/.bazelversion @@ -0,0 +1 @@ +8.3.1 diff --git a/.gitignore b/.gitignore index d851b946e..2ab8efb04 100644 --- a/.gitignore +++ b/.gitignore @@ -1,7 +1,7 @@ # Bazel bazel-* MODULE.bazel.lock -.bazelrc.user +user.bazelrc _logs diff --git a/MODULE.bazel b/MODULE.bazel index bd6d8cc8b..74f1cead4 100644 --- a/MODULE.bazel +++ b/MODULE.bazel @@ -17,134 +17,12 @@ module( compatibility_level = 0, ) -# Dependencies for integration - -## --- feo --- - -# TODO: rename feo to score_feo -# TODO: feo does not have a single release yet. It's not in the registry. -# TODO: need to install -# TODO: sudo apt-get install protobuf-compiler -# TODO: sudo apt-get install libclang-dev -# bazel_dep(name = "feo", version = "0.0.0") -# local_path_override( -# module_name = "feo", -# path = "../feo" -# ) -# git_override( -# module_name = "feo", -# remote = "https://github.com/eclipse-score/feo.git", -# # 2025-10-07 -# commit = "086f3c0971805dd72a963bba7b4f99134b19620f", -# ) - -## --- logging --- - -# # TODO: wrong repo?? -# # TODO: name it score_logging -bazel_dep(name = "score-mw-log", version = "0.0.0") - -git_override( - module_name = "score-mw-log", - remote = "https://github.com/eclipse-score/logging.git", - # 2025-10-24 - commit = "fffdb25cd7784c46a4e6d72b46309790f1fcd9ed", -) - - -## --- persistency --- - -# TODO: score_persistency does not have a single release yet. It's not in the registry. -# TODO: rename repo inc_mw_per to persistency -bazel_dep(name = "score_persistency", version = "0.1.0") -git_override( - module_name = "score_persistency", - remote = "https://github.com/eclipse-score/persistency.git", - # 2025-10-09, PR-140 - commit = "c3b737bb45ba9ddc9db0a3940ab2490c75fc3c02", -) -# local_path_override( -# module_name = "score_persistency", -# path = "../inc_mw_per" -# ) - - -## --- platform --- -bazel_dep(name = "platforms", version = "1.0.0") - -bazel_dep(name = "rules_cc", version = "0.2.1") -bazel_dep(name = "rules_license", version = "1.0.0") +include("//:git_override.MODULE.bazel") # for building documentation, verifying traceability etc. bazel_dep(name = "score_platform", version = "0.3.0") - -## -- orchestration --- - -# TODO: rename inc_orchestrator to score_orchestrator, introduce semver -# TODO: inc_orchestrator does not have a single release yet. It's not in the registry. -bazel_dep(name = "inc_orchestrator") -git_override( - module_name = "inc_orchestrator", - remote = "https://github.com/eclipse-score/inc_orchestrator.git", - commit = "9f8ed482bdf786117eb3c4c1be14a1ee58a120ab", - # 2025-10-07 -) - -## --- communication --- - -# TODO: rename communication to score_communication, introduce semver -# TODO: communication does not have a single release yet. It's not in the registry. -bazel_dep(name = "communication") -# git_override( -# module_name = "communication", -# remote = "https://github.com/eclipse-score/communication.git", -# # 2025-10-27 - Updated with tracing enum fixes -# commit = "c721401e2129f6cafdd4aaa24b842cd1f83730f1", -# ) -# local_path_override( -# module_name = "communication", -# path = "../communication" -# ) - -git_override( - module_name = "communication", - remote = "https://github.com/etas-contrib/score_communication.git", - commit = "f9db227e7e78be748dbd07090886739da38d004c", - # TODO: change to eclipse-score repo and a proper commit -) - -## --- baselibs --- - -# TODO: rename score-baselibs to score_baselibs, use semver -# TODO: score-baselibs does not have a single release yet. It's not in the registry. -bazel_dep(name = "score-baselibs", version = "0.0.0") -git_override( - module_name = "score-baselibs", - #remote = "https://github.com/eclipse-score/baselibs.git", - #commit = "f02d7f427df1968df8d5f9f9aa85bf68baeb839e", # 2025-10-07 - #commit = "c2d9b7e872c1e67b69256214a75c937e00d03601", # 2025-10-23 - remote = "https://github.com/etas-contrib/score_baselibs.git", - commit = "5b3a469d80c6480f633ffc789ffb1277ee89fd7f", # 2025-10-28 -) -# local_path_override( -# module_name = "score-baselibs", -# path = "../baselibs" -# ) bazel_dep(name = "score_bazel_platforms", version = "0.0.2") -# Tooling -bazel_dep(name = "score_tooling", version = "0.0.0") -# local_path_override( -# module_name = "score_tooling", -# path = "../tooling" -# ) -git_override( - module_name = "score_tooling", - remote = "https://github.com/eclipse-score/tooling.git", - # 2025-10-10 - commit = "b8f58954485d8a19856a3aacdc69a6cbdd12972d", -) - # QNX toolchain bazel_dep(name = "score_toolchains_qnx", version = "0.0.1") git_override( @@ -195,63 +73,7 @@ use_repo(llvm, "llvm_toolchain_llvm") register_toolchains("@llvm_toolchain//:all") - -#bazel_dep(name = "rules_rust", version = "0.61.0") -#bazel_dep(name = "score_crates", version = "0.0.2", repo_name = "crate_index") - -bazel_dep(name = "boost.program_options", version = "1.87.0") - -# Rust - -# bazel_dep(name = "rules_rust", version = "0.63.0") -# RUST_EDITION = "2021" - -# RUST_VERSION = "1.83.0" -# # Expose rust toolchain to downstream repos (feo) by not marking as dev_dependency -# rust = use_extension("@rules_rust//rust:extensions.bzl", "rust", dev_dependency=False) -# rust.toolchain( -# edition = RUST_EDITION, -# sha256s = { -# "rustc-1.83.0-x86_64-unknown-linux-gnu.tar.xz": "6ec40e0405c8cbed3b786a97d374c144b012fc831b7c22b535f8ecb524f495ad", -# "clippy-1.83.0-x86_64-unknown-linux-gnu.tar.xz": "ef6c05abcfd861ff0bca41d408e126dda195dc966ee35abee57645a12d418f5b", -# "cargo-1.83.0-x86_64-unknown-linux-gnu.tar.xz": "de834a4062d9cd200f8e0cdca894c0b98afe26f1396d80765df828880a39b98c", -# "llvm-tools-1.83.0-x86_64-unknown-linux-gnu.tar.xz": "b931673b309c229e234f03271aaa777ea149c3c41f0fb43f3ef13a272540299a", -# "rust-std-1.83.0-x86_64-unknown-linux-gnu.tar.xz": "c88fe6cb22f9d2721f26430b6bdd291e562da759e8629e2b4c7eb2c7cad705f2", -# }, -# versions = [RUST_VERSION], -# ) -# use_repo(rust, "rust_toolchains") - -# # Provide crate universe (Cargo deps) so that @feo's dev-only crate repo becomes available when building its targets from this integration workspace. -# crate = use_extension("@rules_rust//crate_universe:extensions.bzl", "crate", dev_dependency=False) -# crate.from_cargo( -# name = "cargo", -# cargo_lockfile = "@feo//:Cargo.lock", -# manifests = [ -# "@feo//:Cargo.toml", -# "@feo//examples/rust/cycle-benchmark:Cargo.toml", -# "@feo//examples/rust/mini-adas:Cargo.toml", -# "@feo//feo:Cargo.toml", -# "@feo//feo-com:Cargo.toml", -# "@feo//feo-cpp-build:Cargo.toml", -# "@feo//feo-cpp-macros:Cargo.toml", -# "@feo//feo-log:Cargo.toml", -# "@feo//feo-logger:Cargo.toml", -# "@feo//feo-time:Cargo.toml", -# "@feo//feo-tracer:Cargo.toml", -# "@feo//feo-tracing:Cargo.toml", -# "@feo//logd:Cargo.toml", -# "@feo//perfetto-model:Cargo.toml", -# ], -# ) -# use_repo(crate, "cargo") -# -------- - -# bazel_dep(name="score_docs_as_code", version = "1.3.0") - -# TODO: rename to a better suitable name, with score_ prefix -# TODO: it's not in the registry -# TODO: this is directly from qorix?? +## needed additions to build bazel_dep(name = "testing-utils") git_override( module_name = "testing-utils", diff --git a/README.md b/README.md index 6968ef0d7..2b040c440 100644 --- a/README.md +++ b/README.md @@ -13,7 +13,6 @@ bazel build --config bl-x86_64-linux @score-baselibs//score/... --verbose_failur ### Communication ```bash -bazel build @communication//score/... --verbose_failures bazel build --config bl-x86_64-linux @communication//score/... @communication//third_party/... --verbose_failures ``` diff --git a/baselibs.bazelrc b/baselibs.bazelrc deleted file mode 100644 index 0455f1038..000000000 --- a/baselibs.bazelrc +++ /dev/null @@ -1,25 +0,0 @@ -# use mw/log stub implementation by default -build:_bl_common_stub --@score-baselibs//score/mw/log/detail/flags:KUse_Stub_Implementation_Only=False -build:_bl_common_stub --@score-baselibs//score/mw/log/flags:KRemote_Logging=False -build:_bl_common_stub --@score-baselibs//score/json:base_library=nlohmann - -# use mw/log stub implementation by default -build:_bl_common --config=_bl_common_stub -build:_bl_common --incompatible_strict_action_env -build:_bl_common --host_platform=@score_bazel_platforms//:x86_64-linux - -# This config us for internal module usage ONLY. -build:bl-x86_64-linux --config=_bl_common -build:bl-x86_64-linux --platforms=@score_bazel_platforms//:x86_64-linux -build:bl-x86_64-linux --extra_toolchains=@gcc_toolchain//:host_gcc_12 - -# This config us for internal module usage ONLY. -build:bl-x86_64-qnx --config=_bl_common -build:bl-x86_64-qnx --platforms=@score_bazel_platforms//:x86_64-qnx -build:bl-x86_64-qnx --extra_toolchains=@toolchains_qnx_qcc//:qcc_x86_64 - -# This config us for internal module usage ONLY. -test:bl-x86_64-linux --config=_bl_common -test:bl-x86_64-linux --build_tests_only -test:bl-x86_64-linux --test_tag_filters=-manual -test:bl-x86_64-linux --test_output=errors diff --git a/communication.bazelrc b/communication.bazelrc deleted file mode 100644 index de4f5f0ae..000000000 --- a/communication.bazelrc +++ /dev/null @@ -1,15 +0,0 @@ - -# TODO: move flags from common to specific configs as needed - -common --@score-baselibs//score/mw/log/detail/flags:KUse_Stub_Implementation_Only=False -common --@score-baselibs//score/mw/log/flags:KRemote_Logging=False -common --@score-baselibs//score/json:base_library=nlohmann -common --@communication//score/mw/com/flags:tracing_library=stub -common --extra_toolchains=@gcc_toolchain//:host_gcc_12 -build --incompatible_strict_action_env -test --test_tag_filters=-manual -build --experimental_retain_test_configuration_across_testonly #https://github.com/bazelbuild/bazel/issues/6842 - -# unshare /dev/shm and /tmp -test --sandbox_tmpfs_path=/dev/shm -test --sandbox_tmpfs_path=/tmp \ No newline at end of file diff --git a/git_override.MODULE.bazel b/git_override.MODULE.bazel new file mode 100644 index 000000000..44e4e4be1 --- /dev/null +++ b/git_override.MODULE.bazel @@ -0,0 +1,65 @@ +# will be generated form known-good.json by script later + +# Dependencies for integration + +## --- baselibs --- +bazel_dep(name = "score-baselibs", version = "0.0.0") +git_override( + module_name = "score-baselibs", + remote = "https://github.com/etas-contrib/score_baselibs.git", + commit = "5b3a469d80c6480f633ffc789ffb1277ee89fd7f", + # TODO: change to eclipse-score repo and a proper commit +) + +## --- feo --- +# not working yet +# bazel_dep(name = "feo", version = "0.0.0") +# git_override( +# module_name = "feo", +# remote = "https://github.com/eclipse-score/feo.git", +# # 2025-10-07 +# commit = "086f3c0971805dd72a963bba7b4f99134b19620f", +# ) + +## --- logging --- +bazel_dep(name = "score-mw-log", version = "0.0.0") +git_override( + module_name = "score-mw-log", + remote = "https://github.com/eclipse-score/logging.git", + # 2025-10-24 + commit = "fffdb25cd7784c46a4e6d72b46309790f1fcd9ed", +) + +## --- persistency --- +bazel_dep(name = "score_persistency", version = "0.1.0") +git_override( + module_name = "score_persistency", + remote = "https://github.com/eclipse-score/persistency.git", + commit = "c3b737bb45ba9ddc9db0a3940ab2490c75fc3c02", +) + +## -- orchestration --- +bazel_dep(name = "inc_orchestrator") +git_override( + module_name = "inc_orchestrator", + remote = "https://github.com/eclipse-score/inc_orchestrator.git", + commit = "9f8ed482bdf786117eb3c4c1be14a1ee58a120ab", +) + +## --- communication --- +bazel_dep(name = "communication") +git_override( + module_name = "communication", + remote = "https://github.com/etas-contrib/score_communication.git", + commit = "f9db227e7e78be748dbd07090886739da38d004c", + # TODO: change to eclipse-score repo and a proper commit +) + +# Tooling +bazel_dep(name = "score_tooling", version = "0.0.0") +git_override( + module_name = "score_tooling", + remote = "https://github.com/eclipse-score/tooling.git", + # 2025-10-10 + commit = "b8f58954485d8a19856a3aacdc69a6cbdd12972d", +) diff --git a/integration_test.sh b/integration_test.sh index 7b62e199f..b14792f55 100755 --- a/integration_test.sh +++ b/integration_test.sh @@ -1,5 +1,5 @@ #!/usr/bin/env bash -set -euo pipefail +set -euox pipefail # Integration build script. # Captures warning counts for regression tracking. diff --git a/tools/update_git_override.py b/tools/update_git_override.py deleted file mode 100644 index cfc2ac122..000000000 --- a/tools/update_git_override.py +++ /dev/null @@ -1,147 +0,0 @@ -#!/usr/bin/env python3 -"""Update a commit hash of a git_override stanza in a Bazel MODULE.bazel file. - -!!! Temporary Script !!! - -Usage: - ./tools/update_git_override.py REMOTE@HASH [REMOTE@HASH ...] [--file MODULE.bazel] - -Examples: - ./tools/update_git_override.py https://github.com/eclipse-score/baselibs.git@deadbeef123... - ./tools/update_git_override.py \ - https://github.com/eclipse-score/baselibs.git@deadbeef123... \ - https://github.com/eclipse-score/tooling.git@cafebabefeedface0123... - -Behavior: - - For each REMOTE@HASH argument, finds the git_override( ... ) block whose remote matches REMOTE. - - Updates (or inserts if missing) the commit = "HASH" attribute inside that block. - - Preserves indentation and other attributes. - - If any remote is not found, exits with non-zero status and does not write changes (except still shows diff in --dry-run if partial matches occurred). - -Limitations: - - Does not validate that HASH exists in the remote repo. - - Expects reasonably well-formed Starlark (one git_override per block). - -""" -from __future__ import annotations -import argparse -import re -import sys -from pathlib import Path - -GIT_OVERRIDE_START_RE = re.compile(r"^\s*git_override\s*\(\s*$") -REMOTE_LINE_RE = re.compile(r"^\s*remote\s*=\s*\"(?P[^\"]+)\"\s*,?\s*$") -COMMIT_LINE_RE = re.compile(r"^\s*commit\s*=\s*\"(?P[0-9a-fA-F]+)\"\s*,?\s*$") - -# Simple state machine to collect a git_override block - -def parse_args(): - p = argparse.ArgumentParser(description="Update commit hash(es) for git_override remote(s)") - p.add_argument("remote_and_hash", nargs="+", help="One or more REMOTE@HASH entries e.g. https://github.com/eclipse-score/baselibs.git@abc123...") - p.add_argument("--file", default="MODULE.bazel", help="Path to MODULE.bazel (default: MODULE.bazel)") - p.add_argument("--dry-run", action="store_true", help="Show diff without writing") - return p.parse_args() - - -def main(): - args = parse_args() - # Parse all remote@hash pairs - targets = [] - for item in args.remote_and_hash: - if "@" not in item: - print(f"ERROR: argument must be REMOTE@HASH (got: {item})", file=sys.stderr) - return 2 - remote, new_hash = item.split("@", 1) - targets.append((remote, new_hash)) - module_path = Path(args.file) - if not module_path.exists(): - print(f"ERROR: file not found: {module_path}", file=sys.stderr) - return 2 - - lines = module_path.read_text().splitlines() - - # Track which remotes were updated - requested_remotes = {r for r, _ in targets} - updated_remotes = set() - updated_any = False - i = 0 - while i < len(lines): - line = lines[i] - if GIT_OVERRIDE_START_RE.match(line): - # capture block - block_start = i - i += 1 - # find end: a line with a lone ')' - while i < len(lines) and not lines[i].strip().startswith(")"): - i += 1 - block_end = i # index of line with ')' or end - block = lines[block_start:block_end+1] - - # Determine if this block matches the remote - found_remote = None - commit_idx = None - remote_idx = None - for j, bline in enumerate(block): - m_remote = REMOTE_LINE_RE.match(bline) - if m_remote: - found_remote = m_remote.group("remote") - remote_idx = j - m_commit = COMMIT_LINE_RE.match(bline) - if m_commit: - commit_idx = j - if found_remote and found_remote in requested_remotes: - # Determine target hash for this remote - new_hash = next(h for (r, h) in targets if r == found_remote) - if len(block) > 1: - m_indent = re.match(r"^(\s*)", block[1]) - indent = m_indent.group(1) if m_indent else " " - else: - indent = " " - # Prepare new commit line - new_commit_line = f"{indent}commit = \"{new_hash}\"," if not block[block_end-block_start].strip().startswith(")") else f"{indent}commit = \"{new_hash}\"," # fallback - if commit_idx is not None: - old = block[commit_idx] - block[commit_idx] = re.sub(COMMIT_LINE_RE, new_commit_line, old) - else: - # Insert commit after remote line if available else before closing paren - insert_pos = commit_idx or (remote_idx + 1 if remote_idx is not None else len(block)-1) - block.insert(insert_pos, new_commit_line) - block_end += 1 - # Replace into lines - lines[block_start:block_end+1] = block - updated_any = True - updated_remotes.add(found_remote) - # continue search (in case multiple matching blocks?) but typically one - i += 1 - - missing = requested_remotes - updated_remotes - if missing: - print("ERROR: remote(s) not found: " + ", ".join(sorted(missing)), file=sys.stderr) - if not updated_any: - return 1 - # If some were updated and some missing, still allow diff/write decision below, but exit non-zero. - exit_code_on_missing = 1 - else: - exit_code_on_missing = 0 - - new_content = "\n".join(lines) + "\n" - if args.dry_run: - old_content = module_path.read_text() - if old_content == new_content: - print("No changes.") - return exit_code_on_missing - # rudimentary diff - import difflib - diff = difflib.unified_diff(old_content.splitlines(), new_content.splitlines(), fromfile=str(module_path), tofile=str(module_path)+" (updated)") - for dline in diff: - print(dline) - return exit_code_on_missing - - module_path.write_text(new_content) - if updated_remotes: - for r in sorted(updated_remotes): - print(f"Updated commit for remote {r}") - return exit_code_on_missing - -if __name__ == "__main__": - raise SystemExit(main()) diff --git a/user.bazelrc b/user.bazelrc deleted file mode 100644 index b8ff3e9da..000000000 --- a/user.bazelrc +++ /dev/null @@ -1,4 +0,0 @@ - -startup --host_jvm_args=-Djavax.net.ssl.trustStore=/etc/ssl/certs/java/cacerts \ - --host_jvm_args=-Djavax.net.ssl.trustStorePassword=changeit - \ No newline at end of file From 73f957c8708bbd53a11e108f0be2d154765e37d0 Mon Sep 17 00:00:00 2001 From: "Graeper Kai (ETAS-ECM/XPC-Hi)" Date: Wed, 29 Oct 2025 16:47:11 +0100 Subject: [PATCH 24/33] cleanup --- .devcontainer.json | 4 ---- BUILD | 10 ---------- 2 files changed, 14 deletions(-) delete mode 100644 .devcontainer.json diff --git a/.devcontainer.json b/.devcontainer.json deleted file mode 100644 index 6627b610d..000000000 --- a/.devcontainer.json +++ /dev/null @@ -1,4 +0,0 @@ -{ - "image": "ghcr.io/eclipse-score/devcontainer:latest", - "updateContentCommand": "bazel run //:ide_support" -} diff --git a/BUILD b/BUILD index 5801e6584..83cf914f6 100644 --- a/BUILD +++ b/BUILD @@ -26,13 +26,3 @@ filegroup( srcs = ["README.md"], visibility = ["//visibility:public"], ) - -# Try to build feo rust components using local cargo -load("@rules_rust//rust:defs.bzl", "rust_library") - -# This might work if we can access the feo source directly -# rust_library( -# name = "feo_integration_test", -# srcs = ["@feo//feo:src/lib.rs"], -# deps = ["@cargo//:tracing"], -# ) From d939b2d792d8ed2851c03e426646913bf1205b85 Mon Sep 17 00:00:00 2001 From: "Graeper Kai (ETAS-ECM/XPC-Hi)" Date: Thu, 30 Oct 2025 09:16:50 +0100 Subject: [PATCH 25/33] add disk space monitoring before and after Bazel build --- .github/workflows/test_integration.yml | 19 +++++++++++++++++++ 1 file changed, 19 insertions(+) diff --git a/.github/workflows/test_integration.yml b/.github/workflows/test_integration.yml index f0b6c5a85..73426a362 100644 --- a/.github/workflows/test_integration.yml +++ b/.github/workflows/test_integration.yml @@ -34,9 +34,28 @@ jobs: disk-cache: ${{ github.workflow }} # Share repository cache between workflows. repository-cache: true + - name: Show disk space before build + run: | + echo 'Disk space before build:' + df -h + echo 'Inode usage before build:' + df -i + echo 'Largest top-level directories:' + du -h -d 1 2>/dev/null | sort -h | tail -n 20 || true - name: Bazel build targets run: | + echo 'Starting Bazel build (disk space snapshot):' + df -h | sed 's/^/PRE-BUILD DF /' ./integration_test.sh + - name: Show disk space after build + if: always() + run: | + echo 'Disk space after build:' + df -h + echo 'Inode usage after build:' + df -i + echo 'Largest top-level directories after build:' + du -h -d 1 2>/dev/null | sort -h | tail -n 20 || true - name: Publish build summary if: always() run: | From fbfab7e08498b95f1ef151957b43b252a1ac846a Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Kai=20Gr=C3=A4per?= <160226396+kgraeper@users.noreply.github.com> Date: Thu, 30 Oct 2025 11:16:28 +0100 Subject: [PATCH 26/33] Apply suggestions from code review MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Co-authored-by: Copilot <175728472+Copilot@users.noreply.github.com> Signed-off-by: Kai GrΓ€per <160226396+kgraeper@users.noreply.github.com> --- .bazelrc | 6 +++--- MODULE.bazel | 2 +- README.md | 2 +- git_override.MODULE.bazel | 2 +- 4 files changed, 6 insertions(+), 6 deletions(-) diff --git a/.bazelrc b/.bazelrc index 417e14823..5dfac971c 100644 --- a/.bazelrc +++ b/.bazelrc @@ -32,17 +32,17 @@ test --test_output=errors build:_bl_common --host_platform=@score_bazel_platforms//:x86_64-linux -# This config us for internal module usage ONLY. +# This config is for internal module usage ONLY. build:bl-x86_64-linux --config=_bl_common build:bl-x86_64-linux --platforms=@score_bazel_platforms//:x86_64-linux build:bl-x86_64-linux --extra_toolchains=@gcc_toolchain//:host_gcc_12 -# This config us for internal module usage ONLY. +# This config is for internal module usage ONLY. build:bl-x86_64-qnx --config=_bl_common build:bl-x86_64-qnx --platforms=@score_bazel_platforms//:x86_64-qnx build:bl-x86_64-qnx --extra_toolchains=@toolchains_qnx_qcc//:qcc_x86_64 -# This config us for internal module usage ONLY. +# This config is for internal module usage ONLY. test:bl-x86_64-linux --config=_bl_common test:bl-x86_64-linux --build_tests_only test:bl-x86_64-linux --test_tag_filters=-manual diff --git a/MODULE.bazel b/MODULE.bazel index 74f1cead4..3206457ae 100644 --- a/MODULE.bazel +++ b/MODULE.bazel @@ -41,7 +41,7 @@ use_repo(toolchains_qnx, "toolchains_qnx_qcc") #gcc toolchain for baselibs bazel_dep(name = "score_toolchains_gcc", version = "0.4", dev_dependency=False) -gcc = use_extension("@score_toolchains_gcc//extentions:gcc.bzl", "gcc", dev_dependency=False) +gcc = use_extension("@score_toolchains_gcc//extensions:gcc.bzl", "gcc", dev_dependency=False) gcc.toolchain( url = "https://github.com/eclipse-score/toolchains_gcc_packages/releases/download/0.0.1/x86_64-unknown-linux-gnu_gcc12.tar.gz", sha256 = "457f5f20f57528033cb840d708b507050d711ae93e009388847e113b11bf3600", diff --git a/README.md b/README.md index 2b040c440..55964e341 100644 --- a/README.md +++ b/README.md @@ -75,7 +75,7 @@ bazel test @itf//... Add test targets once cross-repo visibility constraints are clarified. -Configuration handling (instead of baseelibs.bazelrc,...) +Configuration handling (instead of baselibs.bazelrc,...) ## 🌐 Proxy & Dependency Handling diff --git a/git_override.MODULE.bazel b/git_override.MODULE.bazel index 44e4e4be1..71d62e4eb 100644 --- a/git_override.MODULE.bazel +++ b/git_override.MODULE.bazel @@ -1,4 +1,4 @@ -# will be generated form known-good.json by script later +# will be generated from known-good.json by script later # Dependencies for integration From 278b155c3b18b097b905194fc34c25c1157aec16 Mon Sep 17 00:00:00 2001 From: "Graeper Kai (ETAS-ECM/XPC-Hi)" Date: Thu, 30 Oct 2025 11:18:50 +0100 Subject: [PATCH 27/33] add total --- integration_test.sh | 3 +++ 1 file changed, 3 insertions(+) diff --git a/integration_test.sh b/integration_test.sh index b14792f55..75da1b4fc 100755 --- a/integration_test.sh +++ b/integration_test.sh @@ -84,6 +84,9 @@ for group in "${!BUILD_TARGET_GROUPS[@]}"; do echo "| ${group} | ${status_symbol} | ${duration} | ${w_count} | ${d_count} |" | tee -a "${SUMMARY_FILE}" done +# Append aggregate totals row to summary table +echo "| TOTAL | | | ${overall_warn_total} | ${overall_depr_total} |" >> "${SUMMARY_FILE}" + # Display the full build summary explicitly at the end echo '::group::Build Summary' echo '=== Build Summary (echo) ===' From 117b2df03254f20337d585920602c5d7d42d964d Mon Sep 17 00:00:00 2001 From: "Graeper Kai (ETAS-ECM/XPC-Hi)" Date: Thu, 30 Oct 2025 12:11:04 +0100 Subject: [PATCH 28/33] Apply suggestions from code review --- MODULE.bazel | 6 +++--- README.md | 2 +- git_override.MODULE.bazel | 2 +- integration_test.sh | 4 ++-- known_good.json | 38 ++++++++++++++++++++++++++++++++++++++ 5 files changed, 45 insertions(+), 7 deletions(-) create mode 100644 known_good.json diff --git a/MODULE.bazel b/MODULE.bazel index 3206457ae..19020bb47 100644 --- a/MODULE.bazel +++ b/MODULE.bazel @@ -56,13 +56,13 @@ gcc.extra_features( gcc.warning_flags( minimal_warnings = ["-Wall", "-Wno-error=deprecated-declarations", "-Wno-error=narrowing"], strict_warnings = ["-Wextra", "-Wpedantic"], - treat_warnings_as_errors = ["-Werror"], # needed by com + treat_warnings_as_errors = ["-Werror"], ) use_repo(gcc, "gcc_toolchain", "gcc_toolchain_gcc") register_toolchains("@gcc_toolchain//:all") # LLVM Toolchains -bazel_dep(name = "toolchains_llvm", version = "1.2.0") # per is using 1.2.0 +bazel_dep(name = "toolchains_llvm", version = "1.2.0") # persistency module uses 1.2.0 and does not work with 1.4.0 yet llvm = use_extension("@toolchains_llvm//toolchain/extensions:llvm.bzl", "llvm") llvm.toolchain( cxx_standard = {"": "c++17"}, @@ -81,7 +81,7 @@ git_override( remote = "https://github.com/qorix-group/testing_tools.git", ) -# # TODO: whats that? +# # TODO: What is this for? archive_override( module_name = "rules_boost", strip_prefix = "rules_boost-master", diff --git a/README.md b/README.md index 55964e341..99cc231ae 100644 --- a/README.md +++ b/README.md @@ -58,7 +58,7 @@ bazel build @feo//... --verbose_failures ```bash bazel mod graph ``` -It is working with latest baselibs (dev_dependecy = True for score_toolchains_qnx), but communication is not building with it. +It is working with latest baselibs (dev_dependency = True for score_toolchains_qnx), but communication is not building with it. ### Missing System Packages (for feo build) Install required system dependencies: diff --git a/git_override.MODULE.bazel b/git_override.MODULE.bazel index 71d62e4eb..7014bea9f 100644 --- a/git_override.MODULE.bazel +++ b/git_override.MODULE.bazel @@ -38,7 +38,7 @@ git_override( commit = "c3b737bb45ba9ddc9db0a3940ab2490c75fc3c02", ) -## -- orchestration --- +## --- orchestration --- bazel_dep(name = "inc_orchestrator") git_override( module_name = "inc_orchestrator", diff --git a/integration_test.sh b/integration_test.sh index 75da1b4fc..e0b5330d5 100755 --- a/integration_test.sh +++ b/integration_test.sh @@ -56,7 +56,7 @@ for group in "${!BUILD_TARGET_GROUPS[@]}"; do # Extra flags only for persistency group. set +e bazel build --config "${CONFIG}" \ - ${targets} \ + "${targets}" \ --extra_toolchains=@llvm_toolchain//:cc-toolchain-x86_64-linux \ --copt=-Wno-deprecated-declarations \ --verbose_failures 2>&1 | tee "$log_file" @@ -64,7 +64,7 @@ for group in "${!BUILD_TARGET_GROUPS[@]}"; do set -e else set +e - bazel build --config "${CONFIG}" ${targets} --verbose_failures 2>&1 | tee "$log_file" + bazel build --config "${CONFIG}" "${targets}" --verbose_failures 2>&1 | tee "$log_file" build_status=${PIPESTATUS[0]} set -e fi diff --git a/known_good.json b/known_good.json new file mode 100644 index 000000000..80969b5bd --- /dev/null +++ b/known_good.json @@ -0,0 +1,38 @@ +{ + "timestamp": "2025-08-13T12:55:10Z", + "modules": [ + { + "name": "score-baselibs", + "hash": "5b3a469d80c6480f633ffc789ffb1277ee89fd7f", + "repo": "https://github.com/etas-contrib/score_baselibs.git" + }, + { + "name": "score-mw-log", + "hash": "fffdb25cd7784c46a4e6d72b46309790f1fcd9ed", + "repo": "https://github.com/eclipse-score/logging.git" + }, + { + "name": "score_persistency", + "hash": "c3b737bb45ba9ddc9db0a3940ab2490c75fc3c02", + "repo": "https://github.com/eclipse-score/persistency.git" + }, + { + "name": "inc_orchestrator", + "hash": "9f8ed482bdf786117eb3c4c1be14a1ee58a120ab", + "repo": "https://github.com/eclipse-score/inc_orchestrator.git" + }, + { + "name": "communication", + "hash": "f9db227e7e78be748dbd07090886739da38d004c", + "repo": "https://github.com/etas-contrib/score_communication.git" + }, + { + "name": "score_tooling", + "hash": "b8f58954485d8a19856a3aacdc69a6cbdd12972d", + "repo": "https://github.com/eclipse-score/tooling.git" + } + ], + "manifest_sha256": "4c9b7f...", + "suite": "full", + "duration_s": 742 +} \ No newline at end of file From 35c049d4e9021a06c6e0a989e1d95551370ec62b Mon Sep 17 00:00:00 2001 From: "Graeper Kai (ETAS-ECM/XPC-Hi)" Date: Thu, 30 Oct 2025 13:14:51 +0100 Subject: [PATCH 29/33] fix copilot correction --- MODULE.bazel | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/MODULE.bazel b/MODULE.bazel index 19020bb47..fa20899fe 100644 --- a/MODULE.bazel +++ b/MODULE.bazel @@ -41,7 +41,7 @@ use_repo(toolchains_qnx, "toolchains_qnx_qcc") #gcc toolchain for baselibs bazel_dep(name = "score_toolchains_gcc", version = "0.4", dev_dependency=False) -gcc = use_extension("@score_toolchains_gcc//extensions:gcc.bzl", "gcc", dev_dependency=False) +gcc = use_extension("@score_toolchains_gcc//extentions:gcc.bzl", "gcc", dev_dependency=False) gcc.toolchain( url = "https://github.com/eclipse-score/toolchains_gcc_packages/releases/download/0.0.1/x86_64-unknown-linux-gnu_gcc12.tar.gz", sha256 = "457f5f20f57528033cb840d708b507050d711ae93e009388847e113b11bf3600", From c033fb7ec900c36a109501b757ec996f37e4772e Mon Sep 17 00:00:00 2001 From: "Graeper Kai (ETAS-ECM/XPC-Hi)" Date: Thu, 30 Oct 2025 13:17:34 +0100 Subject: [PATCH 30/33] fix copilot issue --- integration_test.sh | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/integration_test.sh b/integration_test.sh index e0b5330d5..75da1b4fc 100755 --- a/integration_test.sh +++ b/integration_test.sh @@ -56,7 +56,7 @@ for group in "${!BUILD_TARGET_GROUPS[@]}"; do # Extra flags only for persistency group. set +e bazel build --config "${CONFIG}" \ - "${targets}" \ + ${targets} \ --extra_toolchains=@llvm_toolchain//:cc-toolchain-x86_64-linux \ --copt=-Wno-deprecated-declarations \ --verbose_failures 2>&1 | tee "$log_file" @@ -64,7 +64,7 @@ for group in "${!BUILD_TARGET_GROUPS[@]}"; do set -e else set +e - bazel build --config "${CONFIG}" "${targets}" --verbose_failures 2>&1 | tee "$log_file" + bazel build --config "${CONFIG}" ${targets} --verbose_failures 2>&1 | tee "$log_file" build_status=${PIPESTATUS[0]} set -e fi From c3afe5b27c25be629fa115479e895ce72f55d069 Mon Sep 17 00:00:00 2001 From: "Graeper Kai (ETAS-ECM/XPC-Hi)" Date: Thu, 30 Oct 2025 15:23:56 +0100 Subject: [PATCH 31/33] remove branch restriction for push event in CI workflow --- .github/workflows/test_integration.yml | 1 - 1 file changed, 1 deletion(-) diff --git a/.github/workflows/test_integration.yml b/.github/workflows/test_integration.yml index 73426a362..40837fec7 100644 --- a/.github/workflows/test_integration.yml +++ b/.github/workflows/test_integration.yml @@ -18,7 +18,6 @@ name: Bazel Build some repositories on: workflow_dispatch: push: - branches: [ bazel ] jobs: integration_test: runs-on: ubuntu-latest From 142908f95e4d0eb9dcb9dba80a056408d5beee34 Mon Sep 17 00:00:00 2001 From: "Graeper Kai (ETAS-ECM/XPC-Hi)" Date: Tue, 4 Nov 2025 12:15:05 +0100 Subject: [PATCH 32/33] fix findings --- MODULE.bazel | 9 ++------- git_override.MODULE.bazel | 17 +++-------------- 2 files changed, 5 insertions(+), 21 deletions(-) diff --git a/MODULE.bazel b/MODULE.bazel index fa20899fe..82ba44526 100644 --- a/MODULE.bazel +++ b/MODULE.bazel @@ -24,12 +24,7 @@ bazel_dep(name = "score_platform", version = "0.3.0") bazel_dep(name = "score_bazel_platforms", version = "0.0.2") # QNX toolchain -bazel_dep(name = "score_toolchains_qnx", version = "0.0.1") -git_override( - module_name = "score_toolchains_qnx", - remote = "https://github.com/eclipse-score/toolchains_qnx.git", - commit = "9e2ea88985243231bec59cef023eefb5f6dfd967", -) +bazel_dep(name = "score_toolchains_qnx", version = "0.0.2") toolchains_qnx = use_extension("@score_toolchains_qnx//:extensions.bzl", "toolchains_qnx") toolchains_qnx.sdp( sha256 = "f2e0cb21c6baddbcb65f6a70610ce498e7685de8ea2e0f1648f01b327f6bac63", @@ -40,7 +35,7 @@ use_repo(toolchains_qnx, "toolchains_qnx_sdp") use_repo(toolchains_qnx, "toolchains_qnx_qcc") #gcc toolchain for baselibs -bazel_dep(name = "score_toolchains_gcc", version = "0.4", dev_dependency=False) +bazel_dep(name = "score_toolchains_gcc", version = "0.5", dev_dependency=False) gcc = use_extension("@score_toolchains_gcc//extentions:gcc.bzl", "gcc", dev_dependency=False) gcc.toolchain( url = "https://github.com/eclipse-score/toolchains_gcc_packages/releases/download/0.0.1/x86_64-unknown-linux-gnu_gcc12.tar.gz", diff --git a/git_override.MODULE.bazel b/git_override.MODULE.bazel index 7014bea9f..0fb42c4cc 100644 --- a/git_override.MODULE.bazel +++ b/git_override.MODULE.bazel @@ -11,16 +11,6 @@ git_override( # TODO: change to eclipse-score repo and a proper commit ) -## --- feo --- -# not working yet -# bazel_dep(name = "feo", version = "0.0.0") -# git_override( -# module_name = "feo", -# remote = "https://github.com/eclipse-score/feo.git", -# # 2025-10-07 -# commit = "086f3c0971805dd72a963bba7b4f99134b19620f", -# ) - ## --- logging --- bazel_dep(name = "score-mw-log", version = "0.0.0") git_override( @@ -31,7 +21,7 @@ git_override( ) ## --- persistency --- -bazel_dep(name = "score_persistency", version = "0.1.0") +bazel_dep(name = "score_persistency", version = "0.0.0") git_override( module_name = "score_persistency", remote = "https://github.com/eclipse-score/persistency.git", @@ -39,7 +29,7 @@ git_override( ) ## --- orchestration --- -bazel_dep(name = "inc_orchestrator") +bazel_dep(name = "inc_orchestrator", version = "0.0.0") git_override( module_name = "inc_orchestrator", remote = "https://github.com/eclipse-score/inc_orchestrator.git", @@ -47,7 +37,7 @@ git_override( ) ## --- communication --- -bazel_dep(name = "communication") +bazel_dep(name = "communication", version = "0.0.0") git_override( module_name = "communication", remote = "https://github.com/etas-contrib/score_communication.git", @@ -60,6 +50,5 @@ bazel_dep(name = "score_tooling", version = "0.0.0") git_override( module_name = "score_tooling", remote = "https://github.com/eclipse-score/tooling.git", - # 2025-10-10 commit = "b8f58954485d8a19856a3aacdc69a6cbdd12972d", ) From 1faafb2bce6e5e799b72d6fd168f521cb3fa1daa Mon Sep 17 00:00:00 2001 From: "Graeper Kai (ETAS-ECM/XPC-Hi)" Date: Tue, 4 Nov 2025 12:19:05 +0100 Subject: [PATCH 33/33] rename git_override.MODULE.bazel to score_modules.MODULE.bazel --- MODULE.bazel | 2 +- git_override.MODULE.bazel => score_modules.MODULE.bazel | 0 2 files changed, 1 insertion(+), 1 deletion(-) rename git_override.MODULE.bazel => score_modules.MODULE.bazel (100%) diff --git a/MODULE.bazel b/MODULE.bazel index 82ba44526..afc27c157 100644 --- a/MODULE.bazel +++ b/MODULE.bazel @@ -17,7 +17,7 @@ module( compatibility_level = 0, ) -include("//:git_override.MODULE.bazel") +include("//:score_modules.MODULE.bazel") # for building documentation, verifying traceability etc. bazel_dep(name = "score_platform", version = "0.3.0") diff --git a/git_override.MODULE.bazel b/score_modules.MODULE.bazel similarity index 100% rename from git_override.MODULE.bazel rename to score_modules.MODULE.bazel