Skip to contentSkip to conversation

liburing debian packaging fixes.

PATCH Superseded Eric Wong 3 participants 37 messages Nov 16, 2021 – Apr 4, 2022

Subsystems (2)
lore
Share & tools
lore

Eric Wong

author
#0 lore raw

cover liburing debian packaging fixes.

I'm testing liburing on my Debian 11.x (bullseye) system and ran into some problems with the current packaging. The official Debian packages are only on liburing-0.7, so I'm building from git.

Here are some fixes and speedups, tested on both Debian 11.x and 10.x (buster).

Eric Wong (4):
make-debs: fix version detection
debian: avoid prompting package builder for signature debian/rules: fix for newer debhelper debian/rules: support parallel build

 debian/changelog |  6 ++++++
 debian/rules     | 19 ++++++++++++++++++-
 make-debs.sh     |  8 ++++++--
 3 files changed, 30 insertions(+), 3 deletions(-)
author
#1 lore raw

PATCH 1/4 make-debs: fix version detection

`head -l' is not supported on my version of head(1) on Debian buster nor bullseye (and AFAIK, not any version of head(1). Furthermore, head(1) is not required at all since sed(1) can limit operations to any line.

Since this is a bash script, we'll also use "set -o pipefail" to ensure future errors of this type are caught.

---
 make-debs.sh | 3 ++-
 1 file changed, 2 insertions(+), 1 deletion(-)
make-debs.sh +2 -1
index 01d563c..136b79e 100755
@@ -16,6 +16,7 @@
 # along with this program.  If not, see <http://www.gnu.org/licenses/>.
 #
 set -xe
+set -o pipefail
 
 # Create dir for build
 base=${1:-/tmp/release}
@@ -38,7 +39,7 @@ cd ${releasedir}/${outfile}
 git clean -dxf
 
 # Change changelog if it's needed
-cur_ver=`head -l debian/changelog | sed -n -e 's/.* (\(.*\)) .*/\1/p'`
+cur_ver=$(sed -n -e '1s/.* (\(.*\)) .*/\1/p' debian/changelog)
 if [ "$cur_ver" != "$version-1" ]; then
 	dch -D $codename --force-distribution -b -v "$version-1" "new version"
 fi
#2 lore raw

Re: [PATCH 1/4] make-debs: fix version detection

Hi Eric,

a comment on versioning in general not really about your commit.

Is it still correct to have liburing1* in debian/control, shouldn't it be liburing2 now?

Also shouldn't we get version= out of liburing.spec as that seems to contain the current version number... instead of using git describe --match "lib*" | cut -d '-' -f 2

I also noticed that this
commit c0b43df28a982747e081343f23289357ab4615db

Author: Bikal Lem <[email protected]>
Date:   Mon Nov 15 13:09:30 2021 +0000

src/Makefile: use VERSION variable consistently

src/Makefile defines incorrect 'liburing.so' version, i.e 2.1 as opposed to 2.2. This commit makes src/Makefile use correct version defined in liburing.spec. Along the way we refactor the use of common variables into Makefile.common and include it into both src/Makefile and Makefile.

changed the library soname from liburing.so.2 to just liburing.so, which seems wrong.

metze

author
#3 lore raw

Re: [PATCH 1/4] make-debs: fix version detection

Quoted 7 lines · Stefan Metzmacher

Hi Eric,

a comment on versioning in general not really about your commit.

Is it still correct to have liburing1* in debian/control, shouldn't it be liburing2 now?

Yes, I'll correct that in a reroll.

Quoted 2 lines

Also shouldn't we get version= out of liburing.spec as that seems to contain the current version number... instead of using git describe --match "lib*" | cut -d '-' -f 2

Agreed. I've also got patches on the way which will allow building .debs without git at all.

Quoted 13 lines

I also noticed that this
commit c0b43df28a982747e081343f23289357ab4615db

Author: Bikal Lem <[email protected]>
Date:   Mon Nov 15 13:09:30 2021 +0000

src/Makefile: use VERSION variable consistently

src/Makefile defines incorrect 'liburing.so' version, i.e 2.1 as opposed to 2.2. This commit makes src/Makefile use correct version defined in liburing.spec. Along the way we refactor the use of common variables into Makefile.common and include it into both src/Makefile and Makefile.

Quoted 3 lines

changed the library soname from liburing.so.2 to just liburing.so, which seems wrong.

Separate issue, but yes, I'm inclined to agree with Stefan that the ".2" should remain. (I'm not an expert in library/packaging issues by any means; I just want the ability to cleanly uninstall/upgrade via debs)

author
#4 lore raw

PATCH 2/4 debian: avoid prompting package builder for signature

In reply to Eric Wong

By setting the distribution to "UNRELEASED", debuild(1) will no longer prompt users to sign the package(s). I expect most users building these Debian packages with make-debs.sh will be using them locally on a development system which may not have private keys.

AFAIK the official Debian package is maintained separately at
<https://git.hadrons.org/git/debian/pkgs/liburing.git>,
and won't be affected by this change.

---
 debian/changelog | 6 ++++++
 make-debs.sh     | 5 ++++-
 2 files changed, 10 insertions(+), 1 deletion(-)
debian/changelog +6 -0
index f0032e3..fbc361b 100644
@@ -1,3 +1,9 @@
+liburing (2.0-1) UNRELEASED; urgency=low
+
+  * development package built for local use
+
+ -- Local User <[email protected]>  Tue, 16 Nov 2021 18:04:09 +0000
+
 liburing (0.7-1) stable; urgency=low
 
   * Update to 0.7
make-debs.sh +4 -1
index 136b79e..aea05f0 100755
@@ -20,7 +20,10 @@ set -o pipefail
 
 # Create dir for build
 base=${1:-/tmp/release}
-codename=$(lsb_release -sc)
+
+# UNRELEASED here means debuild won't prompt for signing
+codename=UNRELEASED
+
 releasedir=$base/$(lsb_release -si)/liburing
 rm -rf $releasedir
 mkdir -p $releasedir
#5 lore raw

Re: [PATCH 2/4] debian: avoid prompting package builder for signature

Hi Eric,

Quoted 6 lines
make-debs.sh +0 -0
index 136b79e..aea05f0 100755
@@ -20,7 +20,10 @@ set -o pipefail
 

make-debs.sh set -o pipefail · line 29

Quoted 10 lines
make-debs.sh +4 -1
 # Create dir for build
 base=${1:-/tmp/release}
-codename=$(lsb_release -sc)
+
+# UNRELEASED here means debuild won't prompt for signing
+codename=UNRELEASED
+
 releasedir=$base/$(lsb_release -si)/liburing
 rm -rf $releasedir
 mkdir -p $releasedir

You can use DEBUILD_DPKG_BUILDPACKAGE_OPTS="--no-sign" in ~/.devscripts

Or we could make it possible to pass arguments down to 'debuild', e.g. '-us -uc'. I'm also fine with doing that by default.

metze

author
#6 lore raw

Re: [PATCH 2/4] debian: avoid prompting package builder for signature

Quoted 21 lines · Stefan Metzmacher

Hi Eric,

Quoted 6 lines
make-debs.sh +0 -0
index 136b79e..aea05f0 100755
@@ -20,7 +20,10 @@ set -o pipefail
 

make-debs.sh set -o pipefail · line 29

Quoted 10 lines
make-debs.sh +4 -1
 # Create dir for build
 base=${1:-/tmp/release}
-codename=$(lsb_release -sc)
+
+# UNRELEASED here means debuild won't prompt for signing
+codename=UNRELEASED
+
 releasedir=$base/$(lsb_release -si)/liburing
 rm -rf $releasedir
 mkdir -p $releasedir

You can use DEBUILD_DPKG_BUILDPACKAGE_OPTS="--no-sign" in ~/.devscripts

Quoted 2 lines

Or we could make it possible to pass arguments down to 'debuild', e.g. '-us -uc'. I'm also fine with doing that by default.

Yes, I extended the commit message in v2 to note "UNRELEASED" is also helpful in communicating the package is an unofficial Debian package. This is helpful tidbit since an official Debian package now exists.

author
#7 lore raw

PATCH 3/4 debian/rules: fix for newer debhelper

In reply to Eric Wong

When testing on my Debian 11.x (stable) system, --add-udeb causes the following build error:

dh_makeshlibs: error: The udeb liburing1-udeb does not contain any shared librar ies but --add-udeb=liburing1-udeb was passed!?
make: *** [debian/rules:82: binary-arch] Error 255

Reading the current dh_makeshlibs(1) manpage reveals --add-udeb is nowadays implicit as of debhelper 12.3 and no longer necessary. Compatibility with Debian oldstable (buster) remains intact. Tested with debhelper 12.1.1 on Debian 10.x (buster) and debhelper 13.3.4 on Debian 11.x (bullseye).

---
 debian/rules | 9 ++++++++-
 1 file changed, 8 insertions(+), 1 deletion(-)
debian/rules +8 -1
index 1a334b3..2a0d563 100755
@@ -70,7 +70,14 @@ binary-arch: install-arch
 	dh_strip -a --ddeb-migration='$(libdbg) (<< 0.3)'
 	dh_compress -a
 	dh_fixperms -a
-	dh_makeshlibs -a --add-udeb '$(libudeb)'
+
+# --add-udeb is needed for <= 12.3, and breaks with auto-detection
+#  on debhelper 13.3.4, at least
+	if perl -MDebian::Debhelper::Dh_Version -e \
+	'exit(eval("v$$Debian::Debhelper::Dh_Version::version") le v12.3)'; \
+		then dh_makeshlibs -a; else \
+		dh_makeshlibs -a --add-udeb '$(libudeb)'; fi
+
 	dh_shlibdeps -a
 	dh_installdeb -a
 	dh_gencontrol -a
#8 lore raw

Re: [PATCH 3/4] debian/rules: fix for newer debhelper

Hi Eric,

Quoted 25 lines

When testing on my Debian 11.x (stable) system, --add-udeb causes the following build error:

dh_makeshlibs: error: The udeb liburing1-udeb does not contain any shared librar ies but --add-udeb=liburing1-udeb was passed!?
make: *** [debian/rules:82: binary-arch] Error 255

Reading the current dh_makeshlibs(1) manpage reveals --add-udeb is nowadays implicit as of debhelper 12.3 and no longer necessary. Compatibility with Debian oldstable (buster) remains intact. Tested with debhelper 12.1.1 on Debian 10.x (buster) and debhelper 13.3.4 on Debian 11.x (bullseye).

---
 debian/rules | 9 ++++++++-
 1 file changed, 8 insertions(+), 1 deletion(-)
debian/rules +0 -0
index 1a334b3..2a0d563 100755
@@ -70,7 +70,14 @@ binary-arch: install-arch
 	dh_strip -a --ddeb-migration='$(libdbg) (<< 0.3)'
 	dh_compress -a

debian/rules binary-arch: install-arch · line 80

Quoted 10 lines
debian/rules +8 -1
 	dh_fixperms -a
-	dh_makeshlibs -a --add-udeb '$(libudeb)'
+
+# --add-udeb is needed for <= 12.3, and breaks with auto-detection
+#  on debhelper 13.3.4, at least
+	if perl -MDebian::Debhelper::Dh_Version -e \
+	'exit(eval("v$$Debian::Debhelper::Dh_Version::version") le v12.3)'; \
+		then dh_makeshlibs -a; else \
+		dh_makeshlibs -a --add-udeb '$(libudeb)'; fi
+

I think this needs to be 'ge v12.3)' instead of 'le v12.3)' otherwise I still get the above error on ubuntu 20.04.

metze

author
#9 lore raw

Re: [PATCH 3/4] debian/rules: fix for newer debhelper

Quoted 10 lines · Stefan Metzmacher

debian/rules binary-arch: install-arch · line 80

Quoted 7 lines
debian/rules +7 -0
+# --add-udeb is needed for <= 12.3, and breaks with auto-detection
+#  on debhelper 13.3.4, at least
+	if perl -MDebian::Debhelper::Dh_Version -e \
+	'exit(eval("v$$Debian::Debhelper::Dh_Version::version") le v12.3)'; \
+		then dh_makeshlibs -a; else \
+		dh_makeshlibs -a --add-udeb '$(libudeb)'; fi
+

I think this needs to be 'ge v12.3)' instead of 'le v12.3)' otherwise I still get the above error on ubuntu 20.04.

It should be 'lt v12.3', actually. The Perl exit() with a falsy value means it's true' for the if' shell statement. Yes, I got confused, too :x Will fix.

author
#10 lore raw

PATCH 4/4 debian/rules: support parallel build

In reply to Eric Wong

This bit stolen from the debian/rules file of `git' speeds up builds from ~35s to ~10s for me.

