Skip to content
Closed
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
79 changes: 51 additions & 28 deletions .bazelrc
Original file line number Diff line number Diff line change
@@ -1,43 +1,66 @@
# *******************************************************************************
# Copyright (c) 2026 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
# *******************************************************************************

common --registry=https://raw.githubusercontent.com/eclipse-score/bazel_registry/main/
common --registry=https://bcr.bazel.build

build --java_language_version=17
build --tool_java_language_version=17
build --java_runtime_version=remotejdk_17
build --tool_java_runtime_version=remotejdk_17
build --credential_helper=*.qnx.com=%workspace%/scripts/internal/qnx_creds.py

# Common test flags for all platforms
test --test_output=errors
test --@score_baselibs//score/mw/log/flags:KRemote_Logging=False
test --@score_baselibs//score/json:base_library=nlohmann
test --cxxopt=-Wno-deprecated-declarations

common --registry=https://raw.githubusercontent.com/eclipse-score/bazel_registry/main/
common --registry=https://bcr.bazel.build
common --credential_helper=*.qnx.com=%workspace%/scripts/internal/qnx_creds.py
# Common Lifecycle Toolchain flags for build (do not use it in case of system toolchains!)
build:toolchain_common --incompatible_strict_action_env
build:toolchain_common --host_platform=@score_bazel_platforms//:x86_64-linux
## Ferrocene must be common compiler for HOST. To ensure metadata compatibility for proc macro crate
build:toolchain_common --extra_toolchains=@score_toolchains_rust//toolchains/ferrocene:ferrocene_x86_64_unknown_linux_gnu
build:stub --@score_baselibs//score/mw/log/flags:KRemote_Logging=False
build:stub --@score_baselibs//score/json:base_library=nlohmann

# Target configuration for CPU:x86-64|OS:Linux build (do not use it in case of system toolchains!)
build:x86_64-linux --config=stub
build:x86_64-linux --config=toolchain_common
build:x86_64-linux --platforms=@score_bazel_platforms//:x86_64-linux-gcc_12.2.0-posix
build:x86_64-linux --extra_toolchains=@score_gcc_x86_64_toolchain//:x86_64-linux-gcc_12.2.0-posix
build:x86_64-linux --extra_toolchains=@score_toolchains_rust//toolchains/ferrocene:ferrocene_x86_64_unknown_linux_gnu

build:x86_64-linux --platforms=@score_bazel_platforms//:x86_64-linux
build:x86_64-linux --define=config=x86_64-linux
# TODO arm64-linux when rust support is there

build:build_qnx8 --platforms=@score_bazel_platforms//:arm64-qnx8_0
build:build_qnx8 --extra_toolchains=@toolchains_qnx_qcc//:qcc_aarch64
build:build_qnx8 --extra_toolchains=@score_toolchains_rust//toolchains/aarch64-unknown-qnx8_0:toolchain_aarch64_qnx8_0
build:build_qnx8 --define=config=build_qnx8
# Target configuration for CPU:x86-64|OS:QNX build (do not use it in case of system toolchains!)
build:x86_64-qnx --config=stub
build:x86_64-qnx --config=toolchain_common
build:x86_64-qnx --platforms=@score_bazel_platforms//:x86_64-qnx-sdp_8.0.0-posix
build:x86_64-qnx --extra_toolchains=@score_qcc_x86_64_toolchain//:x86_64-qnx-sdp_8.0.0-posix
build:x86_64-qnx --extra_toolchains=@score_toolchains_rust//toolchains/ferrocene:ferrocene_x86_64_pc_nto_qnx800

# TODO: Enable when rust toolchain for x86_64-qnx becomes available
# build:x86_64-qnx --platforms=@score_bazel_platforms//:x86_64-qnx
# build:x86_64-qnx --extra_toolchains=@toolchains_qnx_qcc//:qcc_x86_64
# build:x86_64-qnx --define=config=x86_64-qnx
# Target configuration for CPU:AArch64|OS:QNX build (do not use it in case of system toolchains!)
build:arm64-qnx --config=stub
build:arm64-qnx --config=toolchain_common
build:arm64-qnx --incompatible_strict_action_env
build:arm64-qnx --platforms=@score_bazel_platforms//:aarch64-qnx-sdp_8.0.0-posix
build:arm64-qnx --extra_toolchains=@score_qcc_aarch64_toolchain//:aarch64-qnx-sdp_8.0.0-posix
build:arm64-qnx --extra_toolchains=@score_toolchains_rust//toolchains/ferrocene:ferrocene_aarch64_unknown_nto_qnx800

