Skip to content

Commit

Permalink
feat: add iceoryx2 (#3485)
Browse files Browse the repository at this point in the history
- as title

---------

Signed-off-by: wep21 <[email protected]>
  • Loading branch information
wep21 authored Jan 9, 2025
1 parent 7529bf5 commit 0e0ac12
Show file tree
Hide file tree
Showing 12 changed files with 284 additions and 1 deletion.
15 changes: 15 additions & 0 deletions modules/iceoryx/2.95.3.bcr.1/MODULE.bazel
Original file line number Diff line number Diff line change
@@ -0,0 +1,15 @@
module(
name = "iceoryx",
version = "2.95.3.bcr.1",
bazel_compatibility = [">=7.2.1"],
)

bazel_dep(name = "bazel_skylib", version = "1.7.1")
bazel_dep(name = "cpptoml", version = "0.1.1")
bazel_dep(name = "platforms", version = "0.0.10")
bazel_dep(name = "rules_cc", version = "0.0.9")
bazel_dep(
name = "buildifier_prebuilt",
version = "7.1.2",
)
bazel_dep(name = "googletest", version = "1.15.2")
1 change: 1 addition & 0 deletions modules/iceoryx/2.95.3.bcr.1/overlay/MODULE.bazel
13 changes: 13 additions & 0 deletions modules/iceoryx/2.95.3.bcr.1/patches/build.patch
Original file line number Diff line number Diff line change
@@ -0,0 +1,13 @@
diff --git BUILD.bazel BUILD.bazel
index a43f9a102..ca2222c5f 100644
--- BUILD.bazel
+++ BUILD.bazel
@@ -24,7 +24,7 @@ exports_files(["VERSION"])
# values: auto, on, off
string_flag(
name = "feature_acl",
- build_setting_default = "auto",
+ build_setting_default = "off",
visibility = ["//visibility:public"],
)

31 changes: 31 additions & 0 deletions modules/iceoryx/2.95.3.bcr.1/presubmit.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,31 @@
matrix:
platform:
- debian11
- macos
- macos_arm64
- ubuntu2004
- ubuntu2204
- ubuntu2404
bazel: [7.x, 8.x, rolling]
tasks:
verify_targets:
name: Verify build targets
platform: ${{ platform }}
bazel: ${{ bazel }}
build_flags:
- "--enable_bzlmod"
- "--incompatible_disallow_empty_glob=false"
- "--cxxopt=-std=c++17"
build_targets:
- "@iceoryx//..."
verify_debian10_targets:
name: Verify build targets
platform: debian10
bazel: ${{ bazel }}
build_flags:
- "--enable_bzlmod"
- "--incompatible_disallow_empty_glob=false"
- "--cxxopt=-std=c++17"
- "--linkopt=-lstdc++fs"
build_targets:
- "@iceoryx//..."
12 changes: 12 additions & 0 deletions modules/iceoryx/2.95.3.bcr.1/source.json
Original file line number Diff line number Diff line change
@@ -0,0 +1,12 @@
{
"integrity": "sha256-FLhUkGtYpIFApdB0Fn1fOlry1XhXSUBQGjMJVK95udQ=",
"strip_prefix": "iceoryx-2.95.3",
"url": "https://github.com/eclipse-iceoryx/iceoryx/archive/refs/tags/v2.95.3.tar.gz",
"patch_strip": 0,
"overlay": {
"MODULE.bazel": "sha256-uw1ospYOsvGPel+2/h4q07z08T8qPfG9OH8vDyBsg6E="
},
"patches": {
"build.patch": "sha256-HXSOKkso6WH3Qup7ubozDGFOiketCZHL5UOu1C8V1Cs="
}
}
3 changes: 2 additions & 1 deletion modules/iceoryx/metadata.json
Original file line number Diff line number Diff line change
Expand Up @@ -11,7 +11,8 @@
"github:eclipse-iceoryx/iceoryx"
],
"versions": [
"2.95.3"
"2.95.3",
"2.95.3.bcr.1"
],
"yanked_versions": {}
}
68 changes: 68 additions & 0 deletions modules/iceoryx2/0.5.0/MODULE.bazel
Original file line number Diff line number Diff line change
@@ -0,0 +1,68 @@
# Copyright (c) 2024 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 Software License 2.0 which is available at
# https://www.apache.org/licenses/LICENSE-2.0, or the MIT license
# which is available at https://opensource.org/licenses/MIT.
#
# SPDX-License-Identifier: Apache-2.0 OR MIT