---
 debian/rules | 10 ++++++++++
 1 file changed, 10 insertions(+)
debian/rules +10 -0
index 2a0d563..4b58d90 100755
@@ -9,6 +9,16 @@ DEB_CFLAGS_MAINT_PREPEND = -Wall
 include /usr/share/dpkg/default.mk
 include /usr/share/dpkg/buildtools.mk
 
+# taken from the debian/rules of src:git
+ifneq (,$(filter parallel=%,$(DEB_BUILD_OPTIONS)))
+  NUMJOBS = $(patsubst parallel=%,%,$(filter parallel=%,$(DEB_BUILD_OPTIONS)))
+  MAKEFLAGS += -j$(NUMJOBS)
+  # Setting this with a pattern-specific rule prevents -O from
+  # affecting the top-level make, which would break realtime build
+  # output (unless dh is run as +dh, which causes other problems).
+  %: MAKEFLAGS += -O
+endif
+
 export CC
 
 lib := liburing1
author
#11 lore raw

v2 cover liburing debian packaging fixes

In reply to Eric Wong

3 new patches on top of the original series, this addresses the issues noticed by Stefan in the original series.

I'm getting these warnings from dpkg-gensymbols, but AFAIK they're not fatal:

dpkg-gensymbols: warning: new libraries appeared in the symbols file: liburing.so
dpkg-gensymbols: warning: some libraries disappeared in the symbols file: liburing.so.1
dpkg-gensymbols: warning: debian/liburing1/DEBIAN/symbols doesn't match completely debian/liburing1.symbols --- debian/liburing1.symbols (liburing1_2.1-1_amd64)
+++ dpkg-gensymbolsHfPj7C 2021-11-18 03:07:48.131823699 +0000
@@ -1,32 +1,41 @@
-liburing.so.1 liburing1 #MINVER#
- (symver)LIBURING_0.1 0.1-1
- (symver)LIBURING_0.2 0.2-1
- (symver)LIBURING_0.3 0.3-1
- (symver)LIBURING_0.4 0.4-1
- (symver)LIBURING_0.5 0.5-1
- (symver)LIBURING_0.6 0.6-1
- (symver)LIBURING_0.7 0.7-1
- __io_uring_get_cqe@LIBURING_0.2 0.2-1
- io_uring_get_probe@LIBURING_0.4 0.4-1
- io_uring_get_probe_ring@LIBURING_0.4 0.4-1
- io_uring_get_sqe@LIBURING_0.1 0.1-1
- io_uring_peek_batch_cqe@LIBURING_0.2 0.2-1
- io_uring_queue_exit@LIBURING_0.1 0.1-1
- io_uring_queue_init@LIBURING_0.1 0.1-1
- io_uring_queue_init_params@LIBURING_0.2 0.2-1
- io_uring_queue_mmap@LIBURING_0.1 0.1-1
- io_uring_register_buffers@LIBURING_0.1 0.1-1
- io_uring_register_eventfd@LIBURING_0.1 0.1-1
- io_uring_register_eventfd_async@LIBURING_0.6 0.6-1
- io_uring_register_files@LIBURING_0.1 0.1-1
- io_uring_register_files_update@LIBURING_0.2 0.2-1
- io_uring_register_personality@LIBURING_0.4 0.4-1
- io_uring_register_probe@LIBURING_0.4 0.4-1
- io_uring_ring_dontfork@LIBURING_0.4 0.4-1
- io_uring_submit@LIBURING_0.1 0.1-1
- io_uring_submit_and_wait@LIBURING_0.1 0.1-1
- io_uring_unregister_buffers@LIBURING_0.1 0.1-1
- io_uring_unregister_files@LIBURING_0.1 0.1-1
- io_uring_unregister_personality@LIBURING_0.4 0.4-1
- io_uring_wait_cqe_timeout@LIBURING_0.2 0.2-1
- io_uring_wait_cqes@LIBURING_0.2 0.2-1
+liburing.so liburing1 #MINVER#
+ LIBURING_2.0@LIBURING_2.0 2.1-1
+ LIBURING_2.1@LIBURING_2.1 2.1-1
+ LIBURING_2.2@LIBURING_2.2 2.1-1
+ __io_uring_get_cqe@LIBURING_2.0 2.1-1
+ __io_uring_sqring_wait@LIBURING_2.0 2.1-1
+ io_uring_free_probe@LIBURING_2.0 2.1-1
+ io_uring_get_probe@LIBURING_2.0 2.1-1
+ io_uring_get_probe_ring@LIBURING_2.0 2.1-1
+ io_uring_get_sqe@LIBURING_2.0 2.1-1
+ io_uring_mlock_size@LIBURING_2.1 2.1-1
+ io_uring_mlock_size_params@LIBURING_2.1 2.1-1
+ io_uring_peek_batch_cqe@LIBURING_2.0 2.1-1
+ io_uring_queue_exit@LIBURING_2.0 2.1-1
+ io_uring_queue_init@LIBURING_2.0 2.1-1
+ io_uring_queue_init_params@LIBURING_2.0 2.1-1
+ io_uring_queue_mmap@LIBURING_2.0 2.1-1
+ io_uring_register_buffers@LIBURING_2.0 2.1-1
+ io_uring_register_buffers_tags@LIBURING_2.1 2.1-1
+ io_uring_register_buffers_update_tag@LIBURING_2.1 2.1-1
+ io_uring_register_eventfd@LIBURING_2.0 2.1-1
+ io_uring_register_eventfd_async@LIBURING_2.0 2.1-1
+ io_uring_register_files@LIBURING_2.0 2.1-1
+ io_uring_register_files_tags@LIBURING_2.1 2.1-1
+ io_uring_register_files_update@LIBURING_2.0 2.1-1
+ io_uring_register_files_update_tag@LIBURING_2.1 2.1-1
+ io_uring_register_iowq_aff@LIBURING_2.1 2.1-1
+ io_uring_register_iowq_max_workers@LIBURING_2.1 2.1-1
+ io_uring_register_personality@LIBURING_2.0 2.1-1
+ io_uring_register_probe@LIBURING_2.0 2.1-1
+ io_uring_ring_dontfork@LIBURING_2.0 2.1-1
+ io_uring_submit@LIBURING_2.0 2.1-1
+ io_uring_submit_and_wait@LIBURING_2.0 2.1-1
+ io_uring_submit_and_wait_timeout@LIBURING_2.2 2.1-1
+ io_uring_unregister_buffers@LIBURING_2.0 2.1-1
+ io_uring_unregister_eventfd@LIBURING_2.0 2.1-1
+ io_uring_unregister_files@LIBURING_2.0 2.1-1
+ io_uring_unregister_iowq_aff@LIBURING_2.1 2.1-1
+ io_uring_unregister_personality@LIBURING_2.0 2.1-1
+ io_uring_wait_cqe_timeout@LIBURING_2.0 2.1-1
+ io_uring_wait_cqes@LIBURING_2.0 2.1-1

