From dba692ca0fb44678fdcc7634d821f04eac2f8042 Mon Sep 17 00:00:00 2001 From: Tavian Barnes Date: Tue, 11 Jul 2023 14:30:52 -0400 Subject: build: Add liburing on Linux --- .github/workflows/ci.yml | 5 +++-- .github/workflows/codecov.yml | 3 ++- .github/workflows/codeql.yml | 3 ++- GNUmakefile | 8 +++++++- README.md | 12 ++++++------ docs/BUILDING.md | 2 ++ 6 files changed, 22 insertions(+), 11 deletions(-) diff --git a/.github/workflows/ci.yml b/.github/workflows/ci.yml index ca1737c..971a4df 100644 --- a/.github/workflows/ci.yml +++ b/.github/workflows/ci.yml @@ -28,9 +28,10 @@ jobs: libcap-dev \ libcap2:i386 \ libonig-dev \ - libonig5:i386 + libonig5:i386 \ + liburing-dev # Ubuntu doesn't let you install the -dev packages for both amd64 and - # i386 at once, so we make our own symlinks to fix -m32 -lacl -lattr -lcap + # i386 at once, so we make our own symlinks to fix -m32 -lacl -l... sudo ln -s libacl.so.1 /lib/i386-linux-gnu/libacl.so sudo ln -s libattr.so.1 /lib/i386-linux-gnu/libattr.so sudo ln -s libcap.so.2 /lib/i386-linux-gnu/libcap.so diff --git a/.github/workflows/codecov.yml b/.github/workflows/codecov.yml index 783cc43..b06ea62 100644 --- a/.github/workflows/codecov.yml +++ b/.github/workflows/codecov.yml @@ -20,7 +20,8 @@ jobs: libattr1-dev \ libcap2-bin \ libcap-dev \ - libonig-dev + libonig-dev \ + liburing-dev - name: Generate coverage run: | diff --git a/.github/workflows/codeql.yml b/.github/workflows/codeql.yml index 88e9f3f..3a2f81f 100644 --- a/.github/workflows/codeql.yml +++ b/.github/workflows/codeql.yml @@ -37,7 +37,8 @@ jobs: libattr1-dev \ libcap2-bin \ libcap-dev \ - libonig-dev + libonig-dev \ + liburing-dev - name: Initialize CodeQL uses: github/codeql-action/init@v2 diff --git a/GNUmakefile b/GNUmakefile index 6902979..8154240 100644 --- a/GNUmakefile +++ b/GNUmakefile @@ -126,6 +126,7 @@ ifndef NOLIBS USE_ACL := y USE_ATTR := y USE_LIBCAP := y +USE_LIBURING := y endif ifdef USE_ACL @@ -146,6 +147,11 @@ else LOCAL_CPPFLAGS += -DBFS_USE_SYS_CAPABILITY_H=0 endif +ifdef USE_LIBURING +LOCAL_CPPFLAGS += -DBFS_USE_LIBURING=1 +LOCAL_LDLIBS += -luring +endif + LOCAL_LDFLAGS += -Wl,--as-needed LOCAL_LDLIBS += -lrt endif # Linux @@ -287,7 +293,7 @@ ifneq ($(OS),Darwin) endif +$(MAKE) -B tsan ubsan check CC=clang $(DISTCHECK_FLAGS) ifeq ($(OS) $(ARCH),Linux x86_64) - +$(MAKE) -B check EXTRA_CFLAGS="-m32" ONIG_CONFIG= $(DISTCHECK_FLAGS) + +$(MAKE) -B check EXTRA_CFLAGS="-m32" ONIG_CONFIG= USE_LIBURING= $(DISTCHECK_FLAGS) endif +$(MAKE) -B release check $(DISTCHECK_FLAGS) +$(MAKE) -B check $(DISTCHECK_FLAGS) diff --git a/README.md b/README.md index 18af808..a7ca335 100644 --- a/README.md +++ b/README.md @@ -290,22 +290,22 @@ Here's how to install them on some common platforms:
 Alpine Linux
-# apk add acl{,-dev} attr{,-dev} libcap{,-dev} oniguruma-dev
+# apk add acl{,-dev} attr{,-dev} libcap{,-dev} liburing-dev oniguruma-dev
 
 Arch Linux
-# pacman -S acl attr libcap oniguruma
+# pacman -S acl attr libcap liburing oniguruma
 
 Debian/Ubuntu
-# apt install acl libacl1-dev attr libattr1-dev libcap2-bin libcap-dev libonig-dev
+# apt install acl libacl1-dev attr libattr1-dev libcap2-bin libcap-dev liburing-dev libonig-dev
 
 Fedora
-# dnf install acl libacl-devel libattr-devel libcap-devel oniguruma-devel
+# dnf install acl libacl-devel libattr-devel libcap-devel liburing-devel oniguruma-devel
 
 NixOS
-# nix-env -i acl attr libcap oniguruma
+# nix-env -i acl attr libcap liburing oniguruma
 
 Void Linux
-# xbps-install -S acl-{devel,progs} attr-{devel,progs} libcap-{devel,progs} oniguruma-devel
+# xbps-install -S acl-{devel,progs} attr-{devel,progs} libcap-{devel,progs} liburing-devel oniguruma-devel
 
 Homebrew
 $ brew install oniguruma
diff --git a/docs/BUILDING.md b/docs/BUILDING.md
index b19ef00..02f9756 100644
--- a/docs/BUILDING.md
+++ b/docs/BUILDING.md
@@ -75,11 +75,13 @@ These dependencies are optional, and can be turned off at build time if necessar
 | [acl]       | Linux only | `USE_ACL`       |
 | [attr]      | Linux only | `USE_ATTR`      |
 | [libcap]    | Linux only | `USE_LIBCAP`    |
+| [liburing]  | Linux only | `USE_LIBURING`  |
 | [Oniguruma] | All        | `USE_ONIGURUMA` |
 
 [acl]: https://savannah.nongnu.org/projects/acl
 [attr]: https://savannah.nongnu.org/projects/attr
 [libcap]: https://sites.google.com/site/fullycapable/
+[liburing]: https://github.com/axboe/liburing
 [Oniguruma]: https://github.com/kkos/oniguruma
 
 ### Dependency tracking
-- 
cgit v1.2.3