Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
10 changes: 5 additions & 5 deletions .bazelrc
Original file line number Diff line number Diff line change
Expand Up @@ -15,12 +15,12 @@ common --registry=https://raw.githubusercontent.com/eclipse-score/bazel_registry
common --registry=https://bcr.bazel.build


# Flags needed by score-baselibs and communication modules.
# 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
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 --@score_communication//score/mw/com/flags:tracing_library=stub

# stop legacy behavior of creating __init__.py files
build --incompatible_default_to_explicit_init_py
Expand Down
32 changes: 18 additions & 14 deletions .github/workflows/test_integration.yml
Original file line number Diff line number Diff line change
Expand Up @@ -18,10 +18,28 @@ name: Bazel Build some repositories
on:
workflow_dispatch:
push:
pull_request:
jobs:
integration_test:
runs-on: ubuntu-latest
steps:
- name: Show disk space before build
run: |
echo 'Disk space before build:'
df -h
- name: Removing unneeded software
run: |
echo "Removing unneeded software... "
if [ -d /usr/share/dotnet ]; then echo "Removing dotnet..."; start=$(date +%s); sudo rm -rf /usr/share/dotnet; end=$(date +%s); echo "Duration: $((end-start))s"; fi
#if [ -d /usr/local/lib/android ]; then echo "Removing android..."; start=$(date +%s); sudo rm -rf /usr/local/lib/android; end=$(date +%s); echo "Duration: $((end-start))s"; fi
if [ -d /opt/ghc ]; then echo "Removing haskell (ghc)..."; start=$(date +%s); sudo rm -rf /opt/ghc; end=$(date +%s); echo "Duration: $((end-start))s"; fi
if [ -d /usr/local/.ghcup ]; then echo "Removing haskell (ghcup)..."; start=$(date +%s); sudo rm -rf /usr/local/.ghcup; end=$(date +%s); echo "Duration: $((end-start))s"; fi
if [ -d /usr/share/swift ]; then echo "Removing swift..."; start=$(date +%s); sudo rm -rf /usr/share/swift; end=$(date +%s); echo "Duration: $((end-start))s"; fi
if [ -d /usr/local/share/chromium ]; then echo "Removing chromium..."; start=$(date +%s); sudo rm -rf /usr/local/share/chromium; end=$(date +%s); echo "Duration: $((end-start))s"; fi
- name: Show disk space after cleanup
run: |
echo 'Disk space after cleanup:'
df -h
- name: Checkout repository
uses: actions/[email protected]
- name: Setup Bazel
Expand All @@ -33,28 +51,14 @@ 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: |
Expand Down
78 changes: 18 additions & 60 deletions MODULE.bazel
Original file line number Diff line number Diff line change
Expand Up @@ -18,82 +18,40 @@ module(
)

include("//:score_modules.MODULE.bazel")
include("//:score_toolchains.MODULE.bazel")

# for building documentation, verifying traceability etc.
bazel_dep(name = "score_platform", version = "0.3.0")
bazel_dep(name = "score_bazel_platforms", version = "0.0.2")
bazel_dep(name = "score_crates", version = "0.0.3")

# QNX toolchain
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",
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")
## Python
bazel_dep(name = "rules_python", version = "1.4.1")

#gcc toolchain for baselibs
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",
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"],
treat_warnings_as_errors = ["-Werror"],
)
use_repo(gcc, "gcc_toolchain", "gcc_toolchain_gcc")
register_toolchains("@gcc_toolchain//:all")
PYTHON_VERSION = "3.12"

bazel_dep(name = "score_test_scenarios", version = "0.3.0")
git_override(
module_name = "score_test_scenarios",
commit = "a2f9cded3deb636f5dc800bf7a47131487119721", # tag v0.3.0
remote = "https://github.com/eclipse-score/testing_tools.git",
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)

# Needed for feature integration tests
bazel_dep(name = "rules_rust", version = "0.61.0")
bazel_dep(name = "score_itf", version = "0.1.0")
# Special imports for certain modules

# # TODO: What is this for?
# communication module dependencies
# archive_override are not forwarded by bazel_dep, so we need to redefine it here
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 are not forwarded by bazel_dep, so we need to redefine it here
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)
# imports for the feature showcase module
bazel_dep(name = "rules_rust", version = "0.61.0")
bazel_dep(name = "score_itf", version = "0.1.0")
bazel_dep(name = "score_crates", version = "0.0.3")
138 changes: 73 additions & 65 deletions README.md
Original file line number Diff line number Diff line change
@@ -1,39 +1,43 @@
# Reference Integration
# Score 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.
This workspace integrates multiple Eclipse Score modules (baselibs, communication, persistency, orchestrator, feo, etc.) to validate cross-repository builds and detect integration issues early in the development cycle.

## ✅ Working Build Commands
## Overview

### Baselibs
The reference integration workspace serves as a single Bazel build environment to:
- Validate cross-module dependency graphs
- Detect label and repository boundary issues
- Test toolchain and platform support (Linux, QNX, LLVM/GCC)
- Prepare for release validation workflows