Eric Wong (7):
make-debs: fix version detection
debian: avoid prompting package builder for signature debian/rules: fix for newer debhelper debian/rules: support parallel build
debian: rename package to liburing2 to match .so version
make-debs: use version from RPM .spec
make-debs: remove dependency on git

 Makefile                                      |  5 ++++-
 debian/changelog                              |  6 ++++++
 debian/control                                |  6 +++---
 ...g1-udeb.install => liburing2-udeb.install} |  0
 .../{liburing1.install => liburing2.install}  |  0
 .../{liburing1.symbols => liburing2.symbols}  |  2 +-
 debian/rules                                  | 21 +++++++++++++++++--
 make-debs.sh                                  | 19 ++++++++++++-----
 8 files changed, 47 insertions(+), 12 deletions(-)
 rename debian/{liburing1-udeb.install => liburing2-udeb.install} (100%)
 rename debian/{liburing1.install => liburing2.install} (100%)
 rename debian/{liburing1.symbols => liburing2.symbols} (97%)

Range-diff against v1:

1:  d3d6028 = 1:  bc20a43 make-debs: fix version detection
2:  49d995f ! 2:  c61015a debian: avoid prompting package builder for signature

@@ Commit message
them locally on a development system which may not have private keys.

+ While "debuild -us -uc" could also be used to avoid signatures,
+ using "UNRELEASED" also helps communicate to changelog readers
+ that the package(s) are not from an official Debian source.
+
AFAIK the official Debian package is maintained separately at
<https://git.hadrons.org/git/debian/pkgs/liburing.git>,
and won't be affected by this change.
3: 2774a5e ! 3: 8a10758 debian/rules: fix for newer debhelper

    @@ Commit message
     
         Reading the current dh_makeshlibs(1) manpage reveals --add-udeb
         is nowadays implicit as of debhelper 12.3 and no longer
    -    necessary.  Compatibility with Debian oldstable (buster) remains
    -    intact.  Tested with debhelper 12.1.1 on Debian 10.x (buster)
    -    and debhelper 13.3.4 on Debian 11.x (bullseye).
    +    necessary.  Compatibility with older debhelper on Debian
    +    oldstable (buster) remains intact.  Tested with debhelper 12.1.1
    +    on Debian 10.x (buster) and debhelper 13.3.4 on Debian 11.x
    +    (bullseye).
     
         Signed-off-by: Eric Wong <[email protected]>
     
    @@ debian/rules: binary-arch: install-arch
      	dh_fixperms -a
     -	dh_makeshlibs -a --add-udeb '$(libudeb)'
     +
    -+# --add-udeb is needed for <= 12.3, and breaks with auto-detection
    ++# --add-udeb is needed for < 12.3, and breaks with auto-detection
     +#  on debhelper 13.3.4, at least
     +	if perl -MDebian::Debhelper::Dh_Version -e \
    -+	'exit(eval("v$$Debian::Debhelper::Dh_Version::version") le v12.3)'; \
    ++	'exit(eval("v$$Debian::Debhelper::Dh_Version::version") lt v12.3)'; \
     +		then dh_makeshlibs -a; else \
     +		dh_makeshlibs -a --add-udeb '$(libudeb)'; fi
     +
4:  cbc950c = 4:  ca43b96 debian/rules: support parallel build
-:  ------- > 5:  c33d422 debian: rename package to liburing2 to match .so version
-:  ------- > 6:  9e27918 make-debs: use version from RPM .spec
-:  ------- > 7:  bbc1200 make-debs: remove dependency on git
author
#12 lore raw

PATCH v2 1/7 make-debs: fix version detection

