Skip to content

Commit 43939df

Browse files
Add sbom targets (#2232)
1 parent 8f0e19c commit 43939df

2 files changed

Lines changed: 136 additions & 0 deletions

File tree

BUILD

Lines changed: 110 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -32,3 +32,113 @@ filegroup(
3232
srcs = ["README.md"],
3333
visibility = ["//visibility:public"],
3434
)
35+
36+
# ============================================================================
37+
# SBOM Generation Targets
38+
# ============================================================================
39+
load("@score_tooling//sbom:defs.bzl", "sbom")
40+
41+
# SBOM for score_baselibs
42+
sbom(
43+
name = "sbom_baselibs",
44+
targets = [
45+
"@score_baselibs//score/concurrency:concurrency",
46+
"@score_baselibs//score/memory/shared:shared",
47+
],
48+
module_lockfile = "@score_crates//:MODULE.bazel.lock",
49+
component_name = "score_baselibs",
50+
auto_crates_cache = True,
51+
auto_cdxgen = True,
52+
sbom_authors = ["Eclipse SCORE Team"],
53+
generation_context = "build",
54+
)
55+
56+
# SBOM for score_communication
57+
sbom(
58+
name = "sbom_communication",
59+
targets = [
60+
"@score_communication//score/mw/com:com",
61+
],
62+
module_lockfile = "@score_crates//:MODULE.bazel.lock",
63+
component_name = "score_communication",
64+
auto_crates_cache = True,
65+
auto_cdxgen = True,
66+
sbom_authors = ["Eclipse SCORE Team"],
67+
generation_context = "build",
68+
)
69+
70+
# SBOM for score_persistency
71+
sbom(
72+
name = "sbom_persistency",
73+
targets = [
74+
"@score_persistency//src/rust/rust_kvs:rust_kvs",
75+
],
76+
module_lockfile = "@score_crates//:MODULE.bazel.lock",
77+
component_name = "score_persistency",
78+
auto_crates_cache = True,
79+
auto_cdxgen = True,
80+
sbom_authors = ["Eclipse SCORE Team"],
81+
generation_context = "build",
82+
)
83+
84+
# SBOM for score_kyron
85+
sbom(
86+
name = "sbom_kyron_module",
87+
targets = [
88+
"@score_kyron//src/kyron:libkyron",
89+
"@score_kyron//src/kyron-foundation:libkyron_foundation",
90+
],
91+
module_lockfile = "@score_crates//:MODULE.bazel.lock",
92+
component_name = "score_kyron",
93+
auto_crates_cache = True,
94+
auto_cdxgen = True,
95+
sbom_authors = ["Eclipse SCORE Team"],
96+
generation_context = "build",
97+
)
98+
99+
# SBOM for score_orchestrator
100+
sbom(
101+
name = "sbom_orchestrator",
102+
targets = [
103+
"@score_orchestrator//src/orchestration:liborchestration",
104+
],
105+
module_lockfile = "@score_crates//:MODULE.bazel.lock",
106+
component_name = "score_orchestrator",
107+
auto_crates_cache = True,
108+
auto_cdxgen = True,
109+
sbom_authors = ["Eclipse SCORE Team"],
110+
generation_context = "build",
111+
)
112+
113+
# SBOM for score_feo
114+
sbom(
115+
name = "sbom_feo",
116+
targets = [
117+
"@score_feo//feo:libfeo_rust",
118+
"@score_feo//feo:libfeo_recording_rust",
119+
"@score_feo//feo-com:libfeo_com_rust",
120+
"@score_feo//feo-log:libfeo_log_rust",
121+
"@score_feo//feo-time:libfeo_time_rust",
122+
"@score_feo//feo-tracing:libfeo_tracing_rust",
123+
],
124+
module_lockfile = "@score_crates//:MODULE.bazel.lock",
125+
component_name = "score_feo",
126+
auto_crates_cache = True,
127+
auto_cdxgen = True,
128+
sbom_authors = ["Eclipse SCORE Team"],
129+
generation_context = "build",
130+
)
131+
132+
# SBOM for score_logging
133+
sbom(
134+
name = "sbom_logging",
135+
targets = [
136+
"@score_logging//score/datarouter:log",
137+
],
138+
module_lockfile = "@score_crates//:MODULE.bazel.lock",
139+
component_name = "score_logging",
140+
auto_crates_cache = True,
141+
auto_cdxgen = True,
142+
sbom_authors = ["Eclipse SCORE Team"],
143+
generation_context = "build",
144+
)

MODULE.bazel

Lines changed: 26 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -65,3 +65,29 @@ git_override(
6565
bazel_dep(name = "rules_rust", version = "0.67.0")
6666
bazel_dep(name = "score_itf", version = "0.1.0")
6767
bazel_dep(name = "score_crates", version = "0.0.6")
68+
local_path_override(
69+
module_name = "score_crates",
70+
path = "../score-crates",
71+
)
72+
73+
# ============================================================================
74+
# SBOM Metadata Collection
75+
# ============================================================================
76+
# Enable SBOM metadata collection from all modules in the dependency graph
77+
sbom_ext = use_extension(
78+
"@score_tooling//sbom:extensions.bzl",
79+
"sbom_metadata",
80+
)
81+
82+
# Track score dependency modules for automatic version extraction from their MODULE.bazel
83+
sbom_ext.track_module(name = "score_baselibs")
84+
sbom_ext.track_module(name = "score_communication")
85+
sbom_ext.track_module(name = "score_orchestrator")
86+
sbom_ext.track_module(name = "score_logging")
87+
sbom_ext.track_module(name = "score_persistency")
88+
sbom_ext.track_module(name = "score_kyron")
89+
sbom_ext.track_module(name = "score_feo")
90+
sbom_ext.track_module(name = "score_test_scenarios")
91+
sbom_ext.track_module(name = "score_tooling")
92+
93+
use_repo(sbom_ext, "sbom_metadata")

0 commit comments

Comments
 (0)