module(
name = "iceoryx2",
version = "0.5.0",
bazel_compatibility = [">=7.2.1"],
)

bazel_dep(name = "bazel_skylib", version = "1.7.1")
bazel_dep(name = "googletest", version = "1.15.2")
bazel_dep(name = "iceoryx", version = "2.95.3.bcr.1")
bazel_dep(name = "platforms", version = "0.0.10")
bazel_dep(name = "rules_cc", version = "0.1.0")
bazel_dep(name = "rules_rust", version = "0.56.0")

rust = use_extension("@rules_rust//rust:extensions.bzl", "rust")
rust.toolchain(
edition = "2021",
)
use_repo(rust, "rust_toolchains")

register_toolchains("@rust_toolchains//:all")

crate = use_extension("@rules_rust//crate_universe:extensions.bzl", "crate")
crate.from_cargo(
name = "iceoryx2_crate_index",
cargo_lockfile = "//:Cargo.lock",
generate_binaries = True,
manifests = [
"//:Cargo.toml",
"//benchmarks/event:Cargo.toml",
"//benchmarks/publish-subscribe:Cargo.toml",
"//benchmarks/queue:Cargo.toml",
"//:examples/Cargo.toml",
"//iceoryx2:Cargo.toml",
"//iceoryx2-bb/container:Cargo.toml",
"//iceoryx2-bb/derive-macros:Cargo.toml",
"//iceoryx2-bb/elementary:Cargo.toml",
"//iceoryx2-bb/lock-free:Cargo.toml",
"//iceoryx2-bb/log:Cargo.toml",
"//iceoryx2-bb/memory:Cargo.toml",
"//iceoryx2-bb/posix:Cargo.toml",
"//iceoryx2-bb/system-types:Cargo.toml",
"//iceoryx2-bb/testing:Cargo.toml",
"//iceoryx2-bb/threadsafe:Cargo.toml",
"//iceoryx2-bb/trait-tests:Cargo.toml",
"//iceoryx2-cal:Cargo.toml",
"//iceoryx2-cli:Cargo.toml",
"//iceoryx2-ffi/ffi:Cargo.toml",
"//iceoryx2-ffi/ffi-macros:Cargo.toml",
"//iceoryx2-pal/concurrency-sync:Cargo.toml",
"//iceoryx2-pal/configuration:Cargo.toml",
"//iceoryx2-pal/posix:Cargo.toml",
],
)
use_repo(crate, crate_index = "iceoryx2_crate_index")

bazel_dep(name = "rules_rust_bindgen", version = "0.56.0")
1 change: 1 addition & 0 deletions modules/iceoryx2/0.5.0/overlay/MODULE.bazel
72 changes: 72 additions & 0 deletions modules/iceoryx2/0.5.0/patches/bindgen.patch
Original file line number Diff line number Diff line change
@@ -0,0 +1,72 @@
diff --git iceoryx2-ffi/ffi/BUILD.bazel iceoryx2-ffi/ffi/BUILD.bazel
index f2738f81..d294d862 100644
--- iceoryx2-ffi/ffi/BUILD.bazel
+++ iceoryx2-ffi/ffi/BUILD.bazel
@@ -20,9 +20,10 @@ filegroup(
srcs = glob(["**"]),
)