`head -l' is not supported on my version of head(1) on Debian buster nor bullseye (and AFAIK, not any version of head(1). Furthermore, head(1) is not required at all since sed(1) can limit operations to any line.

Since this is a bash script, we'll also use "set -o pipefail" to ensure future errors of this type are caught.

---
 make-debs.sh | 3 ++-
 1 file changed, 2 insertions(+), 1 deletion(-)
make-debs.sh +2 -1
index 01d563c..136b79e 100755
@@ -16,6 +16,7 @@
 # along with this program.  If not, see <http://www.gnu.org/licenses/>.
 #
 set -xe
+set -o pipefail
 
 # Create dir for build
 base=${1:-/tmp/release}
@@ -38,7 +39,7 @@ cd ${releasedir}/${outfile}
 git clean -dxf
 
 # Change changelog if it's needed
-cur_ver=`head -l debian/changelog | sed -n -e 's/.* (\(.*\)) .*/\1/p'`
+cur_ver=$(sed -n -e '1s/.* (\(.*\)) .*/\1/p' debian/changelog)
 if [ "$cur_ver" != "$version-1" ]; then
 	dch -D $codename --force-distribution -b -v "$version-1" "new version"
 fi
author
#13 lore raw

PATCH v2 2/7 debian: avoid prompting package builder for signature

In reply to Eric Wong

By setting the distribution to "UNRELEASED", debuild(1) will no longer prompt users to sign the package(s). I expect most users building these Debian packages with make-debs.sh will be using them locally on a development system which may not have private keys.

While "debuild -us -uc" could also be used to avoid signatures, using "UNRELEASED" also helps communicate to changelog readers that the package(s) are not from an official Debian source.

AFAIK the official Debian package is maintained separately at
<https://git.hadrons.org/git/debian/pkgs/liburing.git>,
and won't be affected by this change.

---
 debian/changelog | 6 ++++++
 make-debs.sh     | 5 ++++-
 2 files changed, 10 insertions(+), 1 deletion(-)
debian/changelog +6 -0
index f0032e3..fbc361b 100644
@@ -1,3 +1,9 @@
+liburing (2.0-1) UNRELEASED; urgency=low
+
+  * development package built for local use
+
+ -- Local User <[email protected]>  Tue, 16 Nov 2021 18:04:09 +0000
+
 liburing (0.7-1) stable; urgency=low
 
   * Update to 0.7
make-debs.sh +4 -1
index 136b79e..aea05f0 100755
@@ -20,7 +20,10 @@ set -o pipefail
 
 # Create dir for build
 base=${1:-/tmp/release}
-codename=$(lsb_release -sc)
+
+# UNRELEASED here means debuild won't prompt for signing
+codename=UNRELEASED
+
 releasedir=$base/$(lsb_release -si)/liburing
 rm -rf $releasedir
 mkdir -p $releasedir
author
#14 lore raw

PATCH v2 3/7 debian/rules: fix for newer debhelper

In reply to Eric Wong

When testing on my Debian 11.x (stable) system, --add-udeb causes the following build error:

dh_makeshlibs: error: The udeb liburing1-udeb does not contain any shared librar ies but --add-udeb=liburing1-udeb was passed!?
make: *** [debian/rules:82: binary-arch] Error 255

Reading the current dh_makeshlibs(1) manpage reveals --add-udeb is nowadays implicit as of debhelper 12.3 and no longer necessary. Compatibility with older debhelper on Debian oldstable (buster) remains intact. Tested with debhelper 12.1.1 on Debian 10.x (buster) and debhelper 13.3.4 on Debian 11.x (bullseye).

---
 debian/rules | 9 ++++++++-
 1 file changed, 8 insertions(+), 1 deletion(-)
debian/rules +8 -1
index 1a334b3..fe90606 100755
@@ -70,7 +70,14 @@ binary-arch: install-arch
 	dh_strip -a --ddeb-migration='$(libdbg) (<< 0.3)'
 	dh_compress -a
 	dh_fixperms -a
-	dh_makeshlibs -a --add-udeb '$(libudeb)'
+
+# --add-udeb is needed for < 12.3, and breaks with auto-detection
+#  on debhelper 13.3.4, at least
+	if perl -MDebian::Debhelper::Dh_Version -e \
+	'exit(eval("v$$Debian::Debhelper::Dh_Version::version") lt v12.3)'; \
+		then dh_makeshlibs -a; else \
+		dh_makeshlibs -a --add-udeb '$(libudeb)'; fi
+
 	dh_shlibdeps -a
 	dh_installdeb -a
 	dh_gencontrol -a
#15 lore raw

Re: [PATCH v2 3/7] debian/rules: fix for newer debhelper

Am 18.11.21 um 04:10 schrieb Eric Wong:

Quoted 26 lines

When testing on my Debian 11.x (stable) system, --add-udeb causes the following build error:

dh_makeshlibs: error: The udeb liburing1-udeb does not contain any shared librar ies but --add-udeb=liburing1-udeb was passed!?
make: *** [debian/rules:82: binary-arch] Error 255

Reading the current dh_makeshlibs(1) manpage reveals --add-udeb is nowadays implicit as of debhelper 12.3 and no longer necessary. Compatibility with older debhelper on Debian oldstable (buster) remains intact. Tested with debhelper 12.1.1 on Debian 10.x (buster) and debhelper 13.3.4 on Debian 11.x (bullseye).

---
 debian/rules | 9 ++++++++-
 1 file changed, 8 insertions(+), 1 deletion(-)
debian/rules +0 -0
index 1a334b3..fe90606 100755
@@ -70,7 +70,14 @@ binary-arch: install-arch
 	dh_strip -a --ddeb-migration='$(libdbg) (<< 0.3)'
 	dh_compress -a

debian/rules binary-arch: install-arch · line 80

Quoted 10 lines
debian/rules +8 -1
 	dh_fixperms -a
-	dh_makeshlibs -a --add-udeb '$(libudeb)'
+
+# --add-udeb is needed for < 12.3, and breaks with auto-detection
+#  on debhelper 13.3.4, at least
+	if perl -MDebian::Debhelper::Dh_Version -e \
+	'exit(eval("v$$Debian::Debhelper::Dh_Version::version") lt v12.3)'; \
+		then dh_makeshlibs -a; else \
+		dh_makeshlibs -a --add-udeb '$(libudeb)'; fi
+

I have this:

$ lsb_release -a
No LSB modules are available.
Distributor ID: Ubuntu
Description:    Ubuntu 20.04.3 LTS
Release:        20.04
Codename:       focal
$ perl -MDebian::Debhelper::Dh_Version -e 'print "$Debian::Debhelper::Dh_Version::version\n";'
12.10ubuntu1

and it needs the --add-udeb argument.

So this still fails for me.

metze

author
#16 lore raw

Re: [PATCH v2 3/7] debian/rules: fix for newer debhelper

Quoted 11 lines · Stefan Metzmacher

I have this:

$ lsb_release -a
No LSB modules are available.
Distributor ID: Ubuntu
Description:    Ubuntu 20.04.3 LTS
Release:        20.04
Codename:       focal
$ perl -MDebian::Debhelper::Dh_Version -e 'print "$Debian::Debhelper::Dh_Version::version\n";'
12.10ubuntu1
Quoted 3 lines

and it needs the --add-udeb argument.

So this still fails for me.

Ah, so the "ubuntu1" is causing the Perl version-string comparison to fail. It should only be checking "v12.10"...

Does squashing this in help?

debian/rules +2 -1
index cd41bb8..73f53fe 100755
@@ -84,7 +84,8 @@ binary-arch: install-arch
 # --add-udeb is needed for < 12.3, and breaks with auto-detection
 #  on debhelper 13.3.4, at least
 	if perl -MDebian::Debhelper::Dh_Version -e \
-	'exit(eval("v$$Debian::Debhelper::Dh_Version::version") lt v12.3)'; \
+	'($$v) = ($$Debian::Debhelper::Dh_Version::version =~ /\A([\d\.]+)/)' \
+	-e 'exit(eval("v$$v") lt v12.3)'; \
 		then dh_makeshlibs -a; else \
 		dh_makeshlibs -a --add-udeb '$(libudeb)'; fi
 

Also, just to confirm, does your dh_makeshlibs(1) manpage have this?:

Since debhelper 12.3, dh_makeshlibs will by default add an additional udeb line for udebs in the shlibs file, when the udeb has the same name as the deb followed by a "-udeb" suffix (e.g. if the deb is called "libfoo1", then debhelper will auto-detect the udeb if it is named "libfoo1-udeb"). Please use the --add-udeb and --no-add-udeb options below when this auto-detection is insufficient.

author
#17 lore raw

Re: [PATCH v2 3/7] debian/rules: fix for newer debhelper

Quoted 1 line · Eric Wong

Does squashing this in help?

Sorry, I missed a semi-colon and temporarily lost connectivity to my bullseye machine :x Tested on both bullseye and buster, now

debian/rules +2 -1
index cd41bb8..d0b4eea 100755
@@ -84,7 +84,8 @@ binary-arch: install-arch
 # --add-udeb is needed for < 12.3, and breaks with auto-detection
 #  on debhelper 13.3.4, at least
 	if perl -MDebian::Debhelper::Dh_Version -e \
-	'exit(eval("v$$Debian::Debhelper::Dh_Version::version") lt v12.3)'; \
+	'($$v) = ($$Debian::Debhelper::Dh_Version::version =~ /\A([\d\.]+)/);' \
+	-e 'exit(eval("v$$v") lt v12.3)'; \
 		then dh_makeshlibs -a; else \
 		dh_makeshlibs -a --add-udeb '$(libudeb)'; fi
 
#18 lore raw

Re: [PATCH v2 3/7] debian/rules: fix for newer debhelper

Hi Eric,

Quoted 8 lines

Sorry, I missed a semi-colon and temporarily lost connectivity to my bullseye machine :x Tested on both bullseye and buster, now

debian/rules +0 -0
index cd41bb8..d0b4eea 100755

debian/rules binary-arch: install-arch · line 91

Quoted 9 lines
debian/rules +2 -1
@@ -84,7 +84,8 @@ binary-arch: install-arch
 # --add-udeb is needed for < 12.3, and breaks with auto-detection
 #  on debhelper 13.3.4, at least
 	if perl -MDebian::Debhelper::Dh_Version -e \
-	'exit(eval("v$$Debian::Debhelper::Dh_Version::version") lt v12.3)'; \
+	'($$v) = ($$Debian::Debhelper::Dh_Version::version =~ /\A([\d\.]+)/);' \
+	-e 'exit(eval("v$$v") lt v12.3)'; \
 		then dh_makeshlibs -a; else \
 		dh_makeshlibs -a --add-udeb '$(libudeb)'; fi
 

That seems to work, thanks!

metze

author
#19 lore raw

PATCH v2 4/7 debian/rules: support parallel build

In reply to Eric Wong

This bit stolen from the debian/rules file of `git' speeds up builds from ~35s to ~10s for me.

