1313# *******************************************************************************
1414
1515"S-CORE SOME/IP Gateway"
16-
1716module (name = "score_someip_gateway" )
1817
18+ # ============================================================================
19+ # Python Configuration
20+ # ============================================================================
1921bazel_dep (name = "rules_python" , version = "1.4.1" )
2022
23+ # Python 3.12: Required for testing infrastructure and code generation tools
2124PYTHON_VERSION = "3.12"
2225
2326python = use_extension ("@rules_python//python/extensions:python.bzl" , "python" )
@@ -43,119 +46,196 @@ pip.parse(
4346)
4447use_repo (pip , "someip_pip" )
4548
46- # Add GoogleTest dependency
49+ # ============================================================================
50+ # Testing & Performance Measurement
51+ # ============================================================================
4752bazel_dep (name = "googletest" , version = "1.17.0" )
48-
49- # Add Google Benchmark dependency for performance testing
5053bazel_dep (name = "google_benchmark" , version = "1.9.1" )
5154
52- # Rust rules for Bazel
55+ # ============================================================================
56+ # Build System Rules
57+ # ============================================================================
58+ bazel_dep (name = "rules_cc" , version = "0.2.14" )
5359bazel_dep (name = "rules_rust" , version = "0.63.0" )
60+ bazel_dep (name = "rules_pkg" , version = "1.1.0" )
61+
62+ # Platforms: Standard constraint values and platform definitions
63+ # Required for select() expressions that use @platforms//cpu:* and @platforms//os:*
64+ bazel_dep (name = "platforms" , version = "1.0.0" )
65+
66+ # ============================================================================
67+ # Toolchains & Platform Configuration
68+ # ============================================================================
69+ # S-CORE Platform Definitions: Provides constraint values and platform definitions
70+ bazel_dep (name = "score_bazel_platforms" , version = "0.0.2" )
71+
72+ # LLVM Toolchain: C/C++ cross-compilation support for x86_64 and aarch64
73+ # Integrates with LLVM 19.1.0 and Debian Bullseye sysroots
74+ bazel_dep (name = "toolchains_llvm" , version = "1.5.0" )
75+
76+ # Rust Toolchain Extension: Manages sysroot download and toolchain registration
77+ bazel_dep (name = "score_toolchains_rust" , version = "0.1" )
78+ git_override (
79+ module_name = "score_toolchains_rust" ,
80+ remote = "https://github.com/eclipse-score/toolchains_rust.git" ,
81+ commit = "5614e4b273f2f5302d47a05d7e58dae86f97a3c3" , # Last verified: 23.08.2025
82+ )
83+
84+ # ============================================================================
85+ # Optional Toolchain Dependencies
86+ # ============================================================================
87+ # We provide a local stub to satisfy module resolution without adding QNX support.
88+ bazel_dep (name = "rust_qnx8_toolchain" , version = "1.0.0" )
89+ local_path_override (
90+ module_name = "rust_qnx8_toolchain" ,
91+ path = "bazel_stubs/rust_qnx8_toolchain" ,
92+ )
5493
55- # C/C++ rules for Bazel
56- bazel_dep (name = "rules_cc" , version = "0.2.1" )
94+ # ============================================================================
95+ # Sysroot Management for Multi-Architecture Support
96+ # ============================================================================
97+ # Downloads and registers Debian Bullseye sysroots for both x86_64 and aarch64.
98+ # These sysroots are used by both LLVM (C++) and Rust toolchains for cross-compilation.
99+ rust_ext = use_extension ("@score_toolchains_rust//extensions:rust_toolchain_ext.bzl" , "rust_toolchain_ext" )
100+ rust_ext .sysroot (
101+ name = "sysroot_linux_x64" ,
102+ url = "https://commondatastorage.googleapis.com/chrome-linux-sysroot/toolchain/4f611ec025be98214164d4bf9fbe8843f58533f7/debian_bullseye_amd64_sysroot.tar.xz" ,
103+ sha256 = "5df5be9357b425cdd70d92d4697d07e7d55d7a923f037c22dc80a78e85842d2c" ,
104+ strip_prefix = "" ,
105+ build_file = "@score_toolchains_rust//sysroot:BUILD.bazel" ,
106+ )
107+ rust_ext .sysroot (
108+ name = "sysroot_linux_aarch64" ,
109+ url = "https://commondatastorage.googleapis.com/chrome-linux-sysroot/toolchain/906cc7c6bf47d4bd969a3221fc0602c6b3153caa/debian_bullseye_arm64_sysroot.tar.xz" ,
110+ sha256 = "d303cf3faf7804c9dd24c9b6b167d0345d41d7fe4bfb7d34add3ab342f6a236c" ,
111+ strip_prefix = "" ,
112+ build_file = "@score_toolchains_rust//sysroot:BUILD.bazel" ,
113+ )
57114
58- # LLVM Toolchains Rules - host configuration
59- bazel_dep ( name = "toolchains_llvm" , version = "1.4.0 " )
115+ use_repo ( rust_ext , "sysroot_linux_x64" )
116+ use_repo ( rust_ext , "sysroot_linux_aarch64 " )
60117
118+ # ============================================================================
119+ # LLVM C/C++ Toolchain Configuration
120+ # ============================================================================
121+ # Configures LLVM 19.1.0 for C/C++ compilation with cross-architecture support.
61122llvm = use_extension ("@toolchains_llvm//toolchain/extensions:llvm.bzl" , "llvm" )
62123llvm .toolchain (
124+ name = "llvm_toolchain" ,
63125 cxx_standard = {"" : "c++17" },
64126 llvm_version = "19.1.0" ,
65127)
66- use_repo (llvm , "llvm_toolchain" )
67- use_repo (llvm , "llvm_toolchain_llvm" )
128+ llvm .sysroot (
129+ name = "llvm_toolchain" ,
130+ label = "@sysroot_linux_x64//:sysroot" ,
131+ targets = ["linux-x86_64" ],
132+ )
133+ llvm .sysroot (
134+ name = "llvm_toolchain" ,
135+ label = "@sysroot_linux_aarch64//:sysroot" ,
136+ targets = ["linux-aarch64" ],
137+ )
68138
139+ use_repo (llvm , "llvm_toolchain" )
69140register_toolchains ("@llvm_toolchain//:all" )
70141
71- # tooling
142+ # ============================================================================
143+ # Rust Toolchain Configuration for Multi-Architecture Support
144+ # ============================================================================
145+ # Configures rules_rust to compile for both x86_64 and aarch64 targets.
146+ rust = use_extension ("@rules_rust//rust:extensions.bzl" , "rust" )
147+ rust .toolchain (
148+ edition = "2021" ,
149+ extra_target_triples = ["x86_64-unknown-linux-gnu" , "aarch64-unknown-linux-gnu" ],
150+ versions = ["1.83.0" ],
151+ )
152+ use_repo (rust , "rust_toolchains" )
153+ register_toolchains ("@rust_toolchains//:all" )
154+
155+ # ============================================================================
156+ # Tooling & Development
157+ # ============================================================================
72158bazel_dep (name = "score_tooling" , version = "1.0.2" )
73159bazel_dep (name = "aspect_rules_lint" , version = "1.5.3" )
74160bazel_dep (name = "buildifier_prebuilt" , version = "8.2.0.2" )
75161
76- # docs-as-code
162+ # ============================================================================
163+ # Documentation
164+ # ============================================================================
77165bazel_dep (name = "score_docs_as_code" , version = "1.4.0" )
78166
79- # communication
80- bazel_dep (name = "communication" , version = "0.0.0" )
81- git_override (
82- module_name = "communication" ,
83- commit = "86c66f345fdd35dcc3f380905e799f559dfd5001" ,
84- remote = "https://github.com/eclipse-score/communication.git" ,
85- )
86-
87- # TODO: These should fetched via registry and we shouldn't have to care about updating them
167+ # ============================================================================
168+ # Dependency Chain Compatibility
169+ # ============================================================================
170+ # TODO: Migrate rules_boost to Bazel Central Registry once compatible versions available.
171+ # Currently using archive_override to pin master branch for compatibility with other deps.
88172archive_override (
89173 module_name = "rules_boost" ,
90174 integrity = "sha256-iKHWUIBrUN/fFOCltkTmHfDcKw0h4ZVmP7NVSoc8zBs=" ,
91175 strip_prefix = "rules_boost-master" ,
92176 urls = ["https://github.com/nelhage/rules_boost/archive/refs/heads/master.tar.gz" ],
93177)
94178
95- bazel_dep (name = "score-baselibs" , version = "0.0.0" )
179+ # ============================================================================
180+ # Communication Framework
181+ # ============================================================================
182+ bazel_dep (name = "communication" , version = "0.0.0" )
96183git_override (
184+ module_name = "communication" ,
185+ commit = "86c66f345fdd35dcc3f380905e799f559dfd5001" ,
186+ remote = "https://github.com/eclipse-score/communication.git" ,
187+ )
188+
189+ # ============================================================================
190+ # Base Libraries
191+ # ============================================================================
192+ # ============================================================================
193+ # Base Libraries
194+ # ============================================================================
195+ # Patch note: baselibs-multiarch.patch adds multi-arch support for .deb downloads.
196+ # score-baselibs hardcodes amd64 URLs; patch replaces them with architecture-aware
197+ # selection (x86_64 or aarch64) based on TARGET_ARCH environment variable.
198+ bazel_dep (name = "score-baselibs" , version = "0.0.0" )
199+ archive_override (
97200 module_name = "score-baselibs" ,
98- commit = "f02d7f427df1968df8d5f9f9aa85bf68baeb839e" ,
99- remote = "https://github.com/eclipse-score/baselibs.git" ,
201+ urls = ["https://github.com/eclipse-score/baselibs/archive/f02d7f427df1968df8d5f9f9aa85bf68baeb839e.tar.gz" ],
202+ strip_prefix = "baselibs-f02d7f427df1968df8d5f9f9aa85bf68baeb839e" ,
203+ patches = ["//patches:baselibs-multiarch.patch" ],
204+ patch_strip = 1 ,
100205)
101206
207+ # ============================================================================
208+ # Code Generation - FlatBuffers
209+ # ============================================================================
210+ bazel_dep (name = "flatbuffers" , version = "25.2.10" )
211+
212+ # TRLC: Traceability Language Compiler for requirements management
102213git_override (
103214 module_name = "trlc" ,
104215 commit = "650b51a47264a4f232b3341f473527710fc32669" , # trlc-2.0.2 release
105216 remote = "https://github.com/bmw-software-engineering/trlc.git" ,
106217)
107218
108- bazel_dep (name = "flatbuffers" , version = "25.2.10" )
109-
110- ###################################################################################
111- # Examples
112- ###################################################################################
113-
114- #-------------------------------------------------------------
115- # Crate index for hello world example
116- #-------------------------------------------------------------
219+ # ============================================================================
220+ # Examples: Car Window Simulator
221+ # ============================================================================
117222car_window_sim_crate = use_extension ("@rules_rust//crate_universe:extensions.bzl" , "crate" )
118- car_window_sim_crate .spec (
119- package = "rustyrepl" ,
120- version = "0.2.0" ,
121- ) #//,features = ["async"])
122- car_window_sim_crate .spec (
123- package = "anyhow" ,
124- version = "1" ,
125- )
126- car_window_sim_crate .spec (
127- package = "async-trait" ,
128- version = "0.1" ,
129- )
130- car_window_sim_crate .spec (
131- features = ["derive" ],
132- package = "clap" ,
133- version = "4" ,
134- )
135- car_window_sim_crate .spec (
136- features = ["full" ],
137- package = "tokio" ,
138- version = "1.10" ,
139- )
223+ car_window_sim_crate .spec (package = "rustyrepl" , version = "0.2.0" )
224+ car_window_sim_crate .spec (package = "anyhow" , version = "1" )
225+ car_window_sim_crate .spec (package = "async-trait" , version = "0.1" )
226+ car_window_sim_crate .spec (features = ["derive" ], package = "clap" , version = "4" )
227+ car_window_sim_crate .spec (features = ["full" ], package = "tokio" , version = "1.10" )
140228car_window_sim_crate .from_specs (name = "car_window_sim_crate" )
141229use_repo (car_window_sim_crate , "car_window_sim_crate" )
142230
143- ###################################################################################
144- # vsomeip integration
145- ###################################################################################
146- bazel_dep (name = "rules_foreign_cc" , version = "0.15.0" )
231+ # ============================================================================
232+ # SOME/IP Stack Integration
233+ # ============================================================================
234+ # Rules for Foreign/C/C++/CMake integration
235+ bazel_dep (name = "rules_foreign_cc" , version = "0.15.1" )
147236
148237http_archive = use_repo_rule ("@bazel_tools//tools/build_defs/repo:http.bzl" , "http_archive" )
149238
150- _ALL_CONTENT = """
151- filegroup(
152- name = "all_srcs",
153- srcs = glob(["**"]),
154- visibility = ["//visibility:public"],
155- )
156- """
157-
158- # Boost
159239http_archive (
160240 name = "boost" ,
161241 build_file_content = """
@@ -165,15 +245,14 @@ filegroup(
165245 visibility = ["//visibility:public"],
166246)
167247""" ,
168- sha256 = "af57be25cb4c4f4b413ed692fe378affb4352ea50fbe294a11ef548f4d527d89 " ,
169- strip_prefix = "boost_1_87_0 " ,
170- urls = ["https://archives. boost.io/release/ 1.87.0/source/boost_1_87_0. tar.bz2 " ],
248+ sha256 = "7da75f171837577a52bbf217e17f8ea576c7c246e4594d617bfde7fafd408be5 " ,
249+ strip_prefix = "boost-1.87.0 " ,
250+ urls = ["https://github.com/boostorg/ boost/releases/download/boost- 1.87.0/boost-1.87.0-cmake. tar.xz " ],
171251)
172252
173- # pcre source code repository
174253http_archive (
175254 name = "vsomeip" ,
176- build_file_content = _ALL_CONTENT ,
255+ build_file = "@//:vsomeip.BUILD.bazel" ,
177256 sha256 = "659421fa01c0f56e5587c82f476c18a593e1a7ad4b381d95b57821d0545dae53" ,
178257 strip_prefix = "vsomeip-3.5.7" ,
179258 urls = [
0 commit comments