Skip to content
Draft
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
104 changes: 86 additions & 18 deletions BUILD
Original file line number Diff line number Diff line change
Expand Up @@ -14,8 +14,13 @@
load("@hedron_compile_commands//:refresh_compile_commands.bzl", "refresh_compile_commands")
load("@rules_python//python:pip.bzl", "compile_pip_requirements")
load("@score_docs_as_code//:docs.bzl", "docs")
load("@score_tooling//:defs.bzl", "copyright_checker", "dash_license_checker", "rust_coverage_report", "setup_starpls", "use_format_targets")
load("@score_tooling//:defs.bzl", "dash_license_checker", "setup_starpls")
load("@score_tooling//coverage:defs.bzl", "score_coverage_reporter", "score_coverage_scope")
load("@score_tooling//cr_checker:cr_checker.bzl", "copyright_checker")
load("@score_tooling//third_party/format:macros.bzl", "use_format_targets")
load("//:project_config.bzl", "PROJECT_CONFIG")
load("@rules_cc//cc/toolchains:args.bzl", "cc_args")
load("@rules_cc//cc/toolchains:feature.bzl", "cc_feature")

# Generate `compile_commands.json`.
# Required for `clangd` support.
Expand Down Expand Up @@ -114,23 +119,6 @@ use_format_targets(languages = [
"yaml",
])

# Rust coverage report generation target
rust_coverage_report(
name = "rust_coverage",
bazel_configs = [
"x86_64-linux",
"ferrocene-coverage",
],
query = 'kind("rust_test", //score/...) except attr("tags", "loom", //score/...)',
visibility = ["//visibility:public"],
)

alias(
name = "rust_coverage_report",
actual = ":rust_coverage",
visibility = ["//visibility:public"],
)

# Docs
docs(
data = [
Expand All @@ -140,3 +128,83 @@ docs(
],
source_dir = ".",
)


# Code Coverage
exports_files(["MODULE.bazel"])
score_coverage_scope(
name = "coverage_scope",
testonly = True,
deps = [
"//score/launch_manager:launch_manager",
#"//score/health_monitor:health_monitoring_cc",
#"//score/health_monitor:health_monitoring_rust",
#"//score/launch_manager:alive_cc",
#"//score/launch_manager:alive_rust",
#"//score/launch_manager:control_cc",
#"//score/launch_manager:lifecycle_cc",
#"//score/launch_manager:lifecycle_rust",
]
)

score_coverage_reporter(
name = "reporter_wrapper",
testonly = True,
coverage_scope = ":coverage_scope",
llvm_cov = "@llvm_toolchain//:llvm-cov",
llvm_profdata = "@llvm_toolchain//:llvm-profdata",
llvm_cxxfilt = "@llvm_toolchain_llvm//:bin/llvm-cxxfilt",
)

cc_args(
name = "clang_minimal_warnings_args",
actions = [
"@rules_cc//cc/toolchains/actions:compile_actions",
],
args = [
# Suppress false positive from Clang's self-assignment overloaded check.
# See https://bugs.llvm.org/show_bug.cgi?id=43124
"-Wno-error=self-assign-overloaded",
"-Wno-return-type-c-linkage",
"-Wno-unused-command-line-argument",
# Clang-only: GCC has no -Wdeprecated-non-prototype (C2x non-prototype decls).
"-Wno-deprecated-non-prototype",
],
)

cc_feature(
name = "clang_minimal_warnings",
args = [
":clang_minimal_warnings_args",
],
feature_name = "score_lifecycle_minimal_warnings",
implies = [":minimal_warnings"],
visibility = ["//visibility:public"],
)

cc_args(
name = "minimal_warnings_args",
actions = [
"@rules_cc//cc/toolchains/actions:compile_actions",
],
args = [
"-Wall",
# Keep #warning visible without failing the build.
"-Wno-error=cpp",
"-Wno-error=deprecated-declarations",
"-Wno-unused-macros",
"-Wno-unused-parameter",
"-Wno-unused-variable",
"-Wunused-but-set-parameter",
],
visibility = ["//:__subpackages__"],
)

cc_feature(
name = "minimal_warnings",
args = [
":minimal_warnings_args",
],
feature_name = "score_communication_common_minimal_warnings",
visibility = ["//visibility:public"],
)
29 changes: 22 additions & 7 deletions MODULE.bazel
Original file line number Diff line number Diff line change
Expand Up @@ -32,7 +32,14 @@ bazel_dep(name = "google_benchmark", version = "1.9.5", dev_dependency = True)

bazel_dep(name = "score_bazel_platforms", version = "0.1.2", dev_dependency = True)
bazel_dep(name = "score_docs_as_code", version = "6.0.0", dev_dependency = True)
bazel_dep(name = "score_tooling", version = "1.3.1", dev_dependency = True)
bazel_dep(name = "score_tooling", dev_dependency = True)
git_override(
module_name = "score_tooling",
commit = "c6fb6b642284dda91acee75766a6fe2c5a832c0f",
remote = "https://github.com/eclipse-score/tooling",
)


bazel_dep(name = "score_rust_policies", version = "0.0.5", dev_dependency = True)
bazel_dep(name = "score_cpp_policies", version = "0.0.1", dev_dependency = True)
bazel_dep(name = "score_process", version = "2.0.2", dev_dependency = True)
Expand Down Expand Up @@ -83,14 +90,22 @@ use_repo(
)

# LLVM toolchain (used for clang-format and clang-tidy)
bazel_dep(name = "toolchains_llvm", version = "1.4.0", dev_dependency = True)
bazel_dep(name = "toolchains_llvm", version = "1.8.0", dev_dependency = True)

llvm = use_extension("@toolchains_llvm//toolchain/extensions:llvm.bzl", "llvm", dev_dependency = True)
llvm.toolchain(
llvm_version = "19.1.1",
stdlib = {"linux-x86_64": "stdc++"},
)
use_repo(llvm, "llvm_toolchain")
cxx_standard = {"": "c++17"},
extra_enabled_features = [
":clang_minimal_warnings",
],
extra_known_features = [
"@score_tooling//coverage:enable_llvm_coverage_for_death_tests",
"//:minimal_warnings",
],
llvm_version = "22.1.7",
stdlib = {"": "stdc++"},
)
use_repo(llvm, "llvm_toolchain", "llvm_toolchain_llvm")

# UTs on QNX
bazel_dep(name = "score_qnx_unit_tests", version = "0.2.0", dev_dependency = True)
Expand All @@ -116,7 +131,7 @@ imagefs.toolchain(
use_repo(imagefs, "score_qnx_aarch64_ifs_toolchain", "score_qnx_x86_64_ifs_toolchain")

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

# S-CORE crates
bazel_dep(name = "score_crates", version = "0.0.10")
Expand Down
Loading
Loading