Skip to content

Commit c86c077

Browse files
committed
fix github action build error
1 parent a06e143 commit c86c077

File tree

5 files changed

+71
-15
lines changed

5 files changed

+71
-15
lines changed

.github/workflows/main.yml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -29,5 +29,5 @@ jobs:
2929
- run: npm install -g @bazel/bazelisk
3030
- name: run build
3131
run: |
32-
sudo apt-get install gperf -y
32+
sudo apt-get install gperf libaio-dev -y
3333
bazel build //:release-tars

thirdparty/liburing/BUILD

Lines changed: 0 additions & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -1,10 +1 @@
1-
load("@rules_foreign_cc//tools/build_defs:configure.bzl", "configure_make")
21

3-
configure_make(
4-
name = "liburing",
5-
configure_options = [
6-
],
7-
lib_source = "@liburing//:all",
8-
out_lib_dir = "lib",
9-
visibility = ["//visibility:public"],
10-
)

thirdparty/liburing/liburing.BUILD

Lines changed: 28 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,28 @@
1+
# vim: ft=bzl
2+
3+
genrule(
4+
name = "compat_h",
5+
outs = [
6+
"src/include/liburing/compat.h",
7+
],
8+
tools = [
9+
"configure",
10+
],
11+
cmd = "./$(location configure) --compat=$@",
12+
)
13+
14+
cc_library(
15+
name = "liburing",
16+
srcs = glob(["src/*.c"]) + [
17+
"src/syscall.h",
18+
],
19+
hdrs = [
20+
":compat_h",
21+
"src/include/liburing.h",
22+
"src/include/liburing/barrier.h",
23+
"src/include/liburing/io_uring.h",
24+
],
25+
includes = ["src/include"],
26+
copts = ["-w"],
27+
visibility = ["//visibility:public"],
28+
)

thirdparty/liburing/liburing.patch

Lines changed: 30 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,30 @@
1+
--- configure 2020-05-06 23:39:54.156690069 +0800
2+
+++ liburing-liburing-0.6/configure 2020-05-06 23:40:57.021601025 +0800
3+
@@ -30,6 +30,8 @@ for opt do
4+
;;
5+
--cc=*) cc="$optarg"
6+
;;
7+
+ --compat=*) compat_h="$optarg"
8+
+ ;;
9+
*)
10+
echo "ERROR: unkown option $opt"
11+
echo "Try '$0 --help' for more information"
12+
@@ -56,6 +58,9 @@ fi
13+
if test -z "$datadir"; then
14+
datadir="$prefix/share"
15+
fi
16+
+if test -z "$compat_h"; then
17+
+ compat_h="src/include/liburing/compat.h"
18+
+fi
19+
20+
if test x"$libdir" = x"$libdevdir"; then
21+
relativelibdir=""
22+
@@ -285,7 +290,7 @@ fi
23+
echo "CC=$cc" >> $config_host_mak
24+
25+
# generate compat.h
26+
-compat_h="src/include/liburing/compat.h"
27+
+# compat_h="src/include/liburing/compat.h"
28+
cat > $compat_h << EOF
29+
/* SPDX-License-Identifier: MIT */
30+
#ifndef LIBURING_COMPAT_H

thirdparty/repositories.bzl

Lines changed: 12 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -14,6 +14,7 @@
1414
# limitations under the License.
1515
#
1616
# @author ZhongXiu Hao <[email protected]>
17+
# @author liubang <[email protected]>
1718

1819
load("@rules_jvm_external//:defs.bzl", "maven_install")
1920
load("@bazel_tools//tools/build_defs/repo:http.bzl", "http_archive", "http_jar")
@@ -44,12 +45,18 @@ def include_repositories():
4445
],
4546
)
4647

48+
# liburing
4749
http_archive(
4850
name = "liburing",
49-
build_file_content = all_content,
50-
strip_prefix = "liburing-liburing-0.7",
51-
urls = [
52-
"https://github.com/axboe/liburing/archive/liburing-0.7.tar.gz",
51+
build_file = "@//thirdparty/liburing:liburing.BUILD",
52+
urls = ["https://github.com/axboe/liburing/archive/liburing-0.6.tar.gz"],
53+
sha256 = "cf718a0a60c3a54da7ec82a0ca639a8e55d683f931b9aba9da603b849db185de",
54+
strip_prefix = "liburing-liburing-0.6",
55+
patch_args = [
56+
"-p0",
57+
],
58+
patches = [
59+
"@//thirdparty/liburing:liburing.patch",
5360
],
5461
)
5562

@@ -179,7 +186,7 @@ def include_repositories():
179186
"@//thirdparty/folly:folly1.patch",
180187
],
181188
patch_args = [
182-
"-p1"
189+
"-p1",
183190
],
184191
urls = [
185192
"https://github.com/facebook/folly/releases/download/v2020.10.26.00/folly-v2020.10.26.00.tar.gz",

0 commit comments

Comments
 (0)