Skip to contentSkip to conversation

Explain how to build liburing and FFI support

RFC PATCH Superseded Ammar Faizi 3 participants 8 messages Jan 14, 2023 – Jan 16, 2023 1 message not in the archive io_uring

v1 of 2 Superseded Latest is v2 →

lore
Share & tools
lore
#0 lore raw

cover Explain how to build liburing and FFI support

From: Ammar Faizi <[email protected]>

Hi Jens,

This is an RFC patchset.

## Patch 1
Tell people how to build liburing.

## Patch 2
Tell people that they should use the FFI variants when they can't use 'static inline' functions defined in liburing.h.

What do you think?

---

Ammar Faizi (2):
README: Explain how to build liburing
README: Explain about FFI support

 README | 43 +++++++++++++++++++++++++++++++++++++++++++
 1 file changed, 43 insertions(+)

base-commit: 19424b0baa5999918701e1972b901b0937331581

Signature · 1 line
Ammar Faizi
#1 lore raw

RFC PATCH 1/2 README: Explain how to build liburing

From: Ammar Faizi <[email protected]>

Tell people how to build liburing.

---
 README | 24 ++++++++++++++++++++++++
 1 file changed, 24 insertions(+)
README +24 -0
index 80d2b3d..4dd59f6 100644
@@ -47,6 +47,30 @@ the kernel io_uring support. Please note that this suite isn't expected to
 pass on older kernels, and may even crash or hang older kernels!
 
 
+Building liburing
+-----------------
+
+    #
+    # Prepare build config (optional).
+    #
+    #  --cc  specifies the C   compiler.
+    #  --cxx speficies the C++ compiler.
+    #
+    ./configure --cc=gcc --cxx=g++;
+
+    #
+    # Build liburing.
+    #
+    make -j$(nproc);
+
+    #
+    # Install liburing (headers, shared/static libs, and manpage).
+    #
+    sudo make install;
+
+See './configure --help' for more information about build config options.
+
+
 License
 -------
 
Signature · 1 line
Ammar Faizi
#2 lore raw

RFC PATCH 2/2 README: Explain about FFI support

In reply to Ammar Faizi

From: Ammar Faizi <[email protected]>

Tell people that they should use the FFI variants when they can't use 'static inline' functions defined in liburing.h.

---
 README | 19 +++++++++++++++++++
 1 file changed, 19 insertions(+)
README +19 -0
index 4dd59f6..7babb3b 100644
@@ -71,6 +71,25 @@ Building liburing
 See './configure --help' for more information about build config options.
 
 
+FFI support
+-----------
+
+By default, the build results in 4 lib files:
+
+    2 shared libs:
+
+        liburing.so
+        liburing-ffi.so
+
+    2 static libs:
+
+        liburing.a
+        liburing-ffi.a
+
+For languages and applications that can't use 'static inline' functions in
+liburing.h should use the FFI variants.
+
+
 License
 -------
 
Signature · 1 line
Ammar Faizi
maintainer
#3 lore raw

Re: [RFC PATCH v1 liburing 2/2] README: Explain about FFI support

Quoted 25 lines · Ammar Faizi

From: Ammar Faizi <[email protected]>

Tell people that they should use the FFI variants when they can't use 'static inline' functions defined in liburing.h.

---
 README | 19 +++++++++++++++++++
 1 file changed, 19 insertions(+)
README +7 -0
index 4dd59f6..7babb3b 100644
@@ -71,6 +71,25 @@ Building liburing
 See './configure --help' for more information about build config options.
 
 
+FFI support
+-----------
+
+By default, the build results in 4 lib files:
+
+    2 shared libs:
+

README Building liburing · line 90

Quoted 10 lines
README +10 -0
+        liburing.so
+        liburing-ffi.so
+
+    2 static libs:
+
+        liburing.a
+        liburing-ffi.a
+
+For languages and applications that can't use 'static inline' functions in
+liburing.h should use the FFI variants.

Maybe include something on why they can't use them? And that sentence would be better as:

Languages and applications that can't use 'static inline' functions in liburing.h should use the FFI variants.

Signature · 1 line
Jens Axboe

A message that is not in the archive (sent off-list or not yet received): CAHf7xWs1hWvqb61tpBq63CLFvSk=kfAn_nq_2t2gf7O8V9qZ6A@mail.gmail.com

maintainer
#5 lore raw

Re: [RFC PATCH v1 liburing 2/2] README: Explain about FFI support

Quoted 10 lines · Christian Mazakas

For some historical context, this feature came about from trying to consume liburing from Rust. liburing is such a powerful library and it's hard to replace so a dependency on it is reasonable for applications wishing to leverage io_uring without developers being systems-level experts.

For languages that can't parse C headers, liburing-ffi saves quite a bit of effort in terms of bringing liburing itself to the application because it gives consumers a defined set of symbols in the binaries to link against.

Oh I know why it was done and why it's there, this is for the purpose of the README addition. I think it should be a bit more verbose and explain that.

Signature · 1 line
Jens Axboe
#6 lore raw

Re: [RFC PATCH v1 liburing 2/2] README: Explain about FFI support

Hmm, how about something more like this:

+Because liburing's main public interface lives entirely in liburing.h as static inline
+functions, users wishing to consume liburing purely as a binary dependency should
+link against liburing-ffi. liburing-ffi contains definitions for every static inline function
+in liburing.h.

- Christian

maintainer
#7 lore raw

Re: [RFC PATCH v1 liburing 2/2] README: Explain about FFI support

Quoted 9 lines · Christian Mazakas

Hmm, how about something more like this:

+Because liburing's main public interface lives entirely in liburing.h as static inline
+functions, users wishing to consume liburing purely as a binary dependency should
+link against liburing-ffi. liburing-ffi contains definitions for every static inline function
+in liburing.h.

This is great - Ammar, can you incorporate that when you respin the patchset?

Signature · 1 line
Jens Axboe
#8 lore raw

Re: [RFC PATCH v1 liburing 2/2] README: Explain about FFI support

Quoted 2 lines · Jens Axboe

This is great - Ammar, can you incorporate that when you respin the patchset?

Roger that. Will respin the patchset with that incorporated.

Signature · 1 line
Ammar Faizi