---
 debian/rules | 10 ++++++++++
 1 file changed, 10 insertions(+)
debian/rules +10 -0
index fe90606..221657d 100755
@@ -9,6 +9,16 @@ DEB_CFLAGS_MAINT_PREPEND = -Wall
 include /usr/share/dpkg/default.mk
 include /usr/share/dpkg/buildtools.mk
 
+# taken from the debian/rules of src:git
+ifneq (,$(filter parallel=%,$(DEB_BUILD_OPTIONS)))
+  NUMJOBS = $(patsubst parallel=%,%,$(filter parallel=%,$(DEB_BUILD_OPTIONS)))
+  MAKEFLAGS += -j$(NUMJOBS)
+  # Setting this with a pattern-specific rule prevents -O from
+  # affecting the top-level make, which would break realtime build
+  # output (unless dh is run as +dh, which causes other problems).
+  %: MAKEFLAGS += -O
+endif
+
 export CC
 
 lib := liburing1
author
#20 lore raw

PATCH v2 5/7 debian: rename package to liburing2 to match .so version

In reply to Eric Wong
---
 debian/control                                            | 6 +++---
 debian/{liburing1-udeb.install => liburing2-udeb.install} | 0
 debian/{liburing1.install => liburing2.install}           | 0
 debian/{liburing1.symbols => liburing2.symbols}           | 2 +-
 debian/rules                                              | 2 +-
 5 files changed, 5 insertions(+), 5 deletions(-)
 rename debian/{liburing1-udeb.install => liburing2-udeb.install} (100%)
 rename debian/{liburing1.install => liburing2.install} (100%)
 rename debian/{liburing1.symbols => liburing2.symbols} (97%)
debian/control +3 -3
index 831a314..afce9b1 100644
@@ -8,7 +8,7 @@ Homepage: https://git.kernel.dk/cgit/liburing/tree/README
 Vcs-Git: https://git.kernel.dk/liburing
 Vcs-Browser: https://git.kernel.dk/cgit/liburing/
 
-Package: liburing1
+Package: liburing2
 Architecture: linux-any
 Multi-Arch: same
 Pre-Depends: ${misc:Pre-Depends}
@@ -21,7 +21,7 @@ Description: userspace library for using io_uring
  .
  This package contains the shared library.
 
-Package: liburing1-udeb
+Package: liburing2-udeb
 Package-Type: udeb
 Section: debian-installer
 Architecture: linux-any
@@ -38,7 +38,7 @@ Package: liburing-dev
 Section: libdevel
 Architecture: linux-any
 Multi-Arch: same
-Depends: ${misc:Depends}, liburing1 (= ${binary:Version}),
+Depends: ${misc:Depends}, liburing2 (= ${binary:Version}),
 Description: userspace library for using io_uring
  io_uring is kernel feature to improve development
  The newese Linux IO interface, io_uring could improve
debian/liburing2-udeb.install renamed from debian/liburing1-udeb.install +0 -0
similarity index 100%
rename from debian/liburing1-udeb.install
rename to debian/liburing2-udeb.install
debian/liburing2.install renamed from debian/liburing1.install +0 -0
similarity index 100%
rename from debian/liburing1.install
rename to debian/liburing2.install
debian/liburing2.symbols renamed from debian/liburing1.symbols +1 -1
similarity index 97%
rename from debian/liburing1.symbols
rename to debian/liburing2.symbols
index 29109f2..5bb203f 100644
@@ -1,4 +1,4 @@
-liburing.so.1 liburing1 #MINVER#
+liburing.so.2 liburing2 #MINVER#
  (symver)LIBURING_0.1 0.1-1
  io_uring_get_sqe@LIBURING_0.1 0.1-1
  io_uring_queue_exit@LIBURING_0.1 0.1-1
debian/rules +1 -1
index 221657d..cd41bb8 100755
@@ -21,7 +21,7 @@ endif
 
 export CC
 
-lib := liburing1
+lib := liburing2
 libdbg := $(lib)-dbg
 libudeb := $(lib)-udeb
 libdev := liburing-dev
author
#21 lore raw

PATCH v2 6/7 make-debs: use version from RPM .spec

In reply to Eric Wong

git tags may be behind the .spec file during development, so favor the .spec file as in commit c0b43df28a982747 (src/Makefile: use VERSION variable consistently, 2021-11-15). This brings us one step closer to being able to build Debian packages without git.

---
 Makefile     | 5 ++++-
 make-debs.sh | 2 +-
 2 files changed, 5 insertions(+), 2 deletions(-)
Makefile +4 -1
index 28c0fd8..48fb48a 100644
@@ -11,7 +11,10 @@ all:
 	@$(MAKE) -C test
 	@$(MAKE) -C examples
 
-.PHONY: all install default clean test
+print-version:
+	@echo $(VERSION)
+
+.PHONY: all install default clean test print-version
 .PHONY: FORCE cscope
 
 partcheck: all
make-debs.sh +1 -1
index aea05f0..0913c47 100755
@@ -32,7 +32,7 @@ src_dir=$(readlink -e `basename $0`)
 liburing_dir=$(dirname $src_dir)
 basename=$(basename $liburing_dir)
 dirname=$(dirname $liburing_dir)
-version=$(git describe --match "lib*" | cut -d '-' -f 2)
+version=$(make print-version | tail -n1)
 outfile="liburing-$version"
 orgfile=$(echo $outfile | tr '-' '_')
 
author
#22 lore raw

PATCH v2 7/7 make-debs: remove dependency on git

In reply to Eric Wong

This allows building Debian packages from future release tarballs which lack a .git directory. Also, fix a spelling error while we're at it.

---
 make-debs.sh | 9 +++++++--
 1 file changed, 7 insertions(+), 2 deletions(-)
