11# Use iceoryx2 with Bazel
22
3- iceoryx2 supports Bazel as a build target, via both bazel workspaces and bazel modules. Other operating systems are not yet supported.
3+ iceoryx2 supports Bazel as a build target, via both bazel workspaces and bazel
4+ modules. Other operating systems are not yet supported.
45
56## Setup with Bazel build system
67
7- You can pull the iceoryx2 repo into your bazel project in two different manners. Full examples can be found under ` examples/bazel ` .
8+ You can pull the iceoryx2 repo into your bazel project in two different manners.
9+ Full examples can be found under ` examples/bazel ` .
810
911### Setup via Bzlmod (Recommended)
1012
11- There's an example for using Bazel under ` examples/bazel ` . Alternatively, you can follow this abreviated guide, and ensure the following is present in your ` MODULE.bazel ` or ` MODULE ` file:
13+ There's an example for using Bazel under ` examples/bazel ` . Alternatively, you
14+ can follow this abbreviated guide, and ensure the following is present in your
15+ ` MODULE.bazel ` or ` MODULE ` file:
1216
1317``` bazel
14- bazel_dep(name = " iceoryx2" , version = " 0.7.0 " )
18+ bazel_dep(name = " iceoryx2" , version = " 0.8.1 " )
1519bazel_dep(name = " rules_rust" , version = " 0.68.1" )
1620
1721# ==============================================================================
@@ -23,7 +27,7 @@ git_override(
2327 module_name = iceoryx2,
2428 remote = " https://github.com/eclipse-iceoryx/iceoryx2.git" ,
2529 # Insert your git ref below. It can be a tag, commit, or branch
26- commit = " 0.7.0 "
30+ commit = " 0.8.1 "
2731)
2832
2933# ==============================================================================
@@ -38,133 +42,10 @@ rust.toolchain(
3842```
3943
4044### Setup via Workspace (legacy)
41- To use iceoryx2 as an external dependency, ensure the following setup is present
42- in your ` WORKSPACE ` file:
4345
44- ``` bazel
45- # Load iceoryx2 rules
46- ICEORYX2_VERSION = " 0248ea57d0c405383ab099e14293ed8be2d23dac"
47-
48- http_archive(
49- name = " iceoryx2" ,
50- sha256 = " 8844b229d2ba23597dfe17df7a3baabd086a62944534aa804d482a6e46bdf5b8" ,
51- strip_prefix = " iceoryx2-{} " .format(ICEORYX2_VERSION ),
52- urls = [
53- " https://github.com/eclipse-iceoryx/iceoryx2/archive/{} .tar.gz" .format(ICEORYX2_VERSION ),
54- ],
55- )
56-
57-
58- # Load Rust rules
59- # Use v0.26 to support bazel v6.2
60- maybe(
61- name = " rules_rust" ,
62- repo_rule = http_archive,
63- sha256 = " 9d04e658878d23f4b00163a72da3db03ddb451273eb347df7d7c50838d698f49" ,
64- urls = [" https://github.com/bazelbuild/rules_rust/releases/download/0.26.0/rules_rust-v0.26.0.tar.gz" ],
65- )
66-
67- load(" @rules_rust//rust:repositories.bzl" , " rules_rust_dependencies" , " rust_register_toolchains" )
68-
69- rules_rust_dependencies()
70- rust_register_toolchains(
71- edition = " 2021" ,
72- versions = [
73- " 1.80.0"
74- ],
75- )
76-
77-
78- # Load prebuilt bindgen
79- maybe(
80- name = " bindgen" ,
81- repo_rule = http_archive,
82- sha256 = " b7e2321ee8c617f14ccc5b9f39b3a804db173ee217e924ad93ed16af6bc62b1d" ,
83- strip_prefix = " bindgen-cli-x86_64-unknown-linux-gnu" ,
84- urls = [" https://github.com/rust-lang/rust-bindgen/releases/download/v0.69.5/bindgen-cli-x86_64-unknown-linux-gnu.tar.xz" ],
85- build_file_content = """
86- filegroup(
87- name = "bindgen-cli",
88- srcs = ["bindgen"],
89- visibility = ["//visibility:public"],
90- )
91- """ ,
92- )
93-
94- # Load prebuilt cbindgen
95- maybe(
96- name = " cbindgen" ,
97- repo_rule = http_file,
98- sha256 = " 521836d00863cb129283054e5090eb17563614e6328b7a1610e30949a05feaea" ,
99- urls = [" https://github.com/mozilla/cbindgen/releases/download/0.26.0/cbindgen" ],
100- executable = True ,
101- )
102-
103- # Load external crates
104- load(" @rules_rust//crate_universe:repositories.bzl" , " crate_universe_dependencies" )
105-
106- crate_universe_dependencies()
107-
108- load(" @rules_rust//crate_universe:defs.bzl" , " crates_repository" )
109-
110- maybe(
111- name = " crate_index" ,
112- repo_rule = crates_repository,
113- cargo_lockfile = " @iceoryx2//:Cargo.lock" ,
114- lockfile = " @iceoryx2//:Cargo.Bazel.lock" ,
115- manifests = [
116- " @iceoryx2//:Cargo.toml" ,
117- " @iceoryx2//:benchmarks/event/Cargo.toml" ,
118- " @iceoryx2//:benchmarks/publish-subscribe/Cargo.toml" ,
119- " @iceoryx2//:benchmarks/queue/Cargo.toml" ,
120- " @iceoryx2//:examples/Cargo.toml" ,
121- " @iceoryx2//:iceoryx2-log/log/Cargo.toml" ,
122- " @iceoryx2//:iceoryx2-log/loggers/Cargo.toml" ,
123- " @iceoryx2//:iceoryx2-log/types/Cargo.toml" ,
124- " @iceoryx2//:iceoryx2/Cargo.toml" ,
125- " @iceoryx2//:iceoryx2-bb/container/Cargo.toml" ,
126- " @iceoryx2//:iceoryx2-bb/derive-macros/Cargo.toml" ,
127- " @iceoryx2//:iceoryx2-bb/elementary/Cargo.toml" ,
128- " @iceoryx2//:iceoryx2-bb/lock-free/Cargo.toml" ,
129- " @iceoryx2//:iceoryx2-bb/memory/Cargo.toml" ,
130- " @iceoryx2//:iceoryx2-bb/posix/Cargo.toml" ,
131- " @iceoryx2//:iceoryx2-bb/system-types/Cargo.toml" ,
132- " @iceoryx2//:iceoryx2-bb/testing/Cargo.toml" ,
133- " @iceoryx2//:iceoryx2-bb/threadsafe/Cargo.toml" ,
134- " @iceoryx2//:iceoryx2-bb/trait-tests/Cargo.toml" ,
135- " @iceoryx2//:iceoryx2-cal/Cargo.toml" ,
136- " @iceoryx2//:iceoryx2-cli/Cargo.toml" ,
137- " @iceoryx2//:iceoryx2-ffi/ffi-macros/Cargo.toml" ,
138- " @iceoryx2//:iceoryx2-ffi/c/Cargo.toml" ,
139- " @iceoryx2//:iceoryx2-pal/concurrency-sync/Cargo.toml" ,
140- " @iceoryx2//:iceoryx2-pal/configuration/Cargo.toml" ,
141- " @iceoryx2//:iceoryx2-pal/posix/Cargo.toml" ,
142- ],
143- )
144-
145- load(" @crate_index//:defs.bzl" , " crate_repositories" )
146-
147- crate_repositories()
148-
149-
150- # Load skylib rules
151- BAZEL_SKYLIB_VERSION = " 1.7.1"
152-
153- # Load skylib for custom build config
154- maybe(
155- name = " bazel_skylib" ,
156- repo_rule = http_archive,
157- sha256 = " bc283cdfcd526a52c3201279cda4bc298652efa898b10b4db0837dc51652756f" ,
158- urls = [
159- " https://mirror.bazel.build/github.com/bazelbuild/bazel-skylib/releases/download/{version} /bazel-skylib-{version} .tar.gz" .format(version = BAZEL_SKYLIB_VERSION ),
160- " https://github.com/bazelbuild/bazel-skylib/releases/download/{version} /bazel-skylib-{version} .tar.gz" .format(version = BAZEL_SKYLIB_VERSION ),
161- ],
162- )
163-
164- load(" @bazel_skylib//:workspace.bzl" , " bazel_skylib_workspace" )
165-
166- bazel_skylib_workspace()
167- ```
46+ Using iceoryx2 via Bazel Workspace is no longer supported. If you are still using
47+ Bazel Workspaces, import iceoryx2 library with language-specific methods or
48+ migrate to Bazel Modules (see [ Bazel Migration Guide] ( https://bazel.build/external/migration ) ).
16849
16950### Initial Build
17051
@@ -259,7 +140,7 @@ For instance, to enable the `foo` feature by default in `.bazelrc`, you would ad
259140build -- @ iceoryx2// :foo= on
260141```
261142
262- ## Running iceory2x Tests in External Project
143+ ## Running iceoryx2 Tests in External Project
263144
264145In general, the iceoryx2 tests can be run in parallel. However, there are
265146exceptions, as some tests deliberately try to bring the system into an
0 commit comments