Skip to content

Commit 1cead93

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

File tree

8 files changed

+128
-14
lines changed

8 files changed

+128
-14
lines changed

thirdparty/folly/folly.BUILD

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -79,6 +79,7 @@ cc_library(
7979
"@//thirdparty/bzip2:bzip2",
8080
"@fmt//:fmt",
8181
"@snappy//:snappy",
82+
"@libaio//:libaio",
8283
"@double-conversion//:double-conversion",
8384
"@com_github_google_glog//:glog",
8485
"@com_github_gflags_gflags//:gflags",

thirdparty/libaio/BUILD

Whitespace-only changes.

thirdparty/libaio/libaio.BUILD

Lines changed: 17 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,17 @@
1+
# vim: ft=bzl
2+
3+
load("@rules_foreign_cc//tools/build_defs:make.bzl", "make")
4+
5+
filegroup(
6+
name = "all",
7+
srcs = glob(["**"]),
8+
)
9+
10+
make(
11+
name = "libaio",
12+
static_libraries = [
13+
"libaio.a",
14+
],
15+
lib_source = ":all",
16+
visibility = ["//visibility:public"],
17+
)

thirdparty/libaio/libaio.patch

Lines changed: 26 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,26 @@
1+
--- libaio-libaio-0.3.111.bak/Makefile 2019-10-12 17:46:40.000000000 +0800
2+
+++ libaio-libaio-0.3.111/Makefile 2021-01-29 21:37:03.453090156 +0800
3+
@@ -4,9 +4,11 @@ VERSION=$(shell awk '/Version:/ { print
4+
TAG = $(NAME)-$(VERSION)
5+
RPMBUILD=$(shell `which rpmbuild >&/dev/null` && echo "rpmbuild" || echo "rpm")
6+
7+
-prefix=/usr
8+
-includedir=$(prefix)/include
9+
-libdir=$(prefix)/lib
10+
+ifeq ($(PREFIX),)
11+
+PREFIX = /usr/local
12+
+endif
13+
+includedir=$(PREFIX)/include
14+
+libdir=$(PREFIX)/lib
15+
16+
default: all
17+
18+
@@ -14,7 +16,7 @@ all:
19+
@$(MAKE) -C src
20+
21+
install:
22+
- @$(MAKE) -C src install prefix=$(prefix) includedir=$(includedir) libdir=$(libdir)
23+
+ @$(MAKE) -C src install prefix=$(PREFIX) includedir=$(includedir) libdir=$(libdir)
24+
25+
check:
26+
@$(MAKE) -C harness check

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: 26 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,32 @@ def include_repositories():
4445
],
4546
)
4647

48+
http_archive(
49+
name = "libaio",
50+
build_file = "//thirdparty/libaio:libaio.BUILD",
51+
urls = ["https://pagure.io/libaio/archive/libaio-0.3.111/libaio-libaio-0.3.111.tar.gz"],
52+
sha256 = "e6bc17cba66e59085e670fea238ad095766b412561f90b354eb4012d851730ba",
53+
strip_prefix = "libaio-libaio-0.3.111",
54+
patches = [
55+
"//thirdparty/libaio:libaio.patch",
56+
],
57+
patch_args = [
58+
"-p1",
59+
],
60+
)
61+
62+
# liburing
4763
http_archive(
4864
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",
65+
build_file = "@//thirdparty/liburing:liburing.BUILD",
66+
urls = ["https://github.com/axboe/liburing/archive/liburing-0.6.tar.gz"],
67+
sha256 = "cf718a0a60c3a54da7ec82a0ca639a8e55d683f931b9aba9da603b849db185de",
68+
strip_prefix = "liburing-liburing-0.6",
69+
patch_args = [
70+
"-p0",
71+
],
72+
patches = [
73+
"@//thirdparty/liburing:liburing.patch",
5374
],
5475
)
5576

@@ -179,7 +200,7 @@ def include_repositories():
179200
"@//thirdparty/folly:folly1.patch",
180201
],
181202
patch_args = [
182-
"-p1"
203+
"-p1",
183204
],
184205
urls = [
185206
"https://github.com/facebook/folly/releases/download/v2020.10.26.00/folly-v2020.10.26.00.tar.gz",

0 commit comments

Comments
 (0)