-filegroup(
- name = "cbindgen-cli",
- srcs = ["@cbindgen//file"],
+alias(
+ name = "cbindgen",
+ actual = "@crate_index//:cbindgen__cbindgen",
+ tags = ["manual"],
)

genrule(
@@ -31,11 +32,17 @@ genrule(
"//:all_srcs",
"Cargo.toml",
"cbindgen.toml",
- ":cbindgen-cli",
+ ":cbindgen",
],
outs = ["include/iox2/iceoryx2.h"],
# this is actually just 'cbindgen iceoryx2-ffi/ffi --quiet --config iceoryx2-ffi/ffi/cbindgen.toml --output include/iox2/iceoryx2.h'
- cmd = "$(execpath :cbindgen-cli) $$(dirname $(location Cargo.toml)) --quiet --config $(location cbindgen.toml) --output $(OUTS)",
+ cmd = """
+export PATH=$$(dirname $$(realpath $(location @rules_rust//rust/toolchain:current_cargo_files))):$$PATH
+$(execpath :cbindgen) $$(dirname $(location Cargo.toml)) --quiet --config $(location cbindgen.toml) --output $(OUTS)
+""",
+ tools = [
+ "@rules_rust//rust/toolchain:current_cargo_files",
+ ],
)

rust_shared_library(
diff --git iceoryx2-pal/posix/BUILD.bazel iceoryx2-pal/posix/BUILD.bazel
index 031247b8..b40f7db1 100644
--- iceoryx2-pal/posix/BUILD.bazel
+++ iceoryx2-pal/posix/BUILD.bazel
@@ -15,6 +15,7 @@ package(default_visibility = ["//visibility:public"])
load("@rules_cc//cc:defs.bzl", "cc_library")
load("@rules_rust//cargo:defs.bzl", "cargo_build_script")
load("@rules_rust//rust:defs.bzl", "rust_library", "rust_test_suite")
+load("@rules_rust_bindgen//:defs.bzl", "rust_bindgen")

filegroup(
name = "all_srcs",
@@ -36,14 +37,14 @@ cc_library(
)

# Generate the Rust binding file
-genrule(
- name = "iceoryx2-pal-posix-bindgen",
- srcs = [
- "src/c/posix.h",
- "@bindgen//:bindgen-cli",
+rust_bindgen(
+ name = "posix_generated",
+ cc_lib = ":iceoryx2-pal-posix-c-lib",
+ header = "src/c/posix.h",
+ bindgen_flags = [
+ "--use-core",
+ "--blocklist-type=max_align_t",
],
- outs = ["posix_generated.rs"],
- cmd = "$(execpath @bindgen//:bindgen-cli) --use-core --blocklist-type max_align_t $(location src/c/posix.h) --output $(OUTS)",
)

cargo_build_script(
40 changes: 40 additions & 0 deletions modules/iceoryx2/0.5.0/presubmit.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,40 @@
matrix:
platform:
- macos
- macos_arm64
- ubuntu2204
- ubuntu2404
bazel: [7.x, 8.x, rolling]
tasks:
verify_targets:
name: Verify build targets
platform: ${{ platform }}
bazel: ${{ bazel }}
build_flags:
- "--enable_bzlmod"
- "--incompatible_disallow_empty_glob=false"
- "--cxxopt=-std=c++17"
build_targets:
- "@iceoryx2//..."
verify_debian11_targets:
name: Verify build targets
platform: debian11
bazel: ${{ bazel }}
build_flags:
- "--enable_bzlmod"
- "--incompatible_disallow_empty_glob=false"
- "--cxxopt=-std=c++17"
- "--linkopt=-lrt"
build_targets:
- "@iceoryx2//..."
verify_ubuntu2004_targets:
name: Verify build targets
platform: ubuntu2004
bazel: ${{ bazel }}
build_flags:
- "--enable_bzlmod"
- "--incompatible_disallow_empty_glob=false"
- "--cxxopt=-std=c++17"
- "--linkopt=-lrt"
build_targets:
- "@iceoryx2//..."
12 changes: 12 additions & 0 deletions modules/iceoryx2/0.5.0/source.json
Original file line number Diff line number Diff line change
@@ -0,0 +1,12 @@
{
"integrity": "sha256-DoY1ttMS86nEzk+CNObm+NHSKdouRCjaoB4L03CaUdg=",
"strip_prefix": "iceoryx2-0.5.0",
"url": "https://github.com/eclipse-iceoryx/iceoryx2/archive/refs/tags/v0.5.0.tar.gz",
"patch_strip": 0,
"overlay": {
"MODULE.bazel": "sha256-6XdARpRXdZX36NZ4jncy2v+gl5WM2JDmbConXge2Qyk="
},
"patches": {
"bindgen.patch": "sha256-/dge8FyZJhabniA9qJsg3+xEiQBQsFLV2jEDagZyag8="
}
}
17 changes: 17 additions & 0 deletions modules/iceoryx2/metadata.json
Original file line number Diff line number Diff line change
@@ -0,0 +1,17 @@
{
"homepage": "https://github.com/eclipse-iceoryx/iceoryx2.git",
"maintainers": [
{
"email": "[email protected]",
"github": "wep21",
"name": "Daisuke Nishimatsu"
}
],
"repository": [
"github:eclipse-iceoryx/iceoryx2"
],
"versions": [
"0.5.0"
],
"yanked_versions": {}
}

0 comments on commit 0e0ac12

Please sign in to comment.