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
Note
This repository offers a DevContainer. For setting this up and enabling code completion read eclipse-score/devcontainer/README.md#inside-the-container.
If you chose not to use the devcontainer you have to setup the following dependencies yourself.
sudo apt-get update
sudo apt-get install -y curl build-essential protobuf-compiler libclang-devcurl --proto '=https' --tlsv1.2 -sSf https://sh.rustup.rs | sh -s -- -ycurl --proto '=https' -sSfOL https://github.com/bazelbuild/bazelisk/releases/download/v1.26.0/bazelisk-amd64.deb
dpkg -i bazelisk-amd64.deb
rm bazelisk-amd64.debCorrect Bazel version will be installed on first run, based on bazelversion file.
List all targets:
bazel query //...Build selected target:
bazel build --config=score-linux-x86_64 -- <TARGET_NAME>Build all targets:
bazel build --config=score-linux-x86_64 -- //...Building without an explicit
--config(e.g.score-linux-x86_64,score-qnx-x86_64,score-qnx-aarch64) is not supported. The configscore-linux-aarch64is supported too. Its tests needqemu-user. The QNX configs need GitHub package download access and a QNX license; see QNX SDK access. Run the QNX unit tests withrun-under-qnx-x86_64orrun-under-qnx-aarch64. These configs run the tests in a QEMU VM and needqemu-system-x86_64orqemu-system-aarch64. The x86_64 VM uses KVM when it is available.
Default SDP packages from version 8.0.5 onward additionally require a GitHub token for downloads; see QNX package authentication for access and token setup. A valid QNX license is still required.
See the checker documentation for usage and baseline updates. Persistency's target is //tools/api_surface:check; use --config=score-linux-x86_64.
List all runnable targets:
bazel query 'kind(".*_binary rule", //...)'Run selected target:
bazel run --config=score-linux-x86_64 <TARGET_NAME>bazel run --config=score-linux-x86_64 //score/kvs/rust_kvs_tool:kvs_tool -- --help---------------------------------------
KVS Tool - Command Line Interface
---------------------------------------
Version 0.1.0
---------------------------------------
Options:
-h, --help Show this help message and exit
-o, --operation Specify the operation to perform (setkey, getkey, removekey,
listkeys, reset, snapshotcount, snapshotmaxcount, snapshotrestore,
getkvsfilename, gethashfilename, createtestdata)
-k, --key Specify the key to operate on (for key operations)
-p, --payload Specify the value to write (for set operations)
-s, --snapshotid Specify the snapshot ID for Snapshot operations
-d, --directory Specify the directory of the Key-Files (default is current directory)
---------------------------------------
Usage Examples:
Read a Key and show value:
kvs_tool -o getkey -k MyKey
Write a Key and use the <payload> as the data source:
(automatically detects following types: Number, Boolean, String, Null, Object, Array)
kvs_tool -o setkey -k MyKey -p 'Hello World'
kvs_tool -o setkey -k MyKey -p 'true'
kvs_tool -o setkey -k MyKey -p 15
kvs_tool -o setkey -k MyKey -p '[456,false,"Second"]'
kvs_tool -o setkey -k MyKey -p '{"sub-number":789,"sub-array":[1246,false,"Fourth"]}'
Delete a key:
kvs_tool -o removekey -k MyKey
List Keys:
kvs_tool -o listkeys
Reset KVS:
kvs_tool -o reset
Snapshot Count:
kvs_tool -o snapshotcount
Snapshot Restore:
kvs_tool -o snapshotrestore -s 1
Get KVS Filename:
kvs_tool -o getkvsfilename -s 1
Get Hash Filename:
kvs_tool -o gethashfilename -s 1
---------------------------------------
Create Test Data:
kvs_tool -o createtestdata (Creates Data provided by the example code in the KVS API)
---------------------------------------
List all test targets:
bazel query 'tests(//...)'Run selected test target:
bazel test --config=score-linux-x86_64 <TARGET_NAME>Run all tests:
bazel test --config=score-linux-x86_64 //...Run Component Integration Tests (grouped into single Test Suite):
bazel test --config=score-linux-x86_64 //:cit_tests
bazel test --config=score-qnx-x86_64 //:cit_testsComponent Integration Tests run with ITF on a target system:
a Docker container on Linux, a QEMU VM on QNX.
They need a Docker daemon (Linux) or qemu-system-x86_64 (QNX, KVM makes them much faster).
The devcontainer has no Docker, skip them there with --test_tag_filters=-integration-test.
Run clang-tidy, Clippy and Ruff, as CI does in .github/workflows/lint.yml:
bazel build --config=lint //...