Skip to content
Merged
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
37 changes: 33 additions & 4 deletions .bazelrc
Original file line number Diff line number Diff line change
@@ -1,29 +1,58 @@
# *******************************************************************************
# 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
# *******************************************************************************

# -------------------------------------------------------------------------------
# Links to S-CORE Bazel registry and Bazel Central Registry
# -------------------------------------------------------------------------------
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

# -------------------------------------------------------------------------------
# Default flags (all configurations)
# -------------------------------------------------------------------------------
build --java_language_version=17
build --tool_java_language_version=17
build --java_runtime_version=remotejdk_17
build --tool_java_runtime_version=remotejdk_17

test --test_output=errors

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

# Ferrocene must be common compiler for HOST. To ensure metadata compatibility for proc macro crates!
build:_common --extra_toolchains=@score_toolchains_rust//toolchains/ferrocene:ferrocene_x86_64_unknown_linux_gnu


# -------------------------------------------------------------------------------
# Config dedicated to target platform CPU:arm64 and OS:QNX
# -------------------------------------------------------------------------------
build:arm64-qnx --config=_common
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

# -------------------------------------------------------------------------------
# Config dedicated to target platform CPU:x86_64 and OS:QNX
# -------------------------------------------------------------------------------
build:x86_64-qnx --config=_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 arm64 when rust support is there

# -------------------------------------------------------------------------------
# Config dedicated to host platform CPU:x86_64 and OS:Linux
# -------------------------------------------------------------------------------
build:x86_64-linux --config=_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
Expand Down
4 changes: 2 additions & 2 deletions .github/workflows/build_qnx8.yml
Original file line number Diff line number Diff line change
Expand Up @@ -25,7 +25,7 @@ jobs:
pull-requests: read
with:
bazel-target: '//src/...'
bazel-config: 'arm64-qnx8'
bazel-config: 'arm64-qnx'
credential-helper: 'scripts/internal/qnx_creds.py'
environment-name: 'workflow-approval'
secrets:
Expand All @@ -39,7 +39,7 @@ jobs:
pull-requests: read
with:
bazel-target: '//src/...'
bazel-config: 'x86_64-qnx8'
bazel-config: 'x86_64-qnx'
credential-helper: 'scripts/internal/qnx_creds.py'
environment-name: 'workflow-approval'
secrets:
Expand Down
52 changes: 27 additions & 25 deletions MODULE.bazel
Original file line number Diff line number Diff line change
Expand Up @@ -33,40 +33,25 @@ bazel_dep(name = "platforms", version = "1.0.0")

# S-CORE process rules
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_docs_as_code", version = "3.0.0")
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.2.1", dev_dependency = True)
bazel_dep(name = "score_platform", version = "0.4.2", dev_dependency = True) # This is main score repo
bazel_dep(name = "score_virtualization", version = "0.0.1", dev_dependency = True)
bazel_dep(name = "score_process", version = "1.4.3", dev_dependency = True)
bazel_dep(name = "score_platform", version = "0.5.2", dev_dependency = True) # This is main score repo
git_override(
module_name = "score_platform",
commit = "6ef2b8c740eb538d9b9b44fabd3dea5e0a888da6",
remote = "https://github.com/qorix-group/score.git",
)

# Toolchains and extensions
bazel_dep(name = "score_bazel_cpp_toolchains", version = "0.2.2", dev_dependency = True)
bazel_dep(name = "score_toolchains_rust", version = "0.4.0", dev_dependency = True)

# Others
bazel_dep(name = "custom_qemu", version = "1.0.0", dev_dependency = True)

bazel_dep(name = "googletest", version = "1.14.0")

bazel_dep(name = "score_test_scenarios", version = "0.3.1", dev_dependency = True)

# Overrides
git_override(
module_name = "score_virtualization",
commit = "99d3f153c43796b67a63e82aad1ede6a881aa6af",
remote = "https://github.com/qorix-group/score_virtualization.git",
)

archive_override(
module_name = "custom_qemu",
integrity = "sha256-3V2d+p7nP0tsbrVWOPYUSJogLNal43CIAHEto6Vjdfg=",
strip_prefix = "third_party", # matches top-level dir in the tar
urls = [
"https://github.com/qorix-group/custom-qemu/releases/download/1.0.0/custom_qemu.tar.gz",
],
)