make-debs.sh +7 -2
index 0913c47..867612b 100755
@@ -39,7 +39,12 @@ orgfile=$(echo $outfile | tr '-' '_')
 # Prepare source code
 cp -arf ${dirname}/${basename} ${releasedir}/${outfile}
 cd ${releasedir}/${outfile}
-git clean -dxf
+if git clean -dxf
+then
+	rm -rf .git
+else # building from unpacked tarball
+	make clean
+fi
 
 # Change changelog if it's needed
 cur_ver=$(sed -n -e '1s/.* (\(.*\)) .*/\1/p' debian/changelog)
@@ -47,7 +52,7 @@ if [ "$cur_ver" != "$version-1" ]; then
 	dch -D $codename --force-distribution -b -v "$version-1" "new version"
 fi
 
-# Create tar archieve
+# Create tar archive
 cd ../
 tar cvzf ${outfile}.tar.gz ${outfile}
 ln -s ${outfile}.tar.gz ${orgfile}.orig.tar.gz
author
#23 lore raw

[PATCHv2 8/7] debian/rules: fix version comparison for Ubuntu

In reply to Eric Wong

Perl version strings do not accept values such as "12.10ubuntu1", so only compare the digits and "." parts at the beginning.

---
 debian/rules | 3 ++-
 1 file changed, 2 insertions(+), 1 deletion(-)
debian/rules +2 -1
index cd41bb8..d0b4eea 100755
@@ -84,7 +84,8 @@ binary-arch: install-arch
 # --add-udeb is needed for < 12.3, and breaks with auto-detection
 #  on debhelper 13.3.4, at least
 	if perl -MDebian::Debhelper::Dh_Version -e \
-	'exit(eval("v$$Debian::Debhelper::Dh_Version::version") lt v12.3)'; \
+	'($$v) = ($$Debian::Debhelper::Dh_Version::version =~ /\A([\d\.]+)/);' \
+	-e 'exit(eval("v$$v") lt v12.3)'; \
 		then dh_makeshlibs -a; else \
 		dh_makeshlibs -a --add-udeb '$(libudeb)'; fi
 
author
#24 lore raw

v3 cover liburing debian packaging fixes

In reply to Eric Wong

The previous patch 8/7 in v2 is squashed into 3/7 in this series. Apologies for the delay since v2, many bad things happened :<

The following changes since commit bbcaabf808b53ef11ad9851c6b968140fb430500:

man/io_uring_enter.2: make it clear that chains terminate at submit (2022-01-19 18:09:40 -0700)

are available in the Git repository at:

https://yhbt.net/liburing.git deb-v3

for you to fetch changes up to 77b99bb1dbe237eef38eceb313501a9fd247d672:

make-debs: remove dependency on git (2022-01-21 16:54:42 +0000)

----------------------------------------------------------------
Eric Wong (7):
make-debs: fix version detection
debian: avoid prompting package builder for signature debian/rules: fix for newer debhelper debian/rules: support parallel build
debian: rename package to liburing2 to match .so version
make-debs: use version from RPM .spec
make-debs: remove dependency on git

 Makefile                                           |  5 ++++-
 debian/changelog                                   |  6 ++++++
 debian/control                                     |  6 +++---
 ...buring1-udeb.install => liburing2-udeb.install} |  0
 debian/{liburing1.install => liburing2.install}    |  0
 debian/{liburing1.symbols => liburing2.symbols}    |  2 +-
 debian/rules                                       | 22 ++++++++++++++++++++--
 make-debs.sh                                       | 19 ++++++++++++++-----
 8 files changed, 48 insertions(+), 12 deletions(-)
 rename debian/{liburing1-udeb.install => liburing2-udeb.install} (100%)
 rename debian/{liburing1.install => liburing2.install} (100%)
 rename debian/{liburing1.symbols => liburing2.symbols} (97%)
author
#25 lore raw

PATCH v3 1/7 make-debs: fix version detection

`head -l' is not supported on my version of head(1) on Debian buster nor bullseye (and AFAIK, not any version of head(1)). Furthermore, head(1) is not required at all since sed(1) can limit operations to any line.

Since this is a bash script, we'll also use "set -o pipefail" to ensure future errors of this type are caught.

---
 make-debs.sh | 3 ++-
 1 file changed, 2 insertions(+), 1 deletion(-)
make-debs.sh +2 -1
index 01d563c..136b79e 100755
@@ -16,6 +16,7 @@
 # along with this program.  If not, see <http://www.gnu.org/licenses/>.
 #
 set -xe
+set -o pipefail
 
 # Create dir for build
 base=${1:-/tmp/release}
@@ -38,7 +39,7 @@ cd ${releasedir}/${outfile}
 git clean -dxf
 
 # Change changelog if it's needed
-cur_ver=`head -l debian/changelog | sed -n -e 's/.* (\(.*\)) .*/\1/p'`
+cur_ver=$(sed -n -e '1s/.* (\(.*\)) .*/\1/p' debian/changelog)
 if [ "$cur_ver" != "$version-1" ]; then
 	dch -D $codename --force-distribution -b -v "$version-1" "new version"
 fi
author
#26 lore raw

PATCH v3 2/7 debian: avoid prompting package builder for signature

In reply to Eric Wong

By setting the distribution to "UNRELEASED", debuild(1) will no longer prompt users to sign the package(s). I expect most users building these Debian packages with make-debs.sh will be using them locally on a development system which may not have private keys.

While "debuild -us -uc" could also be used to avoid signatures, using "UNRELEASED" also helps communicate to changelog readers that the package(s) are not from an official Debian source.

AFAIK the official Debian package is maintained separately at
<https://git.hadrons.org/git/debian/pkgs/liburing.git>,
and won't be affected by this change.

---
 debian/changelog | 6 ++++++
 make-debs.sh     | 5 ++++-
 2 files changed, 10 insertions(+), 1 deletion(-)
debian/changelog +6 -0
index f0032e3..fbc361b 100644
@@ -1,3 +1,9 @@
+liburing (2.0-1) UNRELEASED; urgency=low
+
+  * development package built for local use
+
+ -- Local User <[email protected]>  Tue, 16 Nov 2021 18:04:09 +0000
+
 liburing (0.7-1) stable; urgency=low
 
   * Update to 0.7
make-debs.sh +4 -1
index 136b79e..aea05f0 100755
@@ -20,7 +20,10 @@ set -o pipefail
 
 # Create dir for build
 base=${1:-/tmp/release}
-codename=$(lsb_release -sc)
+
+# UNRELEASED here means debuild won't prompt for signing
+codename=UNRELEASED
+
 releasedir=$base/$(lsb_release -si)/liburing
 rm -rf $releasedir
 mkdir -p $releasedir
author
#27 lore raw

PATCH v3 3/7 debian/rules: fix for newer debhelper

In reply to Eric Wong

When testing on my Debian 11.x (stable) system, --add-udeb causes the following build error:

dh_makeshlibs: error: The udeb liburing1-udeb does not contain any shared libraries but --add-udeb=liburing1-udeb was passed!?
make: *** [debian/rules:82: binary-arch] Error 255

Reading the current dh_makeshlibs(1) manpage reveals --add-udeb is nowadays implicit as of debhelper 12.3 and no longer necessary. Compatibility with older debhelper on Debian oldstable (buster) remains intact. Tested with debhelper 12.1.1 on Debian 10.x (buster) and debhelper 13.3.4 on Debian 11.x (bullseye). Ubuntu was tested by Stefan since its version strings contain non-numeric values (e.g. "12.10ubuntu1")

---
 debian/rules | 10 +++++++++-
 1 file changed, 9 insertions(+), 1 deletion(-)
debian/rules +9 -1
index 1a334b3..6631b10 100755
@@ -70,7 +70,15 @@ binary-arch: install-arch
 	dh_strip -a --ddeb-migration='$(libdbg) (<< 0.3)'
 	dh_compress -a
 	dh_fixperms -a
-	dh_makeshlibs -a --add-udeb '$(libudeb)'
+
+# --add-udeb is needed for < 12.3, and breaks with auto-detection
+#  on debhelper 13.3.4, at least
+	if perl -MDebian::Debhelper::Dh_Version -e \
+	'($$v) = ($$Debian::Debhelper::Dh_Version::version =~ /\A([\d\.]+)/);' \
+	-e 'exit(eval("v$$v") lt v12.3)'; \
+		then dh_makeshlibs -a; else \
+		dh_makeshlibs -a --add-udeb '$(libudeb)'; fi
+
 	dh_shlibdeps -a
 	dh_installdeb -a
 	dh_gencontrol -a
author
#28 lore raw

PATCH v3 4/7 debian/rules: support parallel build

In reply to Eric Wong

This bit stolen from the debian/rules file of `git' speeds up builds from ~35s to ~10s for me.