common --@score_baselibs//score/mw/log/flags:KRemote_Logging=False
common --@score_baselibs//score/json:base_library=nlohmann
# to be removed
build:build_qnx8 --config=arm64-qnx

## default is a stdout logger which looks like dlt logs
## uncomment below to use score::mw::log instead of the stdout logger
# build --cxxopt=-DLC_LOG_SCORE_MW_LOG

build --cxxopt=-std=c++17
build --cxxopt=-Wno-missing-template-arg-list-after-template-kw
# Required to build baselibs dependency which uses some deprecated APIs
# & mismatched new/delete
build --cxxopt=-Wno-mismatched-new-delete
build --cxxopt=-Wno-deprecated-declarations

build --strip=never
build --enable_bzlmod

common --extra_toolchains=@gcc_toolchain//:host_gcc_12
common --extra_toolchains=@score_toolchains_rust//toolchains/x86_64-unknown-linux-gnu:toolchain_x86_64_linux
20 changes: 17 additions & 3 deletions .github/workflows/build_qnx8.yml
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
# *******************************************************************************
# Copyright (c) 2025 Contributors to the Eclipse Foundation
# Copyright (c) 2026 Contributors to the Eclipse Foundation
#
# See the NOTICE file(s) distributed with this work for additional
# information regarding copyright ownership.
Expand All @@ -18,14 +18,28 @@ on:
merge_group:
types: [checks_requested]
jobs:
qnx-build:
qnx-build-arm64:
uses: eclipse-score/cicd-workflows/.github/workflows/qnx-build.yml@main
permissions:
contents: read
pull-requests: read
with:
bazel-target: '//src/...'
bazel-config: 'build_qnx8'
bazel-config: 'arm64-qnx8'
credential-helper: 'scripts/internal/qnx_creds.py'
environment-name: 'workflow-approval'
secrets:
score-qnx-license: ${{ secrets.SCORE_QNX_LICENSE }}
score-qnx-user: ${{ secrets.SCORE_QNX_USER }}
score-qnx-password: ${{ secrets.SCORE_QNX_PASSWORD }}
qnx-build-x86_64:
uses: eclipse-score/cicd-workflows/.github/workflows/qnx-build.yml@main
permissions:
contents: read
pull-requests: read
with:
bazel-target: '//src/...'
bazel-config: 'x86_64-qnx8'
credential-helper: 'scripts/internal/qnx_creds.py'
environment-name: 'workflow-approval'
secrets:
Expand Down
28 changes: 28 additions & 0 deletions .github/workflows/reference-integration.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,28 @@
# *******************************************************************************
# Copyright (c) 2026 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
# *******************************************************************************

name: Reference Integration Build

on:
pull_request:
types: [opened, reopened, synchronize]
merge_group:
types: [checks_requested]

jobs:
integration:
uses: eclipse-score/reference_integration/.github/workflows/module-integration-build.yml@main
with:
known_good: |
{ "modules": [] }
config: x86_64-linux
52 changes: 41 additions & 11 deletions .github/workflows/tests.yml
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
# *******************************************************************************
# Copyright (c) 2025 Contributors to the Eclipse Foundation
# Copyright (c) 2026 Contributors to the Eclipse Foundation
#
# See the NOTICE file(s) distributed with this work for additional
# information regarding copyright ownership.
Expand All @@ -10,19 +10,49 @@
#
# SPDX-License-Identifier: Apache-2.0
# *******************************************************************************
name: Bazel Tests

name: Tests
on:
pull_request_target:
pull_request:
types: [opened, reopened, synchronize]
merge_group:
types: [checks_requested]