gcc = use_extension("@score_bazel_cpp_toolchains//extensions:gcc.bzl", "gcc", dev_dependency = True)
gcc.toolchain(
name = "score_gcc_x86_64_toolchain",
Expand Down Expand Up @@ -125,5 +110,22 @@ use_repo(python)

use_repo(pip, "pip_score_venv_test")

bazel_dep(name = "score_virtualization", version = "0.0.3", dev_dependency = True)
git_override(
module_name = "score_virtualization",
commit = "99d3f153c43796b67a63e82aad1ede6a881aa6af",
remote = "https://github.com/qorix-group/score_virtualization.git",
)

bazel_dep(name = "custom_qemu", version = "1.0.0", dev_dependency = True)
archive_override(
module_name = "custom_qemu",
integrity = "sha256-3V2d+p7nP0tsbrVWOPYUSJogLNal43CIAHEto6Vjdfg=",
strip_prefix = "third_party", # matches top-level dir in the tar
urls = [
"https://github.com/qorix-group/custom-qemu/releases/download/1.0.0/custom_qemu.tar.gz",
],
)

# S-CORE crates
bazel_dep(name = "score_crates", version = "0.0.7")
27 changes: 14 additions & 13 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -6,8 +6,6 @@ Repository for **safe async runtime** called **kyron** for Rust
[![Nightly CIT (Bazel)](../../actions/workflows/component_integration_tests_bazel.yml/badge.svg)](../../actions/workflows/component_integration_tests_bazel.yml)
[![Kyron Examples](https://img.shields.io/badge/Kyron-examples-red?style=flat&link=https%3A%2F%2Fgithub.com%2Feclipse-score%kyron%2Ftree%2Fmain%2Fsrc%2Fkyron)](src/kyron/README.md)



## Feature status and roadmap

* [Async Runtime](src/kyron/doc/features.md)
Expand All @@ -17,19 +15,21 @@ Repository for **safe async runtime** called **kyron** for Rust
This repository includes two GitHub Actions workflows for component integration testing:

### Component Integration Tests (Cargo-based)
- **Schedule**: Runs nightly at 1:45 UTC
- **Build System**: Uses Cargo for Rust components
- **Testing**: Executes Python test suite with pytest
- **Nightly Mode**: Runs tests 20 times with `--count 20 --repeat-scope session` for enhanced

* **Schedule**: Runs nightly at 1:45 UTC
* **Build System**: Uses Cargo for Rust components
* **Testing**: Executes Python test suite with pytest
* **Nightly Mode**: Runs tests 20 times with `--count 20 --repeat-scope session` for enhanced
reliability testing
- **Triggers**: Push/PR to main/development branches, and scheduled nightly runs
* **Triggers**: Push/PR to main/development branches, and scheduled nightly runs

### Component Integration Tests (Bazel-based)
- **Schedule**: Runs nightly at 1:15 UTC
- **Build System**: Uses Bazel for all components
- **Testing**: Builds Rust test scenarios and runs Python component integration tests
- **Nightly Mode**: Uses `cit_repeat` target for flake detection
- **Triggers**: Push/PR to main/development branches, and scheduled nightly runs

* **Schedule**: Runs nightly at 1:15 UTC
* **Build System**: Uses Bazel for all components
* **Testing**: Builds Rust test scenarios and runs Python component integration tests
* **Nightly Mode**: Uses `cit_repeat` target for flake detection
* **Triggers**: Push/PR to main/development branches, and scheduled nightly runs

Monitor via the status badges above and the Actions tab

Expand All @@ -40,6 +40,7 @@ Monitor via the status badges above and the Actions tab
```bash
sudo apt-get update
sudo apt-get install -y curl build-essential protobuf-compiler libclang-dev git python3-dev python-is-python3 python3-venv
sudo apt install libc++-dev libc++abi-dev libstdc++-dev g++
```

### Rust installation
Expand Down Expand Up @@ -91,8 +92,8 @@ Please follow
to get access to QNX8 and how to setup QNX8 for `S-CORE`. In above link You will also find an
instructions how to replace SDP in case You need to use other one (ie HW specific).


### Building

```bash
./scripts/build_qnx8.sh BAZEL_TARGET (default is //src/...)
```
Expand Down
2 changes: 1 addition & 1 deletion rust-toolchain.toml
Original file line number Diff line number Diff line change
@@ -1,2 +1,2 @@
[toolchain]
channel = "1.85.0"
channel = "1.90.0"
9 changes: 7 additions & 2 deletions rustfmt.toml
Original file line number Diff line number Diff line change
@@ -1,6 +1,11 @@
# rust formatter rules.
# check configuration fields here: https://rust-lang.github.io/rustfmt/?version=v1.6.0&search=


# We need to support `cargo fmt` for crates.io
edition = "2021"
tab_spaces = 4
max_width = 150
match_block_trailing_comma = true
max_width = 120
force_explicit_abi = true
newline_style = "Unix"
use_field_init_shorthand = true
6 changes: 3 additions & 3 deletions src/kyron-foundation/src/base/fast_rand.rs
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 @@ -9,7 +9,7 @@
// <https://www.apache.org/licenses/LICENSE-2.0>
//
// SPDX-License-Identifier: Apache-2.0
//
// *******************************************************************************

///
/// Minimal, very fast basic random num gen, suitable when enough is to have something random (no crypto suitable etc)
Expand Down
6 changes: 3 additions & 3 deletions src/kyron-foundation/src/base/mod.rs
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 @@ -9,6 +9,6 @@
// <https://www.apache.org/licenses/LICENSE-2.0>
//
// SPDX-License-Identifier: Apache-2.0
//
// *******************************************************************************

pub mod fast_rand;
6 changes: 3 additions & 3 deletions src/kyron-foundation/src/cell/mod.rs
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 @@ -9,7 +9,7 @@
// <https://www.apache.org/licenses/LICENSE-2.0>
//
// SPDX-License-Identifier: Apache-2.0
//
// *******************************************************************************

#[cfg(loom)]
pub use loom::cell::{ConstPtr, MutPtr, UnsafeCell};
Expand Down
10 changes: 6 additions & 4 deletions src/kyron-foundation/src/containers/growable_vec.rs
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 @@ -9,7 +9,7 @@
// <https://www.apache.org/licenses/LICENSE-2.0>
//
// SPDX-License-Identifier: Apache-2.0
//
// *******************************************************************************

use crate::containers::vector_extension::VectorExtension;
use ::core::{
Expand Down Expand Up @@ -165,7 +165,9 @@ impl<T> Into<Vec<T>> for GrowableVec<T> {

// Reverse order
for _ in 0..self.len() {
first.push(self.pop().unwrap()).expect("Failed to push value during conversion");
first
.push(self.pop().unwrap())
.expect("Failed to push value during conversion");
}

let len = first.len();
Expand Down
40 changes: 29 additions & 11 deletions src/kyron-foundation/src/containers/intrusive_linked_list.rs
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 @@ -9,7 +9,7 @@
// <https://www.apache.org/licenses/LICENSE-2.0>
//
// SPDX-License-Identifier: Apache-2.0
//
// *******************************************************************************

use crate::cell::UnsafeCell;
use core::marker::PhantomPinned;
Expand Down Expand Up @@ -189,7 +189,7 @@ impl<I: Item> List<I> {
} else {
false
}
}
},
_ => {
// If this is not the last item, we need to remove it from the list.
let mut curr = self.head.as_ptr() as *const Link;
Expand All @@ -208,7 +208,7 @@ impl<I: Item> List<I> {
}

false
}
},
}
}

Expand Down Expand Up @@ -424,9 +424,18 @@ mod tests {
}

{
let item1 = TestItem { value: 1, link: Link::new() };
let item2 = TestItem { value: 2, link: Link::new() };
let item3 = TestItem { value: 3, link: Link::new() };
let item1 = TestItem {
value: 1,
link: Link::new(),
};
let item2 = TestItem {
value: 2,
link: Link::new(),
};
let item3 = TestItem {
value: 3,
link: Link::new(),
};
let mut list: List<TestItem> = Default::default();
unsafe {
list.push_back(&item1);
Expand All @@ -443,9 +452,18 @@ mod tests {
}

{
let item1 = TestItem { value: 2, link: Link::new() };
let item2 = TestItem { value: 2, link: Link::new() };
let item3 = TestItem { value: 4, link: Link::new() };
let item1 = TestItem {
value: 2,
link: Link::new(),
};
let item2 = TestItem {
value: 2,
link: Link::new(),
};
let item3 = TestItem {
value: 4,
link: Link::new(),
};
let item4 = TestItem {
value: 16,
link: Link::new(),
Expand Down
Loading
Loading