Skip to content

Commit a2a4d06

Browse files
committed
[#1263] Remove support for bazel workspaces
1 parent c546f5b commit a2a4d06

File tree

9 files changed

+41
-294
lines changed

9 files changed

+41
-294
lines changed

.bazelrc

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,3 +1,4 @@
1+
common --enable_bzlmod
12
build --enable_platform_specific_config
23
build:linux --cxxopt="-std=c++14"
34
build:windows --cxxopt="/std:c++17"

.github/workflows/build-test.yml

Lines changed: 5 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -380,7 +380,7 @@ jobs:
380380
matrix:
381381
os: [ubuntu-24.04]
382382
toolchain: [stable]
383-
bazel-mode: ["--enable_bzlmod", "--noenable_bzlmod"]
383+
bazel-version: ["7.4.1", "8.5.1"]
384384
timeout-minutes: 60
385385
runs-on: ${{ matrix.os }}
386386
steps:
@@ -402,13 +402,13 @@ jobs:
402402

403403
- name: Run bazel build
404404
env:
405-
USE_BAZEL_VERSION: "7.4.1"
406-
run: bazel build //... ${{ matrix.bazel-mode }}
405+
USE_BAZEL_VERSION: ${{matrix.bazel-version}}
406+
run: bazel build //...
407407

408408
- name: Run bazel test
409409
env:
410-
USE_BAZEL_VERSION: "7.4.1"
411-
run: bazel test //... ${{ matrix.bazel-mode }}
410+
USE_BAZEL_VERSION: ${{matrix.bazel-version}}
411+
run: bazel test //...
412412

413413
cxx-vocabulary-types:
414414
needs: [preflight-check, static-code-analysis]

WORKSPACE.bazel

Lines changed: 1 addition & 143 deletions
Original file line numberDiff line numberDiff line change
@@ -10,146 +10,4 @@
1010
#
1111
# SPDX-License-Identifier: Apache-2.0 OR MIT
1212

13-
workspace(name = "org_eclipse_iceoryx_iceoryx2")
14-
15-
load("@bazel_tools//tools/build_defs/repo:http.bzl", "http_archive", "http_file")
16-
load("@bazel_tools//tools/build_defs/repo:utils.bzl", "maybe")
17-
18-
# Setup gtest
19-
GOOGLETEST_VERSION = "1.14.0"
20-
maybe(
21-
name = "googletest",
22-
repo_rule = http_archive,
23-
urls = ["https://github.com/google/googletest/archive/refs/tags/v{version}.zip".format(version = GOOGLETEST_VERSION)],
24-
sha256 = "1f357c27ca988c3f7c6b4bf68a9395005ac6761f034046e9dde0896e3aba00e4",
25-
strip_prefix = "googletest-{version}".format(version = GOOGLETEST_VERSION),
26-
)
27-
28-
29-
# Load Rust rules
30-
# Use v0.26 to support bazel v6.2
31-
maybe(
32-
name = "rules_rust",
33-
repo_rule = http_archive,
34-
sha256 = "962075c164a603f43fb4a3d19615ab91e41bcd0581c8da2f70a1aef27381fe53",
35-
urls = ["https://github.com/bazelbuild/rules_rust/releases/download/0.58.0/rules_rust-0.58.0.tar.gz"],
36-
)
37-
38-
load("@rules_rust//rust:repositories.bzl", "rules_rust_dependencies", "rust_register_toolchains")
39-
40-
rules_rust_dependencies()
41-
rust_register_toolchains(
42-
edition = "2021",
43-
versions = [
44-
"1.83.0"
45-
],
46-
)
47-
48-
49-
# Load prebuilt bindgen
50-
maybe(
51-
name = "bindgen",
52-
repo_rule = http_archive,
53-
sha256 = "b7e2321ee8c617f14ccc5b9f39b3a804db173ee217e924ad93ed16af6bc62b1d",
54-
strip_prefix = "bindgen-cli-x86_64-unknown-linux-gnu",
55-
urls = ["https://github.com/rust-lang/rust-bindgen/releases/download/v0.69.5/bindgen-cli-x86_64-unknown-linux-gnu.tar.xz"],
56-
build_file_content = """
57-
filegroup(
58-
name = "bindgen-cli",
59-
srcs = ["bindgen"],
60-
visibility = ["//visibility:public"],
61-
)
62-
""",
63-
)
64-
65-
# Load prebuilt cbindgen
66-
maybe(
67-
name = "cbindgen",
68-
repo_rule = http_file,
69-
sha256 = "521836d00863cb129283054e5090eb17563614e6328b7a1610e30949a05feaea",
70-
urls = ["https://github.com/mozilla/cbindgen/releases/download/0.26.0/cbindgen"],
71-
executable = True,
72-
)
73-
74-
# Load external crates
75-
load("@rules_rust//crate_universe:repositories.bzl", "crate_universe_dependencies")
76-
77-
crate_universe_dependencies()
78-
79-
load("@rules_rust//crate_universe:defs.bzl", "crates_repository")
80-
81-
maybe(
82-
name = "crate_index",
83-
repo_rule = crates_repository,
84-
cargo_lockfile = "//:Cargo.lock",
85-
lockfile = "//:Cargo.Bazel.lock",
86-
manifests = [
87-
"//:Cargo.toml",
88-
"//:benchmarks/event/Cargo.toml",
89-
"//:benchmarks/publish-subscribe/Cargo.toml",
90-
"//:benchmarks/queue/Cargo.toml",
91-
"//:benchmarks/request-response/Cargo.toml",
92-
"//:component-tests/rust/Cargo.toml",
93-
"//:examples/Cargo.toml",
94-
"//:iceoryx2-tunnel/end-to-end-tests/Cargo.toml",
95-
"//:iceoryx2-tunnel/backend/Cargo.toml",
96-
"//:iceoryx2-tunnel/zenoh/Cargo.toml",
97-
"//:iceoryx2-tunnel/tunnel/Cargo.toml",
98-
"//:iceoryx2-tunnel/conformance-tests/Cargo.toml",
99-
"//:iceoryx2-services/discovery/Cargo.toml",
100-
"//:iceoryx2/Cargo.toml",
101-
"//:iceoryx2/conformance-tests/Cargo.toml",
102-
"//:iceoryx2-log/log/Cargo.toml",
103-
"//:iceoryx2-log/types/Cargo.toml",
104-
"//:iceoryx2-bb/print/Cargo.toml",
105-
"//:iceoryx2-bb/loggers/Cargo.toml",
106-
"//:iceoryx2-bb/conformance-test-macros/Cargo.toml",
107-
"//:iceoryx2-bb/concurrency/Cargo.toml",
108-
"//:iceoryx2-bb/container/Cargo.toml",
109-
"//:iceoryx2-bb/derive-macros/Cargo.toml",
110-
"//:iceoryx2-bb/elementary/Cargo.toml",
111-
"//:iceoryx2-bb/elementary-traits/Cargo.toml",
112-
"//:iceoryx2-bb/linux/Cargo.toml",
113-
"//:iceoryx2-bb/lock-free/Cargo.toml",
114-
"//:iceoryx2-bb/memory/Cargo.toml",
115-
"//:iceoryx2-bb/posix/Cargo.toml",
116-
"//:iceoryx2-bb/system-types/Cargo.toml",
117-
"//:iceoryx2-bb/testing/Cargo.toml",
118-
"//:iceoryx2-bb/threadsafe/Cargo.toml",
119-
"//:iceoryx2-bb/trait-tests/Cargo.toml",
120-
"//:iceoryx2-cal/Cargo.toml",
121-
"//:iceoryx2-cal/conformance-tests/Cargo.toml",
122-
"//:iceoryx2-cli/Cargo.toml",
123-
"//:iceoryx2-ffi/ffi-macros/Cargo.toml",
124-
"//:iceoryx2-ffi/c/Cargo.toml",
125-
"//:iceoryx2-ffi/python/Cargo.toml",
126-
"//:iceoryx2-pal/concurrency-sync/Cargo.toml",
127-
"//:iceoryx2-pal/configuration/Cargo.toml",
128-
"//:iceoryx2-pal/os-api/Cargo.toml",
129-
"//:iceoryx2-pal/posix/Cargo.toml",
130-
"//:iceoryx2-pal/print/Cargo.toml",
131-
"//:iceoryx2-pal/testing/Cargo.toml",
132-
"//:iceoryx2-userland/record-and-replay/Cargo.toml",
133-
]
134-
)
135-
136-
load("@crate_index//:defs.bzl", "crate_repositories")
137-
138-
crate_repositories()
139-
140-
BAZEL_SKYLIB_VERSION = "1.7.1"
141-
142-
# Load skylib for custom build config
143-
maybe(
144-
name = "bazel_skylib",
145-
repo_rule = http_archive,
146-
sha256 = "bc283cdfcd526a52c3201279cda4bc298652efa898b10b4db0837dc51652756f",
147-
urls = [
148-
"https://mirror.bazel.build/github.com/bazelbuild/bazel-skylib/releases/download/{version}/bazel-skylib-{version}.tar.gz".format(version = BAZEL_SKYLIB_VERSION),
149-
"https://github.com/bazelbuild/bazel-skylib/releases/download/{version}/bazel-skylib-{version}.tar.gz".format(version = BAZEL_SKYLIB_VERSION),
150-
],
151-
)
152-
153-
load("@bazel_skylib//:workspace.bzl", "bazel_skylib_workspace")
154-
155-
bazel_skylib_workspace()
13+
# WORKSPACE support has been removed. Please migrate to Bzlmod. See https://bazel.build/external/migration

doc/bazel/README.md

Lines changed: 13 additions & 132 deletions
Original file line numberDiff line numberDiff line change
@@ -1,17 +1,21 @@
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")
1519
bazel_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
259140
build --@iceoryx2//:foo=on
260141
```
261142

262-
## Running iceory2x Tests in External Project
143+
## Running iceoryx2 Tests in External Project
263144

264145
In general, the iceoryx2 tests can be run in parallel. However, there are
265146
exceptions, as some tests deliberately try to bring the system into an

doc/release-notes/iceoryx2-unreleased.md

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -51,6 +51,8 @@
5151
* Replace `lazy_static` dependency with `LazyLock` from `std` in `std` builds or
5252
a custom minimal spin-based implementation for `no_std` builds
5353
[#1321](https://github.com/eclipse-iceoryx/iceoryx2/issues/1321)
54+
* Remove support for Bazel Workspaces
55+
[#1263](https://github.com/eclipse-iceoryx/iceoryx2/issues/1263)
5456

5557
### Workflow
5658

examples/bazel/MODULE.bazel

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -24,7 +24,7 @@ bazel_dep(name = "rules_rust", version = "0.68.1")
2424
bazel_dep(name = "rules_rust_bindgen", version = "0.68.1")
2525
bazel_dep(name = "rules_cc", version = "0.2.8")
2626
bazel_dep(name = "toolchains_llvm", version = "1.5.0")
27-
bazel_dep(name = "iceoryx2", version = "0.7.0")
27+
bazel_dep(name = "iceoryx2")
2828

2929
# ==============================================================================
3030
# Iceoryx2 Setup

0 commit comments

Comments
 (0)