jobs:
test:
name: "Run tests"
uses: eclipse-score/cicd-workflows/.github/workflows/tests.yml@main
permissions:
contents: read
pull-requests: read
with:
bazel-target: 'test //src/...'
setup-and-run-tests:
runs-on: ubuntu-latest
steps:
- name: Checkout repository
uses: actions/checkout@v4.2.2

- name: Setup Bazel with shared caching
uses: bazel-contrib/setup-bazel@0.15.0
with:
disk-cache: true
repository-cache: true
bazelisk-cache: true

- name: Bazel info (discover paths)
id: bazel-info
run: |
echo "BAZEL_OUTPUT_BASE=$(bazel info output_base)" >> $GITHUB_ENV
echo "BAZEL_USER_ROOT=$(bazel info output_user_root)" >> $GITHUB_ENV
echo "BAZEL_REPO_CACHE=$(bazel info repository_cache)" >> $GITHUB_ENV
bazel info

- name: Cache Bazel output base
uses: actions/cache@v4
with:
path: |
${{ env.BAZEL_OUTPUT_BASE }}/action_cache
${{ env.BAZEL_OUTPUT_BASE }}/bazel-out
${{ env.BAZEL_OUTPUT_BASE }}/external
${{ env.BAZEL_OUTPUT_BASE }}/execroot
key: bazel-ob-v2-${{ runner.os }}-${{ hashFiles('.bazelversion', 'MODULE.bazel', 'MODULE.bazel.lock', '**/*.bzl', 'Cargo.lock') }}
restore-keys: |
bazel-ob-v2-${{ runner.os }}-

- name: Run Tests via Bazel
run: |
echo "Running: bazel test //src/..."
bazel test --config x86_64-linux //src/...
1 change: 1 addition & 0 deletions Cargo.lock

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

1 change: 1 addition & 0 deletions Cargo.toml
Original file line number Diff line number Diff line change
Expand Up @@ -18,6 +18,7 @@ libc = "0.2.177"
clap = { version = "4.5.49", features = ["derive"] }
signal-hook = "0.3.18"

