Skip to content
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
8 changes: 8 additions & 0 deletions modules/liburing/2.14.bcr.1/MODULE.bazel
Original file line number Diff line number Diff line change
@@ -0,0 +1,8 @@
module(
name = "liburing",
version = "2.14.bcr.1",
bazel_compatibility = [">=7.2.1"],
compatibility_level = 1,
)

bazel_dep(name = "rules_cc", version = "0.2.17")
85 changes: 85 additions & 0 deletions modules/liburing/2.14.bcr.1/overlay/BUILD.bazel
Original file line number Diff line number Diff line change
@@ -0,0 +1,85 @@
# SPDX-License-Identifier: Apache-2.0

load("@rules_cc//cc:defs.bzl", "cc_library")

# This genrule facilitates the installed kernel headers to configure a
# compatibility header file. While that effectively breaks hermeticity, there
# is not much we can do about that. We can't really bring the kernel headers
# into BCR as they correspond to the host kernel. The good news is that the
# resulting library is portable due to the compatibility layer at compile
# time.
genrule(
name = "generate_headers",
srcs = [
"Makefile.common",
"liburing.spec",
],
outs = [
"config-host.h",
"src/include/liburing/compat.h",
"src/include/liburing/io_uring_version.h",
],
cmd = """
export CC=$(CC) CXX=$(CC)++ CFLAGS="$(CC_FLAGS)" LDFLAGS="-c"

# We do an out-of-source build here so that CWD does not
# change and relative paths (e.g., sysroot) work correctly.
# liburing doesn't support out-of-source builds natively,
# so we fake it with symlinks.
pkg_dir=$$(dirname $(location configure))
ln -sf $$pkg_dir/Makefile.common Makefile.common
ln -sf $$pkg_dir/liburing.spec liburing.spec
mkdir -p src/include/liburing
$$pkg_dir/configure --use-libc

# collect the outputs
for out in $(OUTS); do
cp $${out#$(RULEDIR)/} $$out
done
""",
toolchains = [
"@bazel_tools//tools/cpp:current_cc_toolchain",
"@bazel_tools//tools/cpp:cc_flags",
],
tools = ["configure"],
)

cc_library(
name = "uring",
srcs = [
"config-host.h",
"src/include/liburing/compat.h",
"src/include/liburing/io_uring_version.h",
"src/queue.c",
"src/register.c",
"src/setup.c",
"src/syscall.c",
"src/version.c",
] + glob([
"src/arch/**/*.h",
"src/*.h",
]),
hdrs = glob(["src/include/**/*.h"]),

# cflags aligned with upstream:
# https://github.com/axboe/liburing/blob/master/src/Makefile#L13
copts = [
"-D_GNU_SOURCE",
"-D_LARGEFILE_SOURCE",
"-D_FILE_OFFSET_BITS=64",
"-DLIBURING_INTERNAL",
"-Wall",
"-Wextra",
"-Wno-unused-parameter",
"-fno-stack-protector",
"-include config-host.h",
],
includes = ["src/include"],
visibility = ["//visibility:public"],
)

alias(
name = "liburing",
actual = ":uring",
visibility = ["//visibility:public"],
)
8 changes: 8 additions & 0 deletions modules/liburing/2.14.bcr.1/overlay/MODULE.bazel
Original file line number Diff line number Diff line change
@@ -0,0 +1,8 @@
module(
name = "liburing",
version = "2.14.bcr.1",
bazel_compatibility = [">=7.2.1"],
compatibility_level = 1,
)

bazel_dep(name = "rules_cc", version = "0.2.17")
18 changes: 18 additions & 0 deletions modules/liburing/2.14.bcr.1/presubmit.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,18 @@
matrix:
platform:
- debian11
- debian10
- fedora39
- ubuntu2004
- ubuntu2204
- ubuntu2404
bazel:
- 8.x
- 7.x
tasks:
verify_targets:
name: Verify build targets
platform: ${{ platform }}
bazel: ${{ bazel }}
build_targets:
- '@liburing'
9 changes: 9 additions & 0 deletions modules/liburing/2.14.bcr.1/source.json
Original file line number Diff line number Diff line change
@@ -0,0 +1,9 @@
{
"url": "https://github.com/axboe/liburing/archive/refs/tags/liburing-2.14.tar.gz",
"integrity": "sha256-X4CWQQiYHGrZecc18LSHfV9JkUwqBi+OiCgvJr9h3gw=",
"strip_prefix": "liburing-liburing-2.14",
"overlay": {
"BUILD.bazel": "sha256-FcUPlEf4Psog6VHI15KeKCJksG7nipYY/nYc57jcE2g=",
"MODULE.bazel": "sha256-bf6db5qgdCG13fl0O2C8EoMoVxE7eg6sLYm9CSz8VUQ="
}
}
3 changes: 2 additions & 1 deletion modules/liburing/metadata.json
Original file line number Diff line number Diff line change
Expand Up @@ -14,7 +14,8 @@
"versions": [
"2.5",
"2.10",
"2.14"
"2.14",
"2.14.bcr.1"
],
"yanked_versions": {}
}
Loading