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
17 changes: 17 additions & 0 deletions .bazelrc
Original file line number Diff line number Diff line change
@@ -0,0 +1,17 @@
# Bzlmod
common --registry=https://raw.githubusercontent.com/eclipse-score/bazel_registry/refs/heads/main/
common --registry=https://bcr.bazel.build
common --check_direct_dependencies=error

# Use native sphinx_build_binary instead of the wrapper
build --//third_party/sphinx:use_native_sphinx_build

# Java runtime for plantuml
build --java_runtime_version=remotejdk_21

# Python version for score_tooling pip hub
build --@rules_python//python/config_settings:python_version=3.12

# ferrocene
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
1 change: 1 addition & 0 deletions .bazelversion
Original file line number Diff line number Diff line change
@@ -0,0 +1 @@
8.3.0
62 changes: 60 additions & 2 deletions MODULE.bazel
Original file line number Diff line number Diff line change
Expand Up @@ -16,8 +16,52 @@ module(
compatibility_level = 0,
)

bazel_dep(name = "platforms", version = "0.0.11")
bazel_dep(name = "rules_rust", version = "0.61.0")
bazel_dep(name = "platforms", version = "1.0.0")
bazel_dep(name = "bazel_skylib", version = "1.9.0")
bazel_dep(name = "rules_rust", version = "0.68.1-score")

bazel_dep(name = "score_toolchains_rust", version = "0.8.0", dev_dependency = True)
bazel_dep(name = "score_bazel_cpp_toolchains", version = "0.5.1", dev_dependency = True)

# Extensions
gcc = use_extension("@score_bazel_cpp_toolchains//extensions:gcc.bzl", "gcc", dev_dependency = True)
gcc.toolchain(
name = "score_gcc_x86_64_toolchain",
target_cpu = "x86_64",
target_os = "linux",
use_default_package = True,
version = "12.2.0",
)
gcc.toolchain(
name = "score_gcc_aarch64_toolchain",
target_cpu = "aarch64",
target_os = "linux",
use_default_package = True,
version = "12.2.0",
)
gcc.toolchain(
name = "score_qcc_x86_64_toolchain",
sdp_version = "8.0.0",
target_cpu = "x86_64",
target_os = "qnx",
use_default_package = True,
version = "12.2.0",
)
gcc.toolchain(
name = "score_qcc_aarch64_toolchain",
sdp_version = "8.0.0",
target_cpu = "aarch64",
target_os = "qnx",
use_default_package = True,
version = "12.2.0",
)
use_repo(
gcc,
"score_gcc_aarch64_toolchain",
"score_gcc_x86_64_toolchain",
"score_qcc_aarch64_toolchain",
"score_qcc_x86_64_toolchain",
)