---
 debian/rules | 10 ++++++++++
 1 file changed, 10 insertions(+)
debian/rules +10 -0
index 6631b10..f26271e 100755
@@ -9,6 +9,16 @@ DEB_CFLAGS_MAINT_PREPEND = -Wall
 include /usr/share/dpkg/default.mk
 include /usr/share/dpkg/buildtools.mk
 
+# taken from the debian/rules of src:git
+ifneq (,$(filter parallel=%,$(DEB_BUILD_OPTIONS)))
+  NUMJOBS = $(patsubst parallel=%,%,$(filter parallel=%,$(DEB_BUILD_OPTIONS)))
+  MAKEFLAGS += -j$(NUMJOBS)
+  # Setting this with a pattern-specific rule prevents -O from
+  # affecting the top-level make, which would break realtime build
+  # output (unless dh is run as +dh, which causes other problems).
+  %: MAKEFLAGS += -O
+endif
+
 export CC
 
 lib := liburing1
author
#29 lore raw

PATCH v3 5/7 debian: rename package to liburing2 to match .so version

In reply to Eric Wong
---
 debian/control                                            | 6 +++---
 debian/{liburing1-udeb.install => liburing2-udeb.install} | 0
 debian/{liburing1.install => liburing2.install}           | 0
 debian/{liburing1.symbols => liburing2.symbols}           | 2 +-
 debian/rules                                              | 2 +-
 5 files changed, 5 insertions(+), 5 deletions(-)
 rename debian/{liburing1-udeb.install => liburing2-udeb.install} (100%)
 rename debian/{liburing1.install => liburing2.install} (100%)
 rename debian/{liburing1.symbols => liburing2.symbols} (97%)
debian/control +3 -3
index 831a314..afce9b1 100644
@@ -8,7 +8,7 @@ Homepage: https://git.kernel.dk/cgit/liburing/tree/README
 Vcs-Git: https://git.kernel.dk/liburing
 Vcs-Browser: https://git.kernel.dk/cgit/liburing/
 
-Package: liburing1
+Package: liburing2
 Architecture: linux-any
 Multi-Arch: same
 Pre-Depends: ${misc:Pre-Depends}
@@ -21,7 +21,7 @@ Description: userspace library for using io_uring
  .
  This package contains the shared library.
 
-Package: liburing1-udeb
+Package: liburing2-udeb
 Package-Type: udeb
 Section: debian-installer
 Architecture: linux-any
@@ -38,7 +38,7 @@ Package: liburing-dev
 Section: libdevel
 Architecture: linux-any
 Multi-Arch: same
-Depends: ${misc:Depends}, liburing1 (= ${binary:Version}),
+Depends: ${misc:Depends}, liburing2 (= ${binary:Version}),
 Description: userspace library for using io_uring
  io_uring is kernel feature to improve development
  The newese Linux IO interface, io_uring could improve
debian/liburing2-udeb.install renamed from debian/liburing1-udeb.install +0 -0
similarity index 100%
rename from debian/liburing1-udeb.install
rename to debian/liburing2-udeb.install
debian/liburing2.install renamed from debian/liburing1.install +0 -0
similarity index 100%
rename from debian/liburing1.install
rename to debian/liburing2.install
debian/liburing2.symbols renamed from debian/liburing1.symbols +1 -1
similarity index 97%
rename from debian/liburing1.symbols
rename to debian/liburing2.symbols
index 29109f2..5bb203f 100644
@@ -1,4 +1,4 @@
-liburing.so.1 liburing1 #MINVER#
+liburing.so.2 liburing2 #MINVER#
  (symver)LIBURING_0.1 0.1-1
  io_uring_get_sqe@LIBURING_0.1 0.1-1
  io_uring_queue_exit@LIBURING_0.1 0.1-1
debian/rules +1 -1
index f26271e..d0b4eea 100755
@@ -21,7 +21,7 @@ endif
 
 export CC
 
-lib := liburing1
+lib := liburing2
 libdbg := $(lib)-dbg
 libudeb := $(lib)-udeb
 libdev := liburing-dev
author
#30 lore raw

PATCH v3 6/7 make-debs: use version from RPM .spec

In reply to Eric Wong

git tags may be behind the .spec file during development, so favor the .spec file as in commit c0b43df28a982747 (src/Makefile: use VERSION variable consistently, 2021-11-15). This brings us one step closer to being able to build Debian packages without git.

---
 Makefile     | 5 ++++-
 make-debs.sh | 2 +-
 2 files changed, 5 insertions(+), 2 deletions(-)
Makefile +4 -1
index 28c0fd8..48fb48a 100644
@@ -11,7 +11,10 @@ all:
 	@$(MAKE) -C test
 	@$(MAKE) -C examples
 
-.PHONY: all install default clean test
+print-version:
+	@echo $(VERSION)
+
+.PHONY: all install default clean test print-version
 .PHONY: FORCE cscope
 
 partcheck: all
make-debs.sh +1 -1
index aea05f0..0913c47 100755
@@ -32,7 +32,7 @@ src_dir=$(readlink -e `basename $0`)
 liburing_dir=$(dirname $src_dir)
 basename=$(basename $liburing_dir)
 dirname=$(dirname $liburing_dir)
-version=$(git describe --match "lib*" | cut -d '-' -f 2)
+version=$(make print-version | tail -n1)
 outfile="liburing-$version"
 orgfile=$(echo $outfile | tr '-' '_')
 
author
#31 lore raw

PATCH v3 7/7 make-debs: remove dependency on git

In reply to Eric Wong

This allows building Debian packages from future release tarballs which lack a .git directory. Also, fix a spelling error while we're at it.

---
 make-debs.sh | 9 +++++++--
 1 file changed, 7 insertions(+), 2 deletions(-)
make-debs.sh +7 -2
index 0913c47..867612b 100755
@@ -39,7 +39,12 @@ orgfile=$(echo $outfile | tr '-' '_')
 # Prepare source code
 cp -arf ${dirname}/${basename} ${releasedir}/${outfile}
 cd ${releasedir}/${outfile}
-git clean -dxf
+if git clean -dxf
+then
+	rm -rf .git
+else # building from unpacked tarball
+	make clean
+fi
 
 # Change changelog if it's needed
 cur_ver=$(sed -n -e '1s/.* (\(.*\)) .*/\1/p' debian/changelog)
@@ -47,7 +52,7 @@ if [ "$cur_ver" != "$version-1" ]; then
 	dch -D $codename --force-distribution -b -v "$version-1" "new version"
 fi
 
-# Create tar archieve
+# Create tar archive
 cd ../
 tar cvzf ${outfile}.tar.gz ${outfile}
 ln -s ${outfile}.tar.gz ${orgfile}.orig.tar.gz
author
#32 lore raw

Re: [PULL|PATCH v3 0/7] liburing debian packaging fixes

In reply to Eric Wong
Quoted 7 lines · Eric Wong

The previous patch 8/7 in v2 is squashed into 3/7 in this series. Apologies for the delay since v2, many bad things happened :<

The following changes since commit bbcaabf808b53ef11ad9851c6b968140fb430500:

man/io_uring_enter.2: make it clear that chains terminate at submit (2022-01-19 18:09:40 -0700)

Quoted 7 lines

are available in the Git repository at:

https://yhbt.net/liburing.git deb-v3

