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
64 changes: 48 additions & 16 deletions .bazelrc
Original file line number Diff line number Diff line change
Expand Up @@ -34,27 +34,59 @@ build --experimental_retain_test_configuration_across_testonly #https://github.c

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

# Base QNX config (shared flags)
common:qnx --host_platform=@score_bazel_platforms//:x86_64-linux
common:qnx --credential_helper=*.qnx.com=%workspace%/scripts/internal/qnx_creds.py
common:qnx --sandbox_writable_path=/var/tmp

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/x86_64-unknown-linux-gnu:toolchain_x86_64_linux

build:aarch64-linux --platforms=@score_bazel_platforms//:aarch64-linux-gcc_12.2.0-posix
build:aarch64-linux --extra_toolchains=@score_gcc_arm64_toolchain//:aarch64-linux-gcc_12.2.0-posix

build:x86_64-qnx --platforms=@score_bazel_platforms//:x86_64-qnx8_0
build:x86_64-qnx --extra_toolchains=@score_gcc_qnx_x86_64_toolchain//:x86_64-qnx-sdp_8.0.0-posix

build:aarch64-qnx --platforms=@score_bazel_platforms//:arm64-qnx8_0
build:aarch64-qnx --extra_toolchains=@score_gcc_qnx_toolchain//:aarch64-qnx-sdp_8.0.0-posix
build:aarch64-qnx --extra_toolchains=@score_toolchains_rust//toolchains/aarch64-unknown-qnx8_0:toolchain_aarch64_qnx8_0

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 --extra_toolchains=@toolchains_qnx_ifs//:ifs_x86_64
build:build_qnx8 --extra_toolchains=@toolchains_qnx_ifs//:ifs_aarch64
build:build_qnx8 --extra_toolchains=@score_toolchains_rust//toolchains/ferrocene:ferrocene_aarch64_unknown_nto_qnx800

common:qnx_x86_64 --config=qnx
common:qnx_x86_64 --platforms=@score_bazel_platforms//:x86_64-qnx8_0
common:qnx_x86_64 --extra_toolchains=@toolchains_qnx_ifs//:ifs_x86_64
common:qnx_x86_64 --extra_toolchains=@toolchains_qnx_qcc//:qcc_x86_64
common:qnx_x86_64 --extra_toolchains=@score_toolchains_rust//toolchains/ferrocene:ferrocene_x86_64_pc_nto_qnx800

common:qnx_arm64 --config=qnx
common:qnx_arm64 --platforms=@score_bazel_platforms//:arm64-qnx8_0
common:qnx_arm64 --extra_toolchains=@toolchains_qnx_ifs//:ifs_aarch64
common:qnx_arm64 --extra_toolchains=@toolchains_qnx_qcc//:qcc_aarch64
common:qnx_arm64 --extra_toolchains=@score_toolchains_rust//toolchains/ferrocene:ferrocene_aarch64_unknown_nto_qnx800

common:x86_64-qnx --config=qnx_x86_64
common:arm64-qnx --config=qnx_arm64

common --extra_toolchains=@gcc_toolchain//:host_gcc_12
common --extra_toolchains=@score_toolchains_rust//toolchains/x86_64-unknown-linux-gnu:toolchain_x86_64_linux
common --extra_toolchains=@score_toolchains_rust//toolchains/ferrocene:ferrocene_x86_64_unknown_linux_gnu

# With this instrumentation filter for our two main components, we ensure that `bazel coverage //...` is yielding the correct results
coverage --instrumentation_filter="^//score/datarouter[/:],^//score/mw/log[/:],-//score/mw/.*/test[/:]"
coverage --experimental_generate_llvm_lcov
coverage --experimental_use_llvm_covmap
# Coverage configuration for C++
coverage --features=coverage
coverage --combined_report=lcov
coverage --coverage_report_generator=@bazel_tools//tools/test/CoverageOutputGenerator/java/com/google/devtools/coverageoutputgenerator:Main
coverage --test_env=COVERAGE_GCOV_OPTIONS=-bcu
# TODO set toolchain feature once possible
# These compile time options are required to cover abnormal termination cases. In GCC one can use `__gcc_dump()`, but this does not work with LLVM
# LLVM provided these compile-time options in combination with a specific profile setting which is enabled in bazel via `LLVM_PROFILE_CONTINUOUS_MODE`
coverage --test_env=LLVM_PROFILE_CONTINUOUS_MODE=1
coverage --cxxopt -mllvm
coverage --cxxopt -runtime-counter-relocation
coverage --cache_test_results=no
coverage --instrumentation_filter="^//score[/:]"

# Coverage configuration
build:blcov-x86_64-linux --incompatible_strict_action_env
build:blcov-x86_64-linux --platforms=@score_bazel_platforms//:x86_64-linux-gcc_12.2.0-posix
build:blcov-x86_64-linux --extra_toolchains=@score_gcc_x86_64_toolchain//:x86_64-linux-gcc_12.2.0-posix
test:blcov-x86_64-linux --build_tests_only
test:blcov-x86_64-linux --test_tag_filters=-manual
test:blcov-x86_64-linux --test_output=errors
63 changes: 44 additions & 19 deletions MODULE.bazel
Original file line number Diff line number Diff line change
Expand Up @@ -26,19 +26,19 @@ bazel_dep(name = "buildifier_prebuilt", version = "7.3.1")
bazel_dep(name = "platforms", version = "1.0.0")

# 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.2.0")
bazel_dep(name = "score_tooling", version = "1.0.4")
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) # This is main score repo
bazel_dep(name = "score_platform", version = "0.5.1", dev_dependency = True)

# Toolchains and extensions
bazel_dep(name = "score_bazel_cpp_toolchains", version = "0.2.2", dev_dependency = True)
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)
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")
Expand All @@ -50,28 +50,55 @@ git_override(
remote = "https://github.com/eclipse-score/tooling.git",
)

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

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",
],
)
gcc_cpp = use_extension("@score_bazel_cpp_toolchains//extensions:gcc.bzl", "gcc", dev_dependency = True)

# Extensions
gcc_cpp.toolchain(
name = "score_gcc_x86_64_toolchain",
target_cpu = "x86_64",
target_os = "linux",
use_default_package = True,
version = "12.2.0",
)
use_repo(gcc_cpp, "score_gcc_x86_64_toolchain")

gcc_cpp.toolchain(
name = "score_gcc_arm64_toolchain",
target_cpu = "aarch64",
target_os = "linux",
version = "12.2.0",
use_default_package = True,
)
use_repo(gcc_cpp, "score_gcc_arm64_toolchain")

gcc_cpp.toolchain(
name = "score_gcc_qnx_x86_64_toolchain",
target_cpu = "x86_64",
target_os = "qnx",
sdp_version = "8.0.0",
version = "12.2.0",
use_default_package = True,
)
use_repo(gcc_cpp, "score_gcc_qnx_x86_64_toolchain")

gcc_cpp.toolchain(
name = "score_gcc_qnx_toolchain",
target_cpu = "aarch64",
target_os = "qnx",
sdp_version = "8.0.0",
version = "12.2.0",
use_default_package = True,
)
use_repo(gcc_cpp, "score_gcc_qnx_toolchain")

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")

# TRLC dependency for requirements traceability
bazel_dep(name = "trlc", version = "0.0.0", dev_dependency = True)
Expand All @@ -81,8 +108,6 @@ git_override(
remote = "https://github.com/bmw-software-engineering/trlc.git",
)

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",
Expand Down
Loading