crate = use_extension("@rules_rust//crate_universe:extensions.bzl", "crate")
crate.spec(
Expand Down Expand Up @@ -389,3 +433,17 @@ git_override(
commit = "d528fbdec2cd72ff7967b51546fb0bd935810258",
remote = "https://github.com/bmw-software-engineering/lobster.git",
)

bazel_dep(name = "rules_python", version = "1.8.5", dev_dependency = True)

bazel_dep(name = "score_tooling")
git_override(
module_name = "score_tooling",
commit = "549c7ee315cfbc27a42247b11cb70c953eac75dc",
remote = "https://github.com/eclipse-score/tooling.git",
)

register_toolchains(
"@score_tooling//bazel/rules/rules_score:sphinx_default_toolchain",
dev_dependency = True,
)
9,509 changes: 7,334 additions & 2,175 deletions MODULE.bazel.lock
Comment thread
bharatGoswami8 marked this conversation as resolved.

Large diffs are not rendered by default.

32 changes: 27 additions & 5 deletions docs/pastey/docs/BUILD
Original file line number Diff line number Diff line change
Expand Up @@ -11,12 +11,34 @@
# SPDX-License-Identifier: Apache-2.0
# *******************************************************************************

load("@trlc//:trlc.bzl", "trlc_requirements")
load(
"@score_tooling//bazel/rules/rules_score:rules_score.bzl",
"assumptions_of_use",
"dependable_element",
"dependability_analysis",
)

trlc_requirements(
assumptions_of_use(
name = "aou",
srcs = [
"aou.trlc",
],
srcs = ["//docs/pastey/docs/safety_analysis:aou_trlc"],
visibility = ["//visibility:public"],
)

dependability_analysis(
name = "pastey_dependability_analysis",
arch_design = "//docs/pastey/docs/architecture:pastey_design",
fmea = ["//docs/pastey/docs/safety_analysis:pastey_fmea"],
)

dependable_element(
name = "pastey",
integrity_level = "B",
assumptions_of_use = [":aou"],
requirements = [
"//docs/pastey/docs/requirement:feature_requirements",
Comment thread
bharatGoswami8 marked this conversation as resolved.
],
architectural_design = ["//docs/pastey/docs/architecture:pastey_design"],
components = ["//docs/pastey/docs/component:pastey_component"],
dependability_analysis = [":pastey_dependability_analysis"],
tests = ["//docs/pastey/tests:pastey_test"],
)
29 changes: 29 additions & 0 deletions docs/pastey/docs/architecture/BUILD
Original file line number Diff line number Diff line change
@@ -0,0 +1,29 @@
# *******************************************************************************
# 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
# *******************************************************************************

load(
"@score_tooling//bazel/rules/rules_score:rules_score.bzl",
"architectural_design",
)

architectural_design(
name = "pastey_design",
public_api = [
"public_api.puml",
],
static = [
"static_design.puml",
"index.rst",
],
visibility = ["//visibility:public"],
)
48 changes: 48 additions & 0 deletions docs/pastey/docs/architecture/index.rst
Original file line number Diff line number Diff line change
@@ -0,0 +1,48 @@
..
# *******************************************************************************
# 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
# *******************************************************************************

.. _pastey_architecture_design:

Component Architecture
======================

.. document:: Pastey Architecture
:id: doc__mod_pastey_architecture
:status: valid
:safety: ASIL_B
:security: NO
:realizes: wp__component_arch
:tags: architecture, component, rust, proc_macro

Overview
--------

``pastey`` is a Rust procedural macro crate that provides compile-time token
manipulation and identifier synthesis. It operates entirely at compile time
within the Rust compiler's macro expansion phase.

Static Architecture
-------------------
The pastey crate is single component architecture consisting of a single Rust crate that defines the
``paste!`` macro.

.. uml:: static_design.puml

Interfaces
----------
The pastey crate consists of a single proc-macro entry point that processes
token streams passed to the ``paste!`` macro invocation. All processing occurs
at compile time with no runtime footprint.

.. uml:: public_api.puml
17 changes: 17 additions & 0 deletions docs/pastey/docs/architecture/public_api.puml
Original file line number Diff line number Diff line change
@@ -0,0 +1,17 @@
' 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
@startuml public_api

package "pastey public interface" as pastey_pub {
interface paste_macro as "paste!(tokens)"
}

@enduml
17 changes: 17 additions & 0 deletions docs/pastey/docs/architecture/static_design.puml
Original file line number Diff line number Diff line change
@@ -0,0 +1,17 @@
' 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
@startuml static_design

package "pastey" as pastey <<SEooC>> {
component "pastey_component" as pastey_component <<component>>
}

@enduml
29 changes: 29 additions & 0 deletions docs/pastey/docs/component/BUILD
Original file line number Diff line number Diff line change
@@ -0,0 +1,29 @@
# *******************************************************************************
# 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
# *******************************************************************************

load(
"@score_tooling//bazel/rules/rules_score:rules_score.bzl",
"component",
)

component(
name = "pastey_component",
requirements = [
"//docs/pastey/docs/requirement:component_requirements",
"//docs/pastey/docs/requirement:feature_requirements",
],
tests = [
"//docs/pastey/tests:pastey_test",
],
visibility = ["//visibility:public"],
)
12 changes: 12 additions & 0 deletions docs/pastey/docs/component_classification.rst
Original file line number Diff line number Diff line change
Expand Up @@ -230,4 +230,16 @@ Pastey crate is classified as **CLAS_OUT= Q**.
| - NQ: Do no use this element in safety context
|

Additional notes:
Traceability:
End-to-end traceability has been established using the LOBSTER tool within the score-crates repository. Although unit test results are not currently displayed in the generated reports due to a known limitation in Rust test result parsing (https://github.com/bmw-software-engineering/lobster/issues/589), all necessary traceability links are properly maintained. These include mappings between requirements, design elements, failure modes, control measures, and corresponding tests.

Toolchain Assurance:
The crate is built and tested using the certified Ferrocene toolchain, which is maintained as part of the score_rust_toolchain repository. This ensures compliance with safety and reliability standards expected for Rust-based development.

Use of Standard Library Components in Pastey:
The Pastey crate uses certified Rust core library components(https://github.com/AS1100K/pastey/pull/37), with limited usage of std::env, these modules are required to support environment variable handling within Pastey macros.
Since they are sourced from the same certified toolchain, and use the same underlying components, their usage is considered safe and compliant within the crate.


Assessment reference document (template used) : https://eclipse-score.github.io/process_description/main/folder_templates/modules/module_name/component_name/docs/component_classification.html
13 changes: 9 additions & 4 deletions docs/pastey/docs/requirement/BUILD
Original file line number Diff line number Diff line change
Expand Up @@ -11,17 +11,22 @@
# SPDX-License-Identifier: Apache-2.0
# *******************************************************************************

load("@trlc//:trlc.bzl", "trlc_requirements")
load(
"@score_tooling//bazel/rules/rules_score:rules_score.bzl",
"assumed_system_requirements",
"component_requirements",
"feature_requirements",
)

trlc_requirements(
assumed_system_requirements(
name = "system_requirements",
srcs = [
"assumed_system_requirements.trlc",
],
visibility = ["//visibility:public"],
)

trlc_requirements(
feature_requirements(
name = "feature_requirements",
srcs = [
"feature_requirements.trlc",
Expand All @@ -32,7 +37,7 @@ trlc_requirements(
],
)

trlc_requirements(
component_requirements(
name = "component_requirements",
srcs = [
"component_requirements.trlc",
Expand Down
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
********************************************************************************
/********************************************************************************
* Copyright (c) 2026 Contributors to the Eclipse Foundation
*
* See the NOTICE file(s) distributed with this work for additional
Expand Down
29 changes: 29 additions & 0 deletions docs/pastey/docs/requirement/component_requirements.trlc
Original file line number Diff line number Diff line change
Expand Up @@ -13,6 +13,7 @@
package PasteyComReq

import ScoreReq
import PasteyFeatReq

ScoreReq.CompReq REQ_COMP_PASTEY_001 {
description = "The pastey component shall collect all tokens inside a paste! interpolation block (the [< ... >] syntax) and shall discard whitespace tokens between them before performing identifier concatenation"
Expand Down Expand Up @@ -90,3 +91,31 @@ ScoreReq.CompReq REQ_COMP_PASTEY_011 {
derived_from = [PasteyFeatReq.FEAT_PASTEY_001@1]
version = 1
}

ScoreReq.CompReq REQ_COMP_PASTEY_012 {
description = "The pastey component shall emit a compile error when an interpolation block is empty (contains no tokens)"
safety = ScoreReq.Asil.B
derived_from = [PasteyFeatReq.FEAT_PASTEY_001@1]
version = 1
}

ScoreReq.CompReq REQ_COMP_PASTEY_013 {
description = "The pastey component shall emit a compile error when an interpolation block contains only whitespace tokens with no valid identifiers"
safety = ScoreReq.Asil.B
derived_from = [PasteyFeatReq.FEAT_PASTEY_001@1]
version = 1
}

ScoreReq.CompReq REQ_COMP_PASTEY_014 {
description = "The pastey component shall emit a compile error when an unknown or unsupported case modifier is specified"
safety = ScoreReq.Asil.B
derived_from = [PasteyFeatReq.FEAT_PASTEY_001@1]
version = 1
}

ScoreReq.CompReq REQ_COMP_PASTEY_015 {
description = "The pastey component shall emit a compile error when the :replace modifier receives more than one token for either the from or to argument"
safety = ScoreReq.Asil.B
derived_from = [PasteyFeatReq.FEAT_PASTEY_001@1]
version = 1
}
1 change: 1 addition & 0 deletions docs/pastey/docs/requirement/feature_requirements.trlc
Original file line number Diff line number Diff line change
Expand Up @@ -13,6 +13,7 @@
package PasteyFeatReq

import ScoreReq
import RustCrateSysReq

ScoreReq.FeatReq FEAT_PASTEY_001 {
description = "The pastey crate shall provide compile-time token manipulation capabilities for procedural macro expansion in Rust applications."
Expand Down
Loading
Loading