monitor_rs = { path = "src/launch_manager_daemon/health_monitor_lib/rust_bindings" } # Temporary API
health_monitoring_lib = { path = "src/health_monitoring_lib" }
score_log = { git = "https://github.com/eclipse-score/baselibs_rust.git", tag = "v0.0.4" }
score_testing_macros = { git = "https://github.com/eclipse-score/baselibs_rust.git", tag = "v0.0.4" }
Expand Down
94 changes: 49 additions & 45 deletions MODULE.bazel
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
# *******************************************************************************
# Copyright (c) 2025 Contributors to the Eclipse Foundation
# Copyright (c) 2026 Contributors to the Eclipse Foundation
#
# See the NOTICE file(s) distributed with this work for additional
# information regarding copyright ownership.
Expand All @@ -18,7 +18,7 @@ module(
# Bazel global rules
bazel_dep(name = "rules_python", version = "1.4.1")
bazel_dep(name = "rules_rust", version = "0.61.0")
bazel_dep(name = "rules_cc", version = "0.2.9")
bazel_dep(name = "rules_cc", version = "0.2.14")
bazel_dep(name = "aspect_rules_lint", version = "1.5.3")
bazel_dep(name = "buildifier_prebuilt", version = "8.2.0.2")
bazel_dep(name = "platforms", version = "1.0.0")
Expand All @@ -27,60 +27,68 @@ bazel_dep(name = "download_utils", version = "1.0.1")
bazel_dep(name = "googletest", version = "1.17.0.bcr.1")

# S-CORE process rules
bazel_dep(name = "score_bazel_platforms", version = "0.0.3")
bazel_dep(name = "score_bazel_platforms", version = "0.0.4")
bazel_dep(name = "score_docs_as_code", version = "2.3.0")
bazel_dep(name = "score_tooling", version = "1.0.5")
bazel_dep(name = "score_tooling", version = "1.1.0")
bazel_dep(name = "score_rust_policies", version = "0.0.3")

bazel_dep(name = "score_process", version = "1.4.0", dev_dependency = True)
bazel_dep(name = "score_platform", version = "0.5.1", dev_dependency = True)

# Toolchains and extensions
bazel_dep(name = "score_toolchains_gcc", version = "0.5", dev_dependency = True)
bazel_dep(name = "score_toolchains_qnx", version = "0.0.6", dev_dependency = True)
bazel_dep(name = "rust_qnx8_toolchain", version = "1.2.0", dev_dependency = True)
bazel_dep(name = "score_toolchains_rust", version = "0.1.1", dev_dependency = True)
## Configure the C++ toolchain
bazel_dep(name = "score_bazel_cpp_toolchains", version = "0.2.2", dev_dependency = True)

gcc = use_extension("@score_bazel_cpp_toolchains//extensions:gcc.bzl", "gcc", dev_dependency = True)
gcc.toolchain(
name = "score_gcc_x86_64_toolchain",
target_cpu = "x86_64",
target_os = "linux",
use_default_package = True,
version = "12.2.0",
)
gcc.toolchain(
name = "score_gcc_aarch64_toolchain",
target_cpu = "aarch64",
target_os = "linux",
use_default_package = True,
version = "12.2.0",
)
gcc.toolchain(
name = "score_qcc_x86_64_toolchain",
sdp_version = "8.0.0",
target_cpu = "x86_64",
target_os = "qnx",
use_default_package = True,
version = "12.2.0",
)
gcc.toolchain(
name = "score_qcc_aarch64_toolchain",
sdp_version = "8.0.0",
target_cpu = "aarch64",
target_os = "qnx",
use_default_package = True,
version = "12.2.0",
)
use_repo(
gcc,
"score_gcc_aarch64_toolchain",
"score_gcc_x86_64_toolchain",
"score_qcc_aarch64_toolchain",
"score_qcc_x86_64_toolchain",
)

## Rust Toolchain
bazel_dep(name = "score_toolchains_rust", version = "0.4.0", dev_dependency = True)

# S-CORE crates
bazel_dep(name = "score_crates", version = "0.0.6")

git_override(
module_name = "score_toolchains_rust",
commit = "bcf8e5364f72cf136ec81960350a82e2b5c45449",
remote = "https://github.com/eclipse-score/toolchains_rust.git",
)

git_override(
module_name = "flatbuffers",
commit = "187240970746d00bbd26b0f5873ed54d2477f9f3",
remote = "https://github.com/google/flatbuffers.git",
)

archive_override(
module_name = "rust_qnx8_toolchain",
strip_prefix = "qnx8",
urls = [
"https://github.com/qorix-group/rust-lang-qnx8/releases/download/1.2.0/qnx8_rust_toolchain.tar.gz",
],
)

# Extensions

gcc = use_extension("@score_toolchains_gcc//extentions:gcc.bzl", "gcc", dev_dependency = True)
gcc.toolchain(
sha256 = "457f5f20f57528033cb840d708b507050d711ae93e009388847e113b11bf3600",
strip_prefix = "x86_64-unknown-linux-gnu",
url = "https://github.com/eclipse-score/toolchains_gcc_packages/releases/download/0.0.1/x86_64-unknown-linux-gnu_gcc12.tar.gz",
)
use_repo(gcc, "gcc_toolchain", "gcc_toolchain_gcc")

toolchains_qnx = use_extension("@score_toolchains_qnx//:extensions.bzl", "toolchains_qnx", dev_dependency = True)
toolchains_qnx.sdp(
sha256 = "f2e0cb21c6baddbcb65f6a70610ce498e7685de8ea2e0f1648f01b327f6bac63",
strip_prefix = "installation",
url = "https://www.qnx.com/download/download/79858/installation.tgz",
)

deb = use_repo_rule("@download_utils//download/deb:defs.bzl", "download_deb")

deb(
Expand All @@ -99,11 +107,7 @@ python.toolchain(
)
use_repo(python)

use_repo(toolchains_qnx, "toolchains_qnx_sdp")
use_repo(toolchains_qnx, "toolchains_qnx_qcc")
use_repo(toolchains_qnx, "toolchains_qnx_ifs")

bazel_dep(name = "score_baselibs_rust", version = "0.0.4")
bazel_dep(name = "score_baselibs_rust", version = "0.0.5")
bazel_dep(name = "score_baselibs", version = "0.2.2")

# Hedron's Compile Commands Extractor for Bazel
Expand Down
Loading
Loading