## Working Builds ✅

The following modules build successfully with the `bl-x86_64-linux` configuration:

### Baselibs
```bash
bazel build --config bl-x86_64-linux @score-baselibs//score/... --verbose_failures
bazel build --config bl-x86_64-linux @score_baselibs//score/... --verbose_failures
```

### Communication

```bash
bazel build --config bl-x86_64-linux @communication//score/... @communication//third_party/... --verbose_failures
bazel build --config bl-x86_64-linux @score_communication//score/mw/com:com --verbose_failures
```

### 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 \
--verbose_failures
bazel build --config bl-x86_64-linux \
@score_persistency//src/cpp/src/... \
@score_persistency//src/rust/... \
--verbose_failures
```

> 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.

### Orchestration and `kyron` - async runtime for Rust

```bash
bazel build @score_orchestrator//src/...
bazel build --config bl-x86_64-linux @score_orchestrator//src/...
```

## Feature showcase examples
Expand All @@ -42,61 +46,81 @@ You can run them currently for host platform using `--config bl-x86_64-linux`.

Execute `bazel query //feature_showcase/...` to obtain list of targets that You can run.

## ⚠️ Observed Issues

### 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
```bash
bazel build --config bl-x86_64-linux @score_orchestrator//src/... --verbose_failures
```

### 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?
## Known Issues ⚠️

### 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`.
### Orchestrator
**Issue:** Direct toolchain loading at `BUILD:14`
```
load("@score_toolchains_qnx//rules/fs:ifs.bzl", "qnx_ifs")
```
**Resolution needed:** Refactor to use proper toolchain resolution instead of direct load statements.

## 🚧 Not Yet Working
**Issue:** clang needs to be installed
```
sudo apt install clang
```
**Resolution needed:** why is this happening with -extra_toolchains=@gcc_toolchain//:host_gcc_12 ?

```bash
bazel build @score_persistency//src/cpp/... --extra_toolchains=@llvm_toolchain//:cc-toolchain-x86_64-linux
### Communication
**Module:** `score/mw/com/requirements`

**Issues when building from external repository:**
1. **Label inconsistency:** Some `BUILD` files use `@//third_party` instead of `//third_party` (repository-qualified vs. local label). Should standardize on local labels within the module.
2. **Outdated path reference:** `runtime_test.cpp:get_path` checks for `safe_posix_platform` (likely obsolete module name) instead of `external/score_communication+/`.

### Persistency
**Test failures in `src/cpp/tests`:**
1. **Dependency misconfiguration:** `google_benchmark` should not be a dev-only dependency if required by tests. Consider separating benchmark targets.
2. **Compiler-specific issue in `test_kvs.cpp`:** Contains GCC-specific self-move handling that is incorrect and fails with GCC (only builds with LLVM). Needs portable fix or removal of undefined behavior.

## Build Blockers 🚧

The following builds are currently failing:

### FEO (Full Build)
```bash
bazel build @feo//... --verbose_failures
```


### Persistency (Full Build)
```bash
bazel mod graph
bazel build --config bl-x86_64-linux @score_persistency//src/... --verbose_failures
```
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:
## System Dependencies

### Required Packages for FEO
Install the following system packages before building FEO:
```bash
sudo apt-get update
sudo apt-get install -y protobuf-compiler libclang-dev
```

## 🧪 To Be Done
## Pending Tasks 🧪

```bash
bazel test @itf//...
```
- [ ] Add test targets once cross-repository visibility constraints are clarified
- [ ] Normalize third-party label usage across all `BUILD` files
- [ ] Resolve FEO build failures
- [ ] Fix Persistency full build
- [ ] Address compiler-specific issues in test suites

Add test targets once cross-repo visibility constraints are clarified.
## Proxy & External Dependencies 🌐

Configuration handling (instead of baselibs.bazelrc,...)
### Current Issue

## 🌐 Proxy & Dependency Handling
The `starpls.bzl` file ([source](https://github.com/eclipse-score/tooling/blob/main/starpls/starpls.bzl)) uses `curl` directly for downloading dependencies, which:
- Bypasses Bazel's managed fetch lifecycle and dependency tracking
- Breaks reproducibility and remote caching expectations
- May fail in corporate proxy-restricted environments

`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.
### Workaround

### Possible Workaround
Use a `local_path_override` and set proxy environment variables before invoking the rule:
Use a `local_path_override` and configure proxy environment variables before building:

```bash
export http_proxy=http://127.0.0.1:3128
Expand All @@ -105,7 +129,7 @@ export HTTP_PROXY=http://127.0.0.1:3128
export HTTPS_PROXY=http://127.0.0.1:3128
```

Example Bazel module override snippet:
Add this to your `MODULE.bazel`:
```python
local_path_override(module_name = "score_tooling", path = "../tooling")
```
Expand All @@ -114,27 +138,11 @@ local_path_override(module_name = "score_tooling", path = "../tooling")
- 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.

## IDE support

### Rust

Use `./generate_rust_analyzer_support.sh` to generate rust_analyzer settings that will let VS Code work.

## 📌 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.
Loading