for you to fetch changes up to 77b99bb1dbe237eef38eceb313501a9fd247d672:

make-debs: remove dependency on git (2022-01-21 16:54:42 +0000)

Hi Jens, have you had a chance to look at this series? Thanks. I mostly abandoned hacking for a few months :x

maintainer
#33 lore raw

Re: [PULL|PATCH v3 0/7] liburing debian packaging fixes

Quoted 10 lines · Eric Wong
Quoted 9 lines · Eric Wong

The previous patch 8/7 in v2 is squashed into 3/7 in this series. Apologies for the delay since v2, many bad things happened :<

The following changes since commit bbcaabf808b53ef11ad9851c6b968140fb430500:

man/io_uring_enter.2: make it clear that chains terminate at submit (2022-01-19 18:09:40 -0700)

are available in the Git repository at:

Quoted 8 lines
Quoted 5 lines

https://yhbt.net/liburing.git deb-v3

for you to fetch changes up to 77b99bb1dbe237eef38eceb313501a9fd247d672:

make-debs: remove dependency on git (2022-01-21 16:54:42 +0000)

Hi Jens, have you had a chance to look at this series? Thanks. I mostly abandoned hacking for a few months :x

I never build distro packages and know very little about it, so would really like Stefan et al to sign off on this. I'm about to cut the next version of liburing, and would indeed be great to have better packaging sorted before that.

Does it still apply to the curren tree?

Signature · 1 line
Jens Axboe
author
#34 lore raw

Re: [PULL|PATCH v3 0/7] liburing debian packaging fixes

Quoted 4 lines · Jens Axboe

I never build distro packages and know very little about it, so would really like Stefan et al to sign off on this. I'm about to cut the next version of liburing, and would indeed be great to have better packaging sorted before that.

Thanks for the response, awaiting Stefan.

Quoted 1 line

Does it still apply to the curren tree?

Yes :>

#35 lore raw

Re: [PULL|PATCH v3 0/7] liburing debian packaging fixes

In reply to Jens Axboe

Am 03.04.22 um 16:54 schrieb Jens Axboe:

Quoted 20 lines · Eric Wong
Quoted 10 lines
Quoted 9 lines · Eric Wong

The previous patch 8/7 in v2 is squashed into 3/7 in this series. Apologies for the delay since v2, many bad things happened :<

The following changes since commit bbcaabf808b53ef11ad9851c6b968140fb430500:

man/io_uring_enter.2: make it clear that chains terminate at submit (2022-01-19 18:09:40 -0700)

are available in the Git repository at:

Quoted 8 lines
Quoted 5 lines

https://yhbt.net/liburing.git deb-v3

for you to fetch changes up to 77b99bb1dbe237eef38eceb313501a9fd247d672:

   make-debs: remove dependency on git (2022-01-21 16:54:42 +0000)

Hi Jens, have you had a chance to look at this series? Thanks. I mostly abandoned hacking for a few months :x

Quoted 6 lines

I never build distro packages and know very little about it, so would really like Stefan et al to sign off on this. I'm about to cut the next version of liburing, and would indeed be great to have better packaging sorted before that.

Does it still apply to the curren tree?

I rebased it on current master.

The last patch with this seems dangerous (from reading the diff):

-git clean -dxf
+if git clean -dxf
+then
+ rm -rf .git

I'd just .git

On ubuntu 22.04 I get this error:

make[1]: Verzeichnis „/tmp/release/Ubuntu/liburing/liburing-2.2“ wird verlassen dh_testdir
dh_testroot
dh_install -a
dh_install: warning: Compatibility levels before 10 are deprecated (level 9 in use)
dh_install: warning: Cannot find (any matches for) "lib/*/lib*.so.*" (tried in ., debian/tmp)

dh_install: warning: liburing2 missing files: lib/*/lib*.so.*
dh_install: warning: Cannot find (any matches for) "usr/include" (tried in ., debian/tmp)

dh_install: warning: liburing-dev missing files: usr/include
dh_install: warning: Cannot find (any matches for) "usr/lib/*/lib*.so" (tried in ., debian/tmp)

dh_install: warning: liburing-dev missing files: usr/lib/*/lib*.so
dh_install: warning: Cannot find (any matches for) "usr/lib/*/lib*.a" (tried in ., debian/tmp)

dh_install: warning: liburing-dev missing files: usr/lib/*/lib*.a
dh_install: error: missing files, aborting
make: *** [debian/rules:74: binary-arch] Fehler 25
dpkg-buildpackage: Fehler: Unterprozess debian/rules binary lieferte Exitstatus 2
debuild: fatal error at line 1182:
dpkg-buildpackage -us -uc -ui failed

metze

#36 lore raw

Re: [PULL|PATCH v3 0/7] liburing debian packaging fixes

Am 04.04.22 um 18:13 schrieb Stefan Metzmacher:

Quoted 58 lines

Am 03.04.22 um 16:54 schrieb Jens Axboe:

Quoted 20 lines · Eric Wong
Quoted 10 lines
Quoted 9 lines · Eric Wong

The previous patch 8/7 in v2 is squashed into 3/7 in this series. Apologies for the delay since v2, many bad things happened :<

The following changes since commit bbcaabf808b53ef11ad9851c6b968140fb430500:

   man/io_uring_enter.2: make it clear that chains terminate at submit (2022-01-19 18:09:40 -0700)

are available in the Git repository at:

Quoted 8 lines
Quoted 5 lines

   https://yhbt.net/liburing.git deb-v3

for you to fetch changes up to 77b99bb1dbe237eef38eceb313501a9fd247d672:

   make-debs: remove dependency on git (2022-01-21 16:54:42 +0000)

Hi Jens, have you had a chance to look at this series?  Thanks. I mostly abandoned hacking for a few months :x

Quoted 6 lines

I never build distro packages and know very little about it, so would really like Stefan et al to sign off on this. I'm about to cut the next version of liburing, and would indeed be great to have better packaging sorted before that.

Does it still apply to the curren tree?

I rebased it on current master.

The last patch with this seems dangerous (from reading the diff):

(quoted diff) +3 -1
-git clean -dxf
+if git clean -dxf
+then
+       rm -rf .git

I'd just .git

On ubuntu 22.04 I get this error:

make[1]: Verzeichnis „/tmp/release/Ubuntu/liburing/liburing-2.2“ wird verlassen dh_testdir
dh_testroot
dh_install -a
dh_install: warning: Compatibility levels before 10 are deprecated (level 9 in use)
dh_install: warning: Cannot find (any matches for) "lib/*/lib*.so.*" (tried in ., debian/tmp)

dh_install: warning: liburing2 missing files: lib/*/lib*.so.*
dh_install: warning: Cannot find (any matches for) "usr/include" (tried in ., debian/tmp)

dh_install: warning: liburing-dev missing files: usr/include
dh_install: warning: Cannot find (any matches for) "usr/lib/*/lib*.so" (tried in ., debian/tmp)

dh_install: warning: liburing-dev missing files: usr/lib/*/lib*.so
dh_install: warning: Cannot find (any matches for) "usr/lib/*/lib*.a" (tried in ., debian/tmp)

Quoted 6 lines

dh_install: warning: liburing-dev missing files: usr/lib/*/lib*.a
dh_install: error: missing files, aborting
make: *** [debian/rules:74: binary-arch] Fehler 25
dpkg-buildpackage: Fehler: Unterprozess debian/rules binary lieferte Exitstatus 2
debuild: fatal error at line 1182:
dpkg-buildpackage -us -uc -ui failed

I also found it changes the system path of the build host:

install -D -m 755 liburing.so.2.2 /lib/x86_64-linux-gnu/liburing.so.2.2 ln -sf liburing.so.2.2 /lib/x86_64-linux-gnu/liburing.so.2
ln -sf /lib/x86_64-linux-gnu/liburing.so.2.2 /usr/lib/x86_64-linux-gnu/liburing.so

This should use some $DESTDIR magic...

Maybe the DESTDIR handling is broken in general and the reason why I got the above errors...

metze