git.iko.soy/typeable/nixpkgs
on master help sign in
liburing: bump to 0.1 tag + some extra patches

Normally changing the version of the tag in this manner would be nasty for users -- `nix-env -u` would not see this as an upgrade on the channel, for instance, if you had a previous version installed. But liburing is a *library* and does not really come included with any useful end-user tools. Most cases will use it directly as a build dependency, in which case, an appropriate rebuild will happen anyway. This also re-introduces AArch64 builds, which was previously broken due to some internal changes requiring memory barrier support. In a twist of fate, however, this was later broken by another patch, which was written to fix a *different* regression for users. So we simply apply both of these patches, as well as a third patch that re-fixes AArch64 support, which I will submit upstream to Jens. Life is never easy. Signed-off-by: Austin Seipp <aseipp@pobox.com>

commit66f37f4a344ea02de41c01c9e518dc716c7405a0 authorAustin Seipp <aseipp@pobox.com> dateTue 20 Aug 2019, 08:15 (7 years ago) parent40e9737
2 files changed+70−3
pkgs/development/libraries/liburing/default.nix+41−3 pkgs/development/libraries/liburing/fix-aarch64-barrier-names.patch+29
pkgs/development/libraries/liburing/default.nix+41−3
@@ -1,16 +1,54 @@
11{ stdenv, fetchgit
2+, fetchpatch
23}:
34
45stdenv.mkDerivation rec {
56 name = "liburing-${version}";
6− version = "1.0.0pre156_${builtins.substring 0 7 src.rev}";
7+ version = "0.1";
78
89 src = fetchgit {
910 url = "http://git.kernel.dk/liburing";
10− rev = "c31c7ec4bcd7bb0d7b28897d730431c02b9d4ea1";
11− sha256 = "17d6s03fyajcrijca9d2d6llbf8cl8dyalpxnl39az3452p04s11";
11+ rev = "refs/tags/liburing-${version}";
12+ sha256 = "038iqsbm9bdmlwvmb899bc6g1rw5dalr990azynbvgn8qs5adysh";
1213 };
1314
15+ patches = [
16+
17+ # This patch re-introduces support for aarch64-linux, by adding the
18+ # necessary memory barrier primitives for it to work.
19+ #
20+ # Already upstream: remove when moving to the next version
21+ (fetchpatch {
22+ url = "http://git.kernel.dk/cgit/liburing/patch/?id=0520db454c29f1d96cda6cf6cedeb93df65301e8";
23+ sha256 = "1i8133sb1imzxpplmhlhnaxkffgplhj40vanivc6clbibvhgwpq6";
24+ })
25+
26+ # This patch shuffles the name of the io_uring memory barrier primitives.
27+ # They were using extremely common names by accident, which caused
28+ # namespace conflicts with many other projects using the same names. Note:
29+ # this does not change the user-visible API of liburing (liburing is
30+ # designed exactly to hide the necessary memory barriers when using the
31+ # io_uring syscall directly). It only changes the names of some internals.
32+ # The only reason this caused problems at all is because memory barrier
33+ # primitives are written as preprocessor defines, in a common header file,
34+ # which get included unilaterally.
35+ #
36+ # Already upstream: remove when moving to the next version
37+ (fetchpatch {
38+ url = "http://git.kernel.dk/cgit/liburing/patch/?id=552c6a08d04c74d20eeaa86f535bfd553b352370";
39+ sha256 = "123d6jdqfy7b8aq9f6ax767n48hhbx6pln3nlrp623595i8zz3wf";
40+ })
41+
42+ # Finally, this patch fixes the aarch64-linux support introduced by the
43+ # first patch, but which was _broken_ by the second patch, in a horrid
44+ # twist of fate: it neglected to change the names of the aarch64 barriers
45+ # appropriately. (I assume the author did not attempt to compile for
46+ # aarch64, hence this regression)
47+ #
48+ # Not yet upstream: TBD.
49+ ./fix-aarch64-barrier-names.patch
50+ ];
51+
1452 separateDebugInfo = true;
1553 enableParallelBuilding = true;
1654
pkgs/development/libraries/liburing/fix-aarch64-barrier-names.patchnew file+29
@@ -0,0 +1,29 @@
1+diff --git a/src/include/liburing/barrier.h b/src/include/liburing/barrier.h
2+index 8efa6dd..051b20f 100644
3+--- a/src/include/liburing/barrier.h
4++++ b/src/include/liburing/barrier.h
5+@@ -61,15 +61,15 @@ do { \
6+
7+ #elif defined(__aarch64__)
8+ /* Adapted from arch/arm64/include/asm/barrier.h */
9+-#define dmb(opt) asm volatile("dmb " #opt : : : "memory")
10+-#define dsb(opt) asm volatile("dsb " #opt : : : "memory")
11+-
12+-#define mb() dsb(sy)
13+-#define rmb() dsb(ld)
14+-#define wmb() dsb(st)
15+-#define smp_mb() dmb(ish)
16+-#define smp_rmb() dmb(ishld)
17+-#define smp_wmb() dmb(ishst)
18++#define io_uring_dmb(opt) asm volatile("dmb " #opt : : : "memory")
19++#define io_uring_dsb(opt) asm volatile("dsb " #opt : : : "memory")
20++
21++#define io_uring_mb() io_uring_dsb(sy)
22++#define io_uring_rmb() io_uring_dsb(ld)
23++#define io_uring_wmb() io_uring_dsb(st)
24++#define io_uring_smp_mb() io_uring_dmb(ish)
25++#define io_uring_smp_rmb() io_uring_dmb(ishld)
26++#define io_uring_smp_wmb() io_uring_dmb(ishst)
27+
28+ #else /* defined(__x86_64__) || defined(__i386__) || defined(__aarch64__) */
29+ /*