Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
Show all changes
89 commits
Select commit Hold shift + click to select a range
610a9b9
Initial commit
eclipse-otterdog[bot] Oct 26, 2025
e48f6a5
bazel: Base changes to repository
arkjedrz Nov 16, 2025
ba9a633
bazel: add placeholder as an example
arkjedrz Nov 16, 2025
51f8453
bazel: remove xtask runs
arkjedrz Nov 16, 2025
c13290c
bazel: post-review fixes
arkjedrz Nov 17, 2025
3c6267d
bazel: add copyright checks to examples and cocs
arkjedrz Nov 18, 2025
86e0f91
bazel: small fixes
arkjedrz Nov 18, 2025
926edd1
Merge pull request #1 from qorix-group/arkjedrz_base-changes
vinodreddy-g Nov 18, 2025
987cedd
doc: bump versions
pawelrutkaq Nov 18, 2025
e52da06
Merge pull request #2 from qorix-group/pawelrutkaq_bump_doc_as_code
FScholPer Nov 19, 2025
fbafbdc
Implement AbiVec
Nov 28, 2025
69e13bc
Merge pull request #5 from qorix-group/adwi_abivec
4og Dec 2, 2025
e9f4811
Implement inline-storage and fixed-capacity queues
Dec 2, 2025
fe358f9
rustfmt: Use rustfmt from tooling
nicu1989 Dec 8, 2025
ae97edb
log: `mw_log_fmt` implementation
arkjedrz Nov 25, 2025
59a8146
Merge pull request #29 from qorix-group/nicu1989_use_rustfmt_tool
FScholPer Dec 11, 2025
d339fca
Merge pull request #13 from qorix-group/arkjedrz_mw-log-fmt
arsibo Dec 11, 2025
5120032
Add fallible construction methods
Dec 5, 2025
0d7199f
Implement inline-storage and fixed-capacity strings
Dec 8, 2025
d1da502
Use generic InsufficientCapacity error type
Dec 8, 2025
b0fbcab
Merge pull request #28 from qorix-group/adwi_abistring
4og Dec 12, 2025
bca0655
format: align formatting
arkjedrz Dec 12, 2025
d8e40b6
Merge pull request #34 from qorix-group/arkjedrz_align-formatting
pawelrutkaq Dec 16, 2025
2899e7c
Front and back accessors for queue
Dec 9, 2025
0417674
Iterators for queue
Dec 9, 2025
f0a53de
infra: align toolchains usage, deps and enable QNX8 CI
pawelrutkaq Dec 18, 2025
a0214d8
Merge pull request #42 from qorix-group/pawelrutkaq_fix_deps
dcalavrezo-qorix Dec 18, 2025
517f934
ABI-compatible Option and Result
Dec 17, 2025
9ddcea5
Merge pull request #41 from qorix-group/adwi_option-result
pawelrutkaq Dec 18, 2025
82520ef
log: `mw_log_fmt_macro` implementation
arkjedrz Nov 25, 2025
69b4651
Merge pull request #14 from qorix-group/arkjedrz_mw-log-macro
pawelrutkaq Dec 18, 2025
c9f39fa
infra: unblock tests for Miri
arkjedrz Dec 18, 2025
3e33496
Merge pull request #35 from qorix-group/arkjedrz_bump-miri-version
pawelrutkaq Dec 18, 2025
08492d0
log: `mw_log` implementation
arkjedrz Dec 11, 2025
7b0601e
Merge pull request #32 from qorix-group/arkjedrz_mw-log-main
pawelrutkaq Dec 29, 2025
e85b958
log: Rust-based backend implementation
arkjedrz Dec 29, 2025
0d56350
Merge pull request #39 from qorix-group/arkjedrz_mw-log-subscriber
pawelrutkaq Dec 29, 2025
4589f34
log: add `Box` format impl
arkjedrz Jan 7, 2026
167e682
Merge pull request #45 from qorix-group/arkjedrz_box-fmt-impl
pawelrutkaq Jan 7, 2026
bfcc9cc
log: re-export `qm` feature in `mw_log`
arkjedrz Jan 7, 2026
81850e1
Merge pull request #46 from qorix-group/arkjedrz_reexport-features
pawelrutkaq Jan 7, 2026
4668d5a
log: rename `mw_log` to `score_log`
arkjedrz Jan 19, 2026
ab25840
Merge pull request #50 from qorix-group/arkjedrz_rename-to-score-log
pawelrutkaq Jan 19, 2026
b1509bb
ArcIn: Arc with custom allocator
pawelrutkaq Jan 14, 2026
4bd37db
Merge pull request #48 from qorix-group/pawelrutkaq_simplified_arc
PiotrKorkus Jan 19, 2026
ecdd027
Testing macro crate: Auto init logging
pawelrutkaq Jan 19, 2026
da908a3
Merge pull request #51 from qorix-group/pawelrutkaq_testing_with_log
pawelrutkaq Jan 19, 2026
96c7588
Make Heap<T> be Send for T:Send
pawelrutkaq Jan 26, 2026
0f401d9
Merge pull request #54 from qorix-group/pawelrutkaq_make_heap_send
PiotrKorkus Jan 26, 2026
701d2ea
log: add Rust log init for C++
arkjedrz Jan 23, 2026
b6d4244
Merge pull request #53 from qorix-group/arkjedrz_stdout-logger-init
pawelrutkaq Jan 27, 2026
6378a7b
log: add timestamp to `stdout_logger`
arkjedrz Jan 27, 2026
5fd6e36
Merge pull request #56 from qorix-group/arkjedrz_stdout-logger-timestamp
pawelrutkaq Jan 28, 2026
8ead9d2
use new toolchain
pawelrutkaq Jan 28, 2026
1a87491
Fix headers
pawelrutkaq Jan 29, 2026
43cbaa9
Merge pull request #57 from qorix-group/pawelrutkaq_port_to_new_toolc…
pawelrutkaq Jan 29, 2026
f5969a6
Make logs belong to process
pawelrutkaq Jan 30, 2026
0998206
Merge pull request #58 from qorix-group/pawelrutkaq_extend_stdout_logger
pawelrutkaq Feb 2, 2026
e97b389
clippy: switch to rules_lint (#60)
dcalavrezo-qorix Feb 5, 2026
23771c9
coverage: added rust coverage reporting
dcalavrezo-qorix Feb 6, 2026
30a927e
formatting: fixed
dcalavrezo-qorix Feb 6, 2026
2c71cd9
Merge pull request #63 from eclipse-score/dcalavrezo_rust_coverage
dcalavrezo-qorix Feb 6, 2026
b9bcb0a
bazel: bump deps
PiotrKorkus Feb 9, 2026
551b0a3
Merge pull request #64 from qorix-group/piotrkorkus_bump_bazel_deps
pawelrutkaq Feb 10, 2026
3eb0697
cicd: build docs on release
PiotrKorkus Feb 11, 2026
93622bd
bazel: add x86 toolchains
PiotrKorkus Feb 11, 2026
bd0dd94
Merge pull request #65 from qorix-group/piotrkorkus_toolchains
pawelrutkaq Feb 13, 2026
f5e7cd3
infra: add additional toolchains to `MODULE.bazel`
arkjedrz Feb 23, 2026
85a6ecb
Merge pull request #69 from qorix-group/arkjedrz_add-toolchains
arkjedrz Feb 23, 2026
e332db3
Add ScoreDebug impls for tuples
artemsheinacn Feb 12, 2026
45f0365
Merge pull request #68 from esrlabs/cr-204704
arkjedrz Feb 23, 2026
3f21094
locking: enforce Bzlmod lockfile consistency
dcalavrezo-qorix Mar 3, 2026
b1621b0
fix: correction
dcalavrezo-qorix Mar 4, 2026
4ad014d
Merge pull request #70 from eclipse-score/dcalavrezo_lock
dcalavrezo-qorix Mar 5, 2026
c9242c7
improvement: Implement ScoreDebug for u128, Duration and AddrParseErr…
prabakaranklst Mar 20, 2026
b62fd1e
thread: add `pthread`-based threading module (#72)
arkjedrz Mar 24, 2026
fe2ca7c
datatype: Remove implementation of write_i128 and write_u128
prabakaranklst Mar 24, 2026
7caaf14
alloc: allow `containers` to use custom allocators (#77)
arkjedrz Mar 26, 2026
0f57ea4
containers: add `ScoreDebug` and `Debug` (#83)
arkjedrz Mar 27, 2026
95d0a24
feat: upgrade docs-as-code to 4.0.0 (#85)
AlexanderLanin Apr 15, 2026
cd6ce51
Fix: Upgrade dependencies (#86)
MaximilianSoerenPollak Apr 22, 2026
8834753
Feat: Upgrade Deps (#87)
MaximilianSoerenPollak Apr 27, 2026
8a54c83
adapt v07 deps (#89)
antonkri Apr 27, 2026
578658f
Merge baselibs_rust into baselibs (preserving history)
4og Jun 5, 2026
2f6fa1d
Cleanup workflows for rust
4og Jun 5, 2026
1973833
Update CODEOWNERS for Rust code
4og Jun 8, 2026
e640d0f
Remove unused setup_starpls configuration
4og Jun 8, 2026
6e5d213
ci: consolidate Clippy checks into lint.yml and remove redundant lint…
4og Jun 8, 2026
d92239f
Exclude several Rust tests on QNX as they fail
4og Jun 8, 2026
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
24 changes: 24 additions & 0 deletions .bazelrc
Original file line number Diff line number Diff line change
Expand Up @@ -24,6 +24,10 @@ build --tool_java_runtime_version=remotejdk_17
build --credential_helper="*.qnx.com=%workspace%/.github/tools/qnx_credential_helper.py"
build --experimental_retain_test_configuration_across_testonly # needed for QNX tests until bazel update to 8.6.0. See https://github.com/bazelbuild/bazel/pull/28115

# Ferrocene must be common compiler for HOST. To ensure metadata compatibility for proc macro crates!
common --extra_toolchains=@score_gcc_x86_64_toolchain//:x86_64-linux-gcc_12.2.0
common --extra_toolchains=@score_toolchains_rust//toolchains/ferrocene:ferrocene_x86_64_unknown_linux_gnu

build:_bl_stub --//score/json:base_library=nlohmann
build:_bl_stub --//score/memory/shared/flags:use_typedshmd=False

Expand All @@ -43,13 +47,15 @@ build:bl-x86_64-linux --config=_bl_stub
build:bl-x86_64-linux --config=_bl_toolchain_common
build:bl-x86_64-linux --platforms=@score_bazel_platforms//:x86_64-linux-gcc_12.2.0-posix
build:bl-x86_64-linux --extra_toolchains=@score_gcc_x86_64_toolchain//:x86_64-linux-gcc_12.2.0
build:bl-x86_64-linux --extra_toolchains=@score_toolchains_rust//toolchains/ferrocene:ferrocene_x86_64_unknown_linux_gnu
test:bl-x86_64-linux --config=_bl_common

# Target configuration for CPU:AArch64|OS:Linux build (do not use it in case of system toolchains!)
build:bl-aarch64-linux --config=_bl_stub
build:bl-aarch64-linux --config=_bl_toolchain_common
build:bl-aarch64-linux --platforms=@score_bazel_platforms//:aarch64-linux-gcc_12.2.0-posix
build:bl-aarch64-linux --extra_toolchains=@score_gcc_aarch64_toolchain//:aarch64-linux-gcc_12.2.0
build:bl-aarch64-linux --extra_toolchains=@score_toolchains_rust//toolchains/ferrocene:ferrocene_aarch64_unknown_linux_gnu
test:bl-aarch64-linux --config=_bl_common
test:bl-aarch64-linux --test_timeout=300
test:bl-aarch64-linux --run_under=//:qemu_aarch64
Expand All @@ -61,6 +67,7 @@ build:bl-x86_64-qnx --config=_bl_toolchain_common
build:bl-x86_64-qnx --platforms=@score_bazel_platforms//:x86_64-qnx-sdp_8.0.0-posix
build:bl-x86_64-qnx --extra_toolchains=@score_qcc_x86_64_toolchain//:x86_64-qnx-sdp_8.0.0
build:bl-x86_64-qnx --extra_toolchains=@score_qnx_x86_64_ifs_toolchain//:ifs-x86_64-qnx-sdp_8.0.0
build:bl-x86_64-qnx --extra_toolchains=@score_toolchains_rust//toolchains/ferrocene:ferrocene_x86_64_pc_nto_qnx800
test:bl-x86_64-qnx --config=_bl_common
test:bl-x86_64-qnx --run_under=@score_qnx_unit_tests//src:run_under_qnx
test:bl-x86_64-qnx --test_tag_filters=
Expand All @@ -73,12 +80,29 @@ build:bl-aarch64-qnx --incompatible_strict_action_env
build:bl-aarch64-qnx --platforms=@score_bazel_platforms//:aarch64-qnx-sdp_8.0.0-posix
build:bl-aarch64-qnx --extra_toolchains=@score_qcc_aarch64_toolchain//:aarch64-qnx-sdp_8.0.0
build:bl-aarch64-qnx --extra_toolchains=@score_qnx_aarch64_ifs_toolchain//:ifs-aarch64-qnx-sdp_8.0.0
build:bl-aarch64-qnx --extra_toolchains=@score_toolchains_rust//toolchains/ferrocene:ferrocene_aarch64_unknown_nto_qnx800
test:bl-aarch64-qnx --config=_bl_common
test:bl-aarch64-qnx --test_timeout=300
test:bl-aarch64-qnx --run_under=@score_qnx_unit_tests//src:run_under_qnx
test:bl-aarch64-qnx --test_tag_filters=
test:bl-aarch64-qnx --test_lang_filters=cc,rust

# Ferrocene Rust coverage config
build:ferrocene-coverage --@rules_rust//rust/settings:extra_rustc_flag=-Cinstrument-coverage
build:ferrocene-coverage --@rules_rust//rust/settings:extra_rustc_flag=-Clink-dead-code
build:ferrocene-coverage --@rules_rust//rust/settings:extra_rustc_flag=-Ccodegen-units=1
build:ferrocene-coverage --@rules_rust//rust/settings:extra_rustc_flag=-Cdebuginfo=2
build:ferrocene-coverage --@rules_rust//rust/settings:extra_exec_rustc_flag=-Cinstrument-coverage
build:ferrocene-coverage --@rules_rust//rust/settings:extra_exec_rustc_flag=-Clink-dead-code
build:ferrocene-coverage --@rules_rust//rust/settings:extra_exec_rustc_flag=-Ccodegen-units=1
build:ferrocene-coverage --@rules_rust//rust/settings:extra_exec_rustc_flag=-Cdebuginfo=2
test:ferrocene-coverage --run_under=@score_tooling//coverage:llvm_profile_wrapper

# Clippy linting for Rust
build --aspects=@score_rust_policies//clippy:linters.bzl%clippy_strict
build --output_groups=+rules_lint_human
build:lint --@aspect_rules_lint//lint:fail_on_violation=true

# Coverage configuration for C++
coverage --features=coverage
coverage --combined_report=lcov
Expand Down
4 changes: 4 additions & 0 deletions .github/CODEOWNERS
Original file line number Diff line number Diff line change
Expand Up @@ -6,4 +6,8 @@
# default owners
* @antonkri @4og

/* @antonkri @4og @pawelrutkaq @arkjedrz
/.github @antonkri @4og @pawelrutkaq @arkjedrz
/docs @antonkri @4og @aschemmel-tech
/examples @antonkri @4og @pawelrutkaq @arkjedrz
/src @antonkri @4og @pawelrutkaq @arkjedrz
47 changes: 47 additions & 0 deletions .github/actions/setup-rust-build/action.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,47 @@
# *******************************************************************************
# 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: 'Setup Rust Build Environment'
description: 'Checks out code, installs protoc, and caches cargo dependencies'
inputs:
repo-token:
description: 'GitHub token for protoc downloads'
required: true
runs:
using: "composite"
steps:
- name: Checkout Repository
uses: actions/checkout@v4
- name: Install protoc 26.1
uses: arduino/setup-protoc@v3
with:
version: 26.1
repo-token: ${{ inputs.repo-token }}
- name: Cache cargo & target
uses: actions/cache@v3
with:
path: |
~/.cargo/registry
~/.cargo/git
target
~/.cargo/bin
key: ${{ runner.os }}-cargo-${{ hashFiles('**/Cargo.lock') }}
restore-keys: |
${{ runner.os }}-cargo-
- name: Install cargo-tarpaulin if not already installed
run: |
if ! command -v cargo-tarpaulin > /dev/null; then
cargo install cargo-tarpaulin --version 0.32.7 --locked
else
echo "cargo-tarpaulin is already installed"
fi
shell: bash
6 changes: 4 additions & 2 deletions .github/workflows/build_linux.yml
Original file line number Diff line number Diff line change
Expand Up @@ -31,15 +31,17 @@ jobs:
matrix:
include:
- bazel-config: bl-x86_64-linux
bazel-build-target: "//score/..."
bazel-build-target: "//score/... //src/..."
bazel-test-target: >-
//score/...
//src/...
-//score/language/safecpp/aborts_upon_exception:abortsuponexception_toolchain_test
bazel-test-extra-flags: ""
- bazel-config: bl-aarch64-linux
bazel-build-target: "//score/..."
bazel-build-target: "//score/... //src/..."
bazel-test-target: >-
//score/...
//src/...
-//score/language/safecpp/aborts_upon_exception:abortsuponexception_toolchain_test
-//score/os/test:acl_test
-//score/os/test:errno_test
Expand Down
8 changes: 7 additions & 1 deletion .github/workflows/build_qnx.yml
Original file line number Diff line number Diff line change
Expand Up @@ -30,28 +30,34 @@ jobs:
- bazel-config: bl-x86_64-qnx
bazel-test-target: >-
//score/...
//src/...
-//score/language/futurecpp/tests:memory_resource_test
-//score/language/futurecpp/tests:zip_iterator_test
-//score/language/safecpp/aborts_upon_exception:abortsuponexception_toolchain_test
-//score/memory/shared:shared_memory_factory_test
-//score/memory/shared:shared_memory_resource_open_test
-//score/os/test:asil_qm_test
-//score/os/test:grp_test
-//src/containers:tests
- bazel-config: bl-aarch64-qnx
bazel-test-target: >-
//score/...
//src/...
-//score/language/futurecpp/tests:memory_resource_test
-//score/language/safecpp/aborts_upon_exception:abortsuponexception_toolchain_test
-//score/memory/shared:shared_memory_factory_test
-//score/memory/shared:shared_memory_resource_open_test
-//score/os/utils/inotify:unit_test
-//src/containers:tests
-//src/pal:tests
-//src/thread:tests
extra-bazel-test-flags: "--test_timeout=120,600,1800,7200" # Increase test timeout due to QEMU emulation
uses: eclipse-score/cicd-workflows/.github/workflows/qnx-build.yml@af347722c7ae3ed85518895c11268d96ac728f62
permissions:
contents: read
pull-requests: read
with:
bazel-target: "//score/..."
bazel-target: "//score/... //src/..."
bazel-config: ${{ matrix.bazel-config }}
bazel-test-target: ${{ matrix.bazel-test-target }}
credential-helper: ".github/tools/qnx_credential_helper.py"
Expand Down
76 changes: 76 additions & 0 deletions .github/workflows/cargo_required.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,76 @@
# *******************************************************************************
# 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
# *******************************************************************************
name: cargo build, test, coverage and miri report
on:
push:
branches: [main, development]
pull_request:
branches: [main, development]
types: [opened, ready_for_review, reopened, synchronize]
env:
CARGO_TERM_COLOR: always
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
jobs:
cargo-checks:
#permissions for docs deployment
permissions:
contents: write
pages: write
id-token: write
runs-on: ${{ vars.REPO_RUNNER_LABELS && fromJSON(vars.REPO_RUNNER_LABELS) || 'ubuntu-latest' }}
timeout-minutes: 45 # minutes is the maximum allowed for a cold run
steps:
- name: Checkout Repository
uses: actions/checkout@v4
- name: Setup Rust Build Environment
uses: ./.github/actions/setup-rust-build
with:
repo-token: ${{ secrets.GITHUB_TOKEN }}
# ---------- BUILD ----------
- name: Cargo build
run: cargo build --verbose
# ---------- TARPAULIN(TEST + COVERAGE) ----------
- name: Run tests under coverage
run: cargo +nightly tarpaulin --version 0.32.7 --skip-clean --out Html --verbose --no-dead-code --engine llvm --all-features
- name: Upload coverage report
uses: actions/upload-artifact@v4
with:
name: coverage-report
path: tarpaulin-report.html
# ---------- MIRI ----------
- name: Install nightly + miri (minimal profile)
uses: actions-rs/toolchain@v1
if: github.event.pull_request.draft == false
with:
toolchain: nightly-2025-12-15
profile: minimal
components: miri
override: true
- name: Prefetch crates for nightly
if: github.event.pull_request.draft == false
run: cargo +nightly-2025-12-15 fetch --locked
- name: Purge Miri artifacts
if: github.event.pull_request.draft == false
run: |
rm -rf target/miri
rm -rf ~/.cache/miri
- name: Prefetch and build dependencies for Miri
if: github.event.pull_request.draft == false
run: cargo +nightly-2025-12-15 miri setup
- name: Run Miri and save report
if: github.event.pull_request.draft == false
env:
CARGO_INCREMENTAL: "0" # turn off incremental
run: |
set -o pipefail
cargo +nightly-2025-12-15 miri test --workspace 2>&1 | tee miri_report.txt
5 changes: 5 additions & 0 deletions .github/workflows/lint.yml
Original file line number Diff line number Diff line change
Expand Up @@ -41,3 +41,8 @@ jobs:
- name: Bazel Build with clang-tidy
run: |
bazel build --config clang_tidy -- //...
lint-clippy:
uses: eclipse-score/cicd-workflows/.github/workflows/static-analysis.yml@af347722c7ae3ed85518895c11268d96ac728f62
with:
bazel-targets: "//src/..."
bazel-config: "lint"
27 changes: 27 additions & 0 deletions .github/workflows/rust_coverage.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,27 @@
# *******************************************************************************
# 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: Rust Coverage (Demo)
on:
pull_request:
types: [opened, reopened, synchronize]
workflow_dispatch:
jobs:
rust_coverage:
uses: eclipse-score/cicd-workflows/.github/workflows/rust-coverage.yml@main
with:
bazel-test-targets: "//src/..."
bazel-test-config-flags: "--config=ferrocene-coverage"
bazel-test-args: "--lockfile_mode=error"
coverage-target: "//:rust_coverage"
min-coverage: 0
coverage-artifact-name: "rust-coverage-html"
53 changes: 51 additions & 2 deletions BUILD
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
# *******************************************************************************
# Copyright (c) 2024 Contributors to the Eclipse Foundation
# Copyright (c) 2025 Contributors to the Eclipse Foundation
#
# See the NOTICE file(s) distributed with this work for additional
# information regarding copyright ownership.
Expand All @@ -13,7 +13,8 @@

load("@score_bazel_tools_cc//quality:defs.bzl", "clang_format_config", "quality_clang_tidy_config")
load("@score_docs_as_code//:docs.bzl", "docs")
load("@score_tooling//:defs.bzl", "copyright_checker", "use_format_targets")
load("@score_tooling//:defs.bzl", "copyright_checker", "dash_license_checker", "rust_coverage_report", "use_format_targets")
load("//:project_config.bzl", "PROJECT_CONFIG")
load(":qemu.bzl", "qemu_aarch64")

docs(
Expand All @@ -30,7 +31,9 @@ copyright_checker(
".github",
"bazel",
"docs",
"examples",
"score",
"src",
"third_party",
"//:BUILD",
"//:MODULE.bazel",
Expand All @@ -42,6 +45,52 @@ copyright_checker(
visibility = ["//visibility:public"],
)

# Needed for Dash tool to check python dependency licenses.
# This is a workaround to filter out local packages from the Cargo.lock file.
# The tool is intended for third-party content.
genrule(
name = "filtered_cargo_lock",
srcs = ["Cargo.lock"],
outs = ["Cargo.lock.filtered"],
cmd = """
awk '
BEGIN { skip = 0; data = "" }
/^\\[\\[package\\]\\]/ {
if (data != "" && !skip) print data;
skip = 1;
data = $$0;
next;
}
data != "" { data = data "\\n" $$0 }
# any package that has a "source = " line will not be skipped.
/^source = / { skip = 0 }
END { if (data != "" && !skip) print data }
' $(location Cargo.lock) > $@
""",
)

dash_license_checker(
src = ":filtered_cargo_lock",
file_type = "", # let it auto-detect based on project_config
project_config = PROJECT_CONFIG,
visibility = ["//visibility:public"],
)

rust_coverage_report(
name = "rust_coverage",
bazel_configs = [
"ferrocene-coverage",
],
query = 'kind("rust_test", //src/...) except //src/log/score_log_fmt_macro:tests',
visibility = ["//visibility:public"],
)

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

qemu_aarch64()

use_format_targets()
Expand Down
Loading
Loading