Skip to content

Commit a809f25

Browse files
authored
Add liburing 2.10 (#4719)
BUILD.bazel is identical to liburing 2.5. Migrated to using overlay dir.
1 parent 211c5b1 commit a809f25

File tree

6 files changed

+115
-1
lines changed

6 files changed

+115
-1
lines changed

modules/liburing/2.10/MODULE.bazel

Lines changed: 8 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,8 @@
1+
module(
2+
name = "liburing",
3+
version = "2.10",
4+
bazel_compatibility = [">=7.2.1"], # need support for "overlay" directory
5+
compatibility_level = 1,
6+
)
7+
8+
bazel_dep(name = "rules_cc", version = "0.1.1")
Lines changed: 76 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,76 @@
1+
# SPDX-License-Identifier: Apache-2.0
2+
3+
# This genrule facilitates the installed kernel headers to configure a
4+
# compatibility header file. While that effectively breaks hermeticity, there
5+
# is not much we can do about that. We can't really bring the kernel headers
6+
# into BCR as they correspond to the host kernel. The good news is that the
7+
# resulting library is portable due to the compatibility layer at compile
8+
# time.
9+
genrule(
10+
name = "generate_headers",
11+
srcs = [
12+
"Makefile.common",
13+
"liburing.spec",
14+
],
15+
outs = [
16+
"config-host.h",
17+
"src/include/liburing/compat.h",
18+
"src/include/liburing/io_uring_version.h",
19+
],
20+
cmd = """
21+
export CC=$(CC) CXX=$(CC)++
22+
23+
# switch to the package dir to execute "configure" right there
24+
pushd $$(dirname $(location configure))
25+
mkdir -p src/include/liburing
26+
./configure --use-libc
27+
popd
28+
29+
# collect the outputs
30+
for out in $(OUTS); do
31+
cp $$(realpath --relative-to=$(BINDIR) $$out) $$out
32+
done
33+
""",
34+
toolchains = ["@bazel_tools//tools/cpp:current_cc_toolchain"],
35+
tools = ["configure"],
36+
)
37+
38+
cc_library(
39+
name = "uring",
40+
srcs = [
41+
"config-host.h",
42+
"src/include/liburing/compat.h",
43+
"src/include/liburing/io_uring_version.h",
44+
"src/queue.c",
45+
"src/register.c",
46+
"src/setup.c",
47+
"src/syscall.c",
48+
"src/version.c",
49+
] + glob([
50+
"src/arch/**/*.h",
51+
"src/*.h",
52+
]),
53+
hdrs = glob(["src/include/**/*.h"]),
54+
55+
# cflags aligned with upstream:
56+
# https://github.com/axboe/liburing/blob/master/src/Makefile#L13
57+
copts = [
58+
"-D_GNU_SOURCE",
59+
"-D_LARGEFILE_SOURCE",
60+
"-D_FILE_OFFSET_BITS=64",
61+
"-DLIBURING_INTERNAL",
62+
"-O3",
63+
"-Wall",
64+
"-Wextra",
65+
"-fno-stack-protector",
66+
"-include config-host.h",
67+
],
68+
includes = ["src/include"],
69+
visibility = ["//visibility:public"],
70+
)
71+
72+
alias(
73+
name = "liburing",
74+
actual = ":uring",
75+
visibility = ["//visibility:public"],
76+
)
Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1 @@
1+
../MODULE.bazel

modules/liburing/2.10/presubmit.yml

Lines changed: 18 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,18 @@
1+
matrix:
2+
platform:
3+
- debian11
4+
- debian10
5+
- fedora39
6+
- ubuntu2004
7+
- ubuntu2204
8+
- ubuntu2404
9+
bazel:
10+
- 8.x
11+
- 7.x
12+
tasks:
13+
verify_targets:
14+
name: Verify build targets
15+
platform: ${{ platform }}
16+
bazel: ${{ bazel }}
17+
build_targets:
18+
- '@liburing'

modules/liburing/2.10/source.json

Lines changed: 10 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,10 @@
1+
{
2+
"url": "https://github.com/axboe/liburing/archive/refs/tags/liburing-2.10.tar.gz",
3+
"integrity": "sha256-Cmh2FqaIbNgrdGt5xOM9xAuNfAxuJND28/189BiGv1M=",
4+
"strip_prefix": "liburing-liburing-2.10",
5+
"patch_strip": 0,
6+
"overlay": {
7+
"BUILD.bazel": "sha256-I2zFirR92K5vnCt7/7d4c483py9Ib+sZH5gtLaZH84c=",
8+
"MODULE.bazel": "sha256-/TmFks2zREKHCWXABOboLg7YX23CkNW3H9yK+DML5gw="
9+
}
10+
}

modules/liburing/metadata.json

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -12,7 +12,8 @@
1212
"github:axboe/liburing"
1313
],
1414
"versions": [
15-
"2.5"
15+
"2.5",
16+
"2.10"
1617
],
1718
"yanked_versions": {}
1819
}

0 commit comments

Comments
 (0)