public inbox for [email protected]
 help / color / mirror / Atom feed
* [PATCH 0/4] liburing debian packaging fixes.
@ 2021-11-16 22:44 Eric Wong
  2021-11-16 22:44 ` [PATCH 1/4] make-debs: fix version detection Eric Wong
                   ` (5 more replies)
  0 siblings, 6 replies; 37+ messages in thread
From: Eric Wong @ 2021-11-16 22:44 UTC (permalink / raw)
  To: io-uring; +Cc: Liu Changcheng, Stefan Metzmacher

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(-)

^ permalink raw reply	[flat|nested] 37+ messages in thread

* [PATCH 1/4] make-debs: fix version detection
  2021-11-16 22:44 [PATCH 0/4] liburing debian packaging fixes Eric Wong
@ 2021-11-16 22:44 ` Eric Wong
  2021-11-17 10:17   ` Stefan Metzmacher
  2021-11-16 22:44 ` [PATCH 2/4] debian: avoid prompting package builder for signature Eric Wong
                   ` (4 subsequent siblings)
  5 siblings, 1 reply; 37+ messages in thread
From: Eric Wong @ 2021-11-16 22:44 UTC (permalink / raw)
  To: io-uring; +Cc: Liu Changcheng, Stefan Metzmacher

`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.

Signed-off-by: Eric Wong <[email protected]>
---
 make-debs.sh | 3 ++-
 1 file changed, 2 insertions(+), 1 deletion(-)

diff --git a/make-debs.sh b/make-debs.sh
index 01d563c..136b79e 100755
--- a/make-debs.sh
+++ b/make-debs.sh
@@ -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

^ permalink raw reply related	[flat|nested] 37+ messages in thread

* [PATCH 2/4] debian: avoid prompting package builder for signature
  2021-11-16 22:44 [PATCH 0/4] liburing debian packaging fixes Eric Wong
  2021-11-16 22:44 ` [PATCH 1/4] make-debs: fix version detection Eric Wong
@ 2021-11-16 22:44 ` Eric Wong
  2021-11-17 10:01   ` Stefan Metzmacher
  2021-11-16 22:44 ` [PATCH 3/4] debian/rules: fix for newer debhelper Eric Wong
                   ` (3 subsequent siblings)
  5 siblings, 1 reply; 37+ messages in thread
From: Eric Wong @ 2021-11-16 22:44 UTC (permalink / raw)
  To: io-uring; +Cc: Liu Changcheng, Stefan Metzmacher

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.

Signed-off-by: Eric Wong <[email protected]>
---
 debian/changelog | 6 ++++++
 make-debs.sh     | 5 ++++-
 2 files changed, 10 insertions(+), 1 deletion(-)

diff --git a/debian/changelog b/debian/changelog
index f0032e3..fbc361b 100644
--- a/debian/changelog
+++ b/debian/changelog
@@ -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
diff --git a/make-debs.sh b/make-debs.sh
index 136b79e..aea05f0 100755
--- a/make-debs.sh
+++ b/make-debs.sh
@@ -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

^ permalink raw reply related	[flat|nested] 37+ messages in thread

* [PATCH 3/4] debian/rules: fix for newer debhelper
  2021-11-16 22:44 [PATCH 0/4] liburing debian packaging fixes Eric Wong
  2021-11-16 22:44 ` [PATCH 1/4] make-debs: fix version detection Eric Wong
  2021-11-16 22:44 ` [PATCH 2/4] debian: avoid prompting package builder for signature Eric Wong
@ 2021-11-16 22:44 ` Eric Wong
  2021-11-17 10:04   ` Stefan Metzmacher
  2021-11-16 22:44 ` [PATCH 4/4] debian/rules: support parallel build Eric Wong
                   ` (2 subsequent siblings)
  5 siblings, 1 reply; 37+ messages in thread
From: Eric Wong @ 2021-11-16 22:44 UTC (permalink / raw)
  To: io-uring; +Cc: Liu Changcheng, Stefan Metzmacher

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).

Signed-off-by: Eric Wong <[email protected]>
---
 debian/rules | 9 ++++++++-
 1 file changed, 8 insertions(+), 1 deletion(-)

diff --git a/debian/rules b/debian/rules
index 1a334b3..2a0d563 100755
--- a/debian/rules
+++ b/debian/rules
@@ -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

^ permalink raw reply related	[flat|nested] 37+ messages in thread

* [PATCH 4/4] debian/rules: support parallel build
  2021-11-16 22:44 [PATCH 0/4] liburing debian packaging fixes Eric Wong
                   ` (2 preceding siblings ...)
  2021-11-16 22:44 ` [PATCH 3/4] debian/rules: fix for newer debhelper Eric Wong
@ 2021-11-16 22:44 ` Eric Wong
  2021-11-18  3:10 ` [PATCH v2 0/7] liburing debian packaging fixes Eric Wong
  2022-01-21 18:26 ` [PULL|PATCH v3 0/7] liburing debian packaging fixes Eric Wong
  5 siblings, 0 replies; 37+ messages in thread
From: Eric Wong @ 2021-11-16 22:44 UTC (permalink / raw)
  To: io-uring; +Cc: Liu Changcheng, Stefan Metzmacher

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

Signed-off-by: Eric Wong <[email protected]>
---
 debian/rules | 10 ++++++++++
 1 file changed, 10 insertions(+)

diff --git a/debian/rules b/debian/rules
index 2a0d563..4b58d90 100755
--- a/debian/rules
+++ b/debian/rules
@@ -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

^ permalink raw reply related	[flat|nested] 37+ messages in thread

* Re: [PATCH 2/4] debian: avoid prompting package builder for signature
  2021-11-16 22:44 ` [PATCH 2/4] debian: avoid prompting package builder for signature Eric Wong
@ 2021-11-17 10:01   ` Stefan Metzmacher
  2021-11-18  3:14     ` Eric Wong
  0 siblings, 1 reply; 37+ messages in thread
From: Stefan Metzmacher @ 2021-11-17 10:01 UTC (permalink / raw)
  To: Eric Wong, io-uring; +Cc: Liu Changcheng


[-- Attachment #1.1: Type: text/plain, Size: 671 bytes --]

Hi Eric,

> diff --git a/make-debs.sh b/make-debs.sh
> index 136b79e..aea05f0 100755
> --- a/make-debs.sh
> +++ b/make-debs.sh
> @@ -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

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



[-- Attachment #2: OpenPGP digital signature --]
[-- Type: application/pgp-signature, Size: 228 bytes --]

^ permalink raw reply	[flat|nested] 37+ messages in thread

* Re: [PATCH 3/4] debian/rules: fix for newer debhelper
  2021-11-16 22:44 ` [PATCH 3/4] debian/rules: fix for newer debhelper Eric Wong
@ 2021-11-17 10:04   ` Stefan Metzmacher
  2021-11-18  1:20     ` Eric Wong
  0 siblings, 1 reply; 37+ messages in thread
From: Stefan Metzmacher @ 2021-11-17 10:04 UTC (permalink / raw)
  To: Eric Wong, io-uring; +Cc: Liu Changcheng


[-- Attachment #1.1: Type: text/plain, Size: 1532 bytes --]

Hi Eric,

> 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).
> 
> Signed-off-by: Eric Wong <[email protected]>
> ---
>  debian/rules | 9 ++++++++-
>  1 file changed, 8 insertions(+), 1 deletion(-)
> 
> diff --git a/debian/rules b/debian/rules
> index 1a334b3..2a0d563 100755
> --- a/debian/rules
> +++ b/debian/rules
> @@ -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
> +

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


[-- Attachment #2: OpenPGP digital signature --]
[-- Type: application/pgp-signature, Size: 228 bytes --]

^ permalink raw reply	[flat|nested] 37+ messages in thread

* Re: [PATCH 1/4] make-debs: fix version detection
  2021-11-16 22:44 ` [PATCH 1/4] make-debs: fix version detection Eric Wong
@ 2021-11-17 10:17   ` Stefan Metzmacher
  2021-11-18  1:25     ` Eric Wong
  0 siblings, 1 reply; 37+ messages in thread
From: Stefan Metzmacher @ 2021-11-17 10:17 UTC (permalink / raw)
  To: Eric Wong, io-uring; +Cc: Liu Changcheng, Bikal Lem


[-- Attachment #1.1: Type: text/plain, Size: 1028 bytes --]


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.

    Signed-off-by: Bikal Lem <[email protected]>

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

metze


[-- Attachment #2: OpenPGP digital signature --]
[-- Type: application/pgp-signature, Size: 228 bytes --]

^ permalink raw reply	[flat|nested] 37+ messages in thread

* Re: [PATCH 3/4] debian/rules: fix for newer debhelper
  2021-11-17 10:04   ` Stefan Metzmacher
@ 2021-11-18  1:20     ` Eric Wong
  0 siblings, 0 replies; 37+ messages in thread
From: Eric Wong @ 2021-11-18  1:20 UTC (permalink / raw)
  To: Stefan Metzmacher; +Cc: io-uring, Liu Changcheng

Stefan Metzmacher <[email protected]> wrote:
> > +# --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.

^ permalink raw reply	[flat|nested] 37+ messages in thread

* Re: [PATCH 1/4] make-debs: fix version detection
  2021-11-17 10:17   ` Stefan Metzmacher
@ 2021-11-18  1:25     ` Eric Wong
  0 siblings, 0 replies; 37+ messages in thread
From: Eric Wong @ 2021-11-18  1:25 UTC (permalink / raw)
  To: Stefan Metzmacher; +Cc: io-uring, Liu Changcheng, Bikal Lem

Stefan Metzmacher <[email protected]> wrote:
> 
> 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.

> 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.

> 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.
> 
>     Signed-off-by: Bikal Lem <[email protected]>
> 
> 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)

^ permalink raw reply	[flat|nested] 37+ messages in thread

* [PATCH v2 0/7] liburing debian packaging fixes
  2021-11-16 22:44 [PATCH 0/4] liburing debian packaging fixes Eric Wong
                   ` (3 preceding siblings ...)
  2021-11-16 22:44 ` [PATCH 4/4] debian/rules: support parallel build Eric Wong
@ 2021-11-18  3:10 ` Eric Wong
  2021-11-18  3:10   ` [PATCH v2 1/7] make-debs: fix version detection Eric Wong
                     ` (7 more replies)
  2022-01-21 18:26 ` [PULL|PATCH v3 0/7] liburing debian packaging fixes Eric Wong
  5 siblings, 8 replies; 37+ messages in thread
From: Eric Wong @ 2021-11-18  3:10 UTC (permalink / raw)
  To: io-uring; +Cc: Liu Changcheng, Stefan Metzmacher

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

^ permalink raw reply	[flat|nested] 37+ messages in thread

* [PATCH v2 1/7] make-debs: fix version detection
  2021-11-18  3:10 ` [PATCH v2 0/7] liburing debian packaging fixes Eric Wong
@ 2021-11-18  3:10   ` Eric Wong
  2021-11-18  3:10   ` [PATCH v2 2/7] debian: avoid prompting package builder for signature Eric Wong
                     ` (6 subsequent siblings)
  7 siblings, 0 replies; 37+ messages in thread
From: Eric Wong @ 2021-11-18  3:10 UTC (permalink / raw)
  To: io-uring; +Cc: Liu Changcheng, Stefan Metzmacher

`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.

Signed-off-by: Eric Wong <[email protected]>
---
 make-debs.sh | 3 ++-
 1 file changed, 2 insertions(+), 1 deletion(-)

diff --git a/make-debs.sh b/make-debs.sh
index 01d563c..136b79e 100755
--- a/make-debs.sh
+++ b/make-debs.sh
@@ -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

^ permalink raw reply related	[flat|nested] 37+ messages in thread

* [PATCH v2 2/7] debian: avoid prompting package builder for signature
  2021-11-18  3:10 ` [PATCH v2 0/7] liburing debian packaging fixes Eric Wong
  2021-11-18  3:10   ` [PATCH v2 1/7] make-debs: fix version detection Eric Wong
@ 2021-11-18  3:10   ` Eric Wong
  2021-11-18  3:10   ` [PATCH v2 3/7] debian/rules: fix for newer debhelper Eric Wong
                     ` (5 subsequent siblings)
  7 siblings, 0 replies; 37+ messages in thread
From: Eric Wong @ 2021-11-18  3:10 UTC (permalink / raw)
  To: io-uring; +Cc: Liu Changcheng, Stefan Metzmacher

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.

Signed-off-by: Eric Wong <[email protected]>
---
 debian/changelog | 6 ++++++
 make-debs.sh     | 5 ++++-
 2 files changed, 10 insertions(+), 1 deletion(-)

diff --git a/debian/changelog b/debian/changelog
index f0032e3..fbc361b 100644
--- a/debian/changelog
+++ b/debian/changelog
@@ -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
diff --git a/make-debs.sh b/make-debs.sh
index 136b79e..aea05f0 100755
--- a/make-debs.sh
+++ b/make-debs.sh
@@ -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

^ permalink raw reply related	[flat|nested] 37+ messages in thread

* [PATCH v2 3/7] debian/rules: fix for newer debhelper
  2021-11-18  3:10 ` [PATCH v2 0/7] liburing debian packaging fixes Eric Wong
  2021-11-18  3:10   ` [PATCH v2 1/7] make-debs: fix version detection Eric Wong
  2021-11-18  3:10   ` [PATCH v2 2/7] debian: avoid prompting package builder for signature Eric Wong
@ 2021-11-18  3:10   ` Eric Wong
  2021-11-18  4:42     ` Stefan Metzmacher
  2021-11-18  3:10   ` [PATCH v2 4/7] debian/rules: support parallel build Eric Wong
                     ` (4 subsequent siblings)
  7 siblings, 1 reply; 37+ messages in thread
From: Eric Wong @ 2021-11-18  3:10 UTC (permalink / raw)
  To: io-uring; +Cc: Liu Changcheng, Stefan Metzmacher

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).

Signed-off-by: Eric Wong <[email protected]>
---
 debian/rules | 9 ++++++++-
 1 file changed, 8 insertions(+), 1 deletion(-)

diff --git a/debian/rules b/debian/rules
index 1a334b3..fe90606 100755
--- a/debian/rules
+++ b/debian/rules
@@ -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

^ permalink raw reply related	[flat|nested] 37+ messages in thread

* [PATCH v2 4/7] debian/rules: support parallel build
  2021-11-18  3:10 ` [PATCH v2 0/7] liburing debian packaging fixes Eric Wong
                     ` (2 preceding siblings ...)
  2021-11-18  3:10   ` [PATCH v2 3/7] debian/rules: fix for newer debhelper Eric Wong
@ 2021-11-18  3:10   ` Eric Wong
  2021-11-18  3:10   ` [PATCH v2 5/7] debian: rename package to liburing2 to match .so version Eric Wong
                     ` (3 subsequent siblings)
  7 siblings, 0 replies; 37+ messages in thread
From: Eric Wong @ 2021-11-18  3:10 UTC (permalink / raw)
  To: io-uring; +Cc: Liu Changcheng, Stefan Metzmacher

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

Signed-off-by: Eric Wong <[email protected]>
---
 debian/rules | 10 ++++++++++
 1 file changed, 10 insertions(+)

diff --git a/debian/rules b/debian/rules
index fe90606..221657d 100755
--- a/debian/rules
+++ b/debian/rules
@@ -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

^ permalink raw reply related	[flat|nested] 37+ messages in thread

* [PATCH v2 5/7] debian: rename package to liburing2 to match .so version
  2021-11-18  3:10 ` [PATCH v2 0/7] liburing debian packaging fixes Eric Wong
                     ` (3 preceding siblings ...)
  2021-11-18  3:10   ` [PATCH v2 4/7] debian/rules: support parallel build Eric Wong
@ 2021-11-18  3:10   ` Eric Wong
  2021-11-18  3:10   ` [PATCH v2 6/7] make-debs: use version from RPM .spec Eric Wong
                     ` (2 subsequent siblings)
  7 siblings, 0 replies; 37+ messages in thread
From: Eric Wong @ 2021-11-18  3:10 UTC (permalink / raw)
  To: io-uring; +Cc: Liu Changcheng, Stefan Metzmacher

Reported-by: Stefan Metzmacher <[email protected]>
Link: https://lore.kernel.org/io-uring/[email protected]/
Signed-off-by: Eric Wong <[email protected]>
---
 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%)

diff --git a/debian/control b/debian/control
index 831a314..afce9b1 100644
--- a/debian/control
+++ b/debian/control
@@ -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
diff --git a/debian/liburing1-udeb.install b/debian/liburing2-udeb.install
similarity index 100%
rename from debian/liburing1-udeb.install
rename to debian/liburing2-udeb.install
diff --git a/debian/liburing1.install b/debian/liburing2.install
similarity index 100%
rename from debian/liburing1.install
rename to debian/liburing2.install
diff --git a/debian/liburing1.symbols b/debian/liburing2.symbols
similarity index 97%
rename from debian/liburing1.symbols
rename to debian/liburing2.symbols
index 29109f2..5bb203f 100644
--- a/debian/liburing1.symbols
+++ b/debian/liburing2.symbols
@@ -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
diff --git a/debian/rules b/debian/rules
index 221657d..cd41bb8 100755
--- a/debian/rules
+++ b/debian/rules
@@ -21,7 +21,7 @@ endif
 
 export CC
 
-lib := liburing1
+lib := liburing2
 libdbg := $(lib)-dbg
 libudeb := $(lib)-udeb
 libdev := liburing-dev

^ permalink raw reply related	[flat|nested] 37+ messages in thread

* [PATCH v2 6/7] make-debs: use version from RPM .spec
  2021-11-18  3:10 ` [PATCH v2 0/7] liburing debian packaging fixes Eric Wong
                     ` (4 preceding siblings ...)
  2021-11-18  3:10   ` [PATCH v2 5/7] debian: rename package to liburing2 to match .so version Eric Wong
@ 2021-11-18  3:10   ` Eric Wong
  2021-11-18  3:10   ` [PATCH v2 7/7] make-debs: remove dependency on git Eric Wong
  2021-11-18 18:50   ` [PATCHv2 8/7] debian/rules: fix version comparison for Ubuntu Eric Wong
  7 siblings, 0 replies; 37+ messages in thread
From: Eric Wong @ 2021-11-18  3:10 UTC (permalink / raw)
  To: io-uring; +Cc: Liu Changcheng, Stefan Metzmacher

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.

Signed-off-by: Eric Wong <[email protected]>
---
 Makefile     | 5 ++++-
 make-debs.sh | 2 +-
 2 files changed, 5 insertions(+), 2 deletions(-)

diff --git a/Makefile b/Makefile
index 28c0fd8..48fb48a 100644
--- a/Makefile
+++ b/Makefile
@@ -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
diff --git a/make-debs.sh b/make-debs.sh
index aea05f0..0913c47 100755
--- a/make-debs.sh
+++ b/make-debs.sh
@@ -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 '-' '_')
 

^ permalink raw reply related	[flat|nested] 37+ messages in thread

* [PATCH v2 7/7] make-debs: remove dependency on git
  2021-11-18  3:10 ` [PATCH v2 0/7] liburing debian packaging fixes Eric Wong
                     ` (5 preceding siblings ...)
  2021-11-18  3:10   ` [PATCH v2 6/7] make-debs: use version from RPM .spec Eric Wong
@ 2021-11-18  3:10   ` Eric Wong
  2021-11-18 18:50   ` [PATCHv2 8/7] debian/rules: fix version comparison for Ubuntu Eric Wong
  7 siblings, 0 replies; 37+ messages in thread
From: Eric Wong @ 2021-11-18  3:10 UTC (permalink / raw)
  To: io-uring; +Cc: Liu Changcheng, Stefan Metzmacher

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

Signed-off-by: Eric Wong <[email protected]>
---
 make-debs.sh | 9 +++++++--
 1 file changed, 7 insertions(+), 2 deletions(-)

diff --git a/make-debs.sh b/make-debs.sh
index 0913c47..867612b 100755
--- a/make-debs.sh
+++ b/make-debs.sh
@@ -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

^ permalink raw reply related	[flat|nested] 37+ messages in thread

* Re: [PATCH 2/4] debian: avoid prompting package builder for signature
  2021-11-17 10:01   ` Stefan Metzmacher
@ 2021-11-18  3:14     ` Eric Wong
  0 siblings, 0 replies; 37+ messages in thread
From: Eric Wong @ 2021-11-18  3:14 UTC (permalink / raw)
  To: Stefan Metzmacher; +Cc: io-uring, Liu Changcheng

Stefan Metzmacher <[email protected]> wrote:
> Hi Eric,
> 
> > diff --git a/make-debs.sh b/make-debs.sh
> > index 136b79e..aea05f0 100755
> > --- a/make-debs.sh
> > +++ b/make-debs.sh
> > @@ -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
> 
> 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.

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.

^ permalink raw reply	[flat|nested] 37+ messages in thread

* Re: [PATCH v2 3/7] debian/rules: fix for newer debhelper
  2021-11-18  3:10   ` [PATCH v2 3/7] debian/rules: fix for newer debhelper Eric Wong
@ 2021-11-18  4:42     ` Stefan Metzmacher
  2021-11-18  5:11       ` Eric Wong
  0 siblings, 1 reply; 37+ messages in thread
From: Stefan Metzmacher @ 2021-11-18  4:42 UTC (permalink / raw)
  To: Eric Wong, io-uring; +Cc: Liu Changcheng

Am 18.11.21 um 04:10 schrieb 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).
> 
> Signed-off-by: Eric Wong <[email protected]>
> ---
>  debian/rules | 9 ++++++++-
>  1 file changed, 8 insertions(+), 1 deletion(-)
> 
> diff --git a/debian/rules b/debian/rules
> index 1a334b3..fe90606 100755
> --- a/debian/rules
> +++ b/debian/rules
> @@ -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
> +

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



^ permalink raw reply	[flat|nested] 37+ messages in thread

* Re: [PATCH v2 3/7] debian/rules: fix for newer debhelper
  2021-11-18  4:42     ` Stefan Metzmacher
@ 2021-11-18  5:11       ` Eric Wong
  2021-11-18  5:35         ` Eric Wong
  0 siblings, 1 reply; 37+ messages in thread
From: Eric Wong @ 2021-11-18  5:11 UTC (permalink / raw)
  To: Stefan Metzmacher; +Cc: io-uring, Liu Changcheng

Stefan Metzmacher <[email protected]> wrote:
> 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.

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?

diff --git a/debian/rules b/debian/rules
index cd41bb8..73f53fe 100755
--- a/debian/rules
+++ b/debian/rules
@@ -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.

^ permalink raw reply related	[flat|nested] 37+ messages in thread

* Re: [PATCH v2 3/7] debian/rules: fix for newer debhelper
  2021-11-18  5:11       ` Eric Wong
@ 2021-11-18  5:35         ` Eric Wong
  2021-11-18 14:37           ` Stefan Metzmacher
  0 siblings, 1 reply; 37+ messages in thread
From: Eric Wong @ 2021-11-18  5:35 UTC (permalink / raw)
  To: Stefan Metzmacher; +Cc: io-uring, Liu Changcheng

Eric Wong <[email protected]> wrote:
> 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

diff --git a/debian/rules b/debian/rules
index cd41bb8..d0b4eea 100755
--- a/debian/rules
+++ b/debian/rules
@@ -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
 

^ permalink raw reply related	[flat|nested] 37+ messages in thread

* Re: [PATCH v2 3/7] debian/rules: fix for newer debhelper
  2021-11-18  5:35         ` Eric Wong
@ 2021-11-18 14:37           ` Stefan Metzmacher
  0 siblings, 0 replies; 37+ messages in thread
From: Stefan Metzmacher @ 2021-11-18 14:37 UTC (permalink / raw)
  To: Eric Wong; +Cc: io-uring, Liu Changcheng

Hi Eric,

> Sorry, I missed a semi-colon and temporarily lost connectivity
> to my bullseye machine :x  Tested on both bullseye and buster, now
> 
> diff --git a/debian/rules b/debian/rules
> index cd41bb8..d0b4eea 100755
> --- a/debian/rules
> +++ b/debian/rules
> @@ -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


^ permalink raw reply	[flat|nested] 37+ messages in thread

* [PATCHv2 8/7] debian/rules: fix version comparison for Ubuntu
  2021-11-18  3:10 ` [PATCH v2 0/7] liburing debian packaging fixes Eric Wong
                     ` (6 preceding siblings ...)
  2021-11-18  3:10   ` [PATCH v2 7/7] make-debs: remove dependency on git Eric Wong
@ 2021-11-18 18:50   ` Eric Wong
  7 siblings, 0 replies; 37+ messages in thread
From: Eric Wong @ 2021-11-18 18:50 UTC (permalink / raw)
  To: io-uring; +Cc: Liu Changcheng, Stefan Metzmacher

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

Tested-by: Stefan Metzmacher <[email protected]>
Link: https://lore.kernel.org/io-uring/[email protected]/
Signed-off-by: Eric Wong <[email protected]>
---
 debian/rules | 3 ++-
 1 file changed, 2 insertions(+), 1 deletion(-)

diff --git a/debian/rules b/debian/rules
index cd41bb8..d0b4eea 100755
--- a/debian/rules
+++ b/debian/rules
@@ -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
 

^ permalink raw reply related	[flat|nested] 37+ messages in thread

* [PULL|PATCH v3 0/7] liburing debian packaging fixes
  2021-11-16 22:44 [PATCH 0/4] liburing debian packaging fixes Eric Wong
                   ` (4 preceding siblings ...)
  2021-11-18  3:10 ` [PATCH v2 0/7] liburing debian packaging fixes Eric Wong
@ 2022-01-21 18:26 ` Eric Wong
  2022-01-21 18:26   ` [PATCH v3 1/7] make-debs: fix version detection Eric Wong
                     ` (7 more replies)
  5 siblings, 8 replies; 37+ messages in thread
From: Eric Wong @ 2022-01-21 18:26 UTC (permalink / raw)
  To: io-uring; +Cc: Stefan Metzmacher, Liu Changcheng, 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%)

^ permalink raw reply	[flat|nested] 37+ messages in thread

* [PATCH v3 1/7] make-debs: fix version detection
  2022-01-21 18:26 ` [PULL|PATCH v3 0/7] liburing debian packaging fixes Eric Wong
@ 2022-01-21 18:26   ` Eric Wong
  2022-01-21 18:26   ` [PATCH v3 2/7] debian: avoid prompting package builder for signature Eric Wong
                     ` (6 subsequent siblings)
  7 siblings, 0 replies; 37+ messages in thread
From: Eric Wong @ 2022-01-21 18:26 UTC (permalink / raw)
  To: io-uring; +Cc: Stefan Metzmacher, Liu Changcheng, Eric Wong

`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.

Signed-off-by: Eric Wong <[email protected]>
---
 make-debs.sh | 3 ++-
 1 file changed, 2 insertions(+), 1 deletion(-)

diff --git a/make-debs.sh b/make-debs.sh
index 01d563c..136b79e 100755
--- a/make-debs.sh
+++ b/make-debs.sh
@@ -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

^ permalink raw reply related	[flat|nested] 37+ messages in thread

* [PATCH v3 2/7] debian: avoid prompting package builder for signature
  2022-01-21 18:26 ` [PULL|PATCH v3 0/7] liburing debian packaging fixes Eric Wong
  2022-01-21 18:26   ` [PATCH v3 1/7] make-debs: fix version detection Eric Wong
@ 2022-01-21 18:26   ` Eric Wong
  2022-01-21 18:26   ` [PATCH v3 3/7] debian/rules: fix for newer debhelper Eric Wong
                     ` (5 subsequent siblings)
  7 siblings, 0 replies; 37+ messages in thread
From: Eric Wong @ 2022-01-21 18:26 UTC (permalink / raw)
  To: io-uring; +Cc: Stefan Metzmacher, Liu Changcheng, 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.

Signed-off-by: Eric Wong <[email protected]>
---
 debian/changelog | 6 ++++++
 make-debs.sh     | 5 ++++-
 2 files changed, 10 insertions(+), 1 deletion(-)

diff --git a/debian/changelog b/debian/changelog
index f0032e3..fbc361b 100644
--- a/debian/changelog
+++ b/debian/changelog
@@ -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
diff --git a/make-debs.sh b/make-debs.sh
index 136b79e..aea05f0 100755
--- a/make-debs.sh
+++ b/make-debs.sh
@@ -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

^ permalink raw reply related	[flat|nested] 37+ messages in thread

* [PATCH v3 3/7] debian/rules: fix for newer debhelper
  2022-01-21 18:26 ` [PULL|PATCH v3 0/7] liburing debian packaging fixes Eric Wong
  2022-01-21 18:26   ` [PATCH v3 1/7] make-debs: fix version detection Eric Wong
  2022-01-21 18:26   ` [PATCH v3 2/7] debian: avoid prompting package builder for signature Eric Wong
@ 2022-01-21 18:26   ` Eric Wong
  2022-01-21 18:26   ` [PATCH v3 4/7] debian/rules: support parallel build Eric Wong
                     ` (4 subsequent siblings)
  7 siblings, 0 replies; 37+ messages in thread
From: Eric Wong @ 2022-01-21 18:26 UTC (permalink / raw)
  To: io-uring; +Cc: Stefan Metzmacher, Liu Changcheng, 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")

Tested-by: Stefan Metzmacher <[email protected]>
Link: https://lore.kernel.org/io-uring/[email protected]/
Signed-off-by: Eric Wong <[email protected]>
---
 debian/rules | 10 +++++++++-
 1 file changed, 9 insertions(+), 1 deletion(-)

diff --git a/debian/rules b/debian/rules
index 1a334b3..6631b10 100755
--- a/debian/rules
+++ b/debian/rules
@@ -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

^ permalink raw reply related	[flat|nested] 37+ messages in thread

* [PATCH v3 4/7] debian/rules: support parallel build
  2022-01-21 18:26 ` [PULL|PATCH v3 0/7] liburing debian packaging fixes Eric Wong
                     ` (2 preceding siblings ...)
  2022-01-21 18:26   ` [PATCH v3 3/7] debian/rules: fix for newer debhelper Eric Wong
@ 2022-01-21 18:26   ` Eric Wong
  2022-01-21 18:26   ` [PATCH v3 5/7] debian: rename package to liburing2 to match .so version Eric Wong
                     ` (3 subsequent siblings)
  7 siblings, 0 replies; 37+ messages in thread
From: Eric Wong @ 2022-01-21 18:26 UTC (permalink / raw)
  To: io-uring; +Cc: Stefan Metzmacher, Liu Changcheng, Eric Wong

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

Signed-off-by: Eric Wong <[email protected]>
---
 debian/rules | 10 ++++++++++
 1 file changed, 10 insertions(+)

diff --git a/debian/rules b/debian/rules
index 6631b10..f26271e 100755
--- a/debian/rules
+++ b/debian/rules
@@ -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

^ permalink raw reply related	[flat|nested] 37+ messages in thread

* [PATCH v3 5/7] debian: rename package to liburing2 to match .so version
  2022-01-21 18:26 ` [PULL|PATCH v3 0/7] liburing debian packaging fixes Eric Wong
                     ` (3 preceding siblings ...)
  2022-01-21 18:26   ` [PATCH v3 4/7] debian/rules: support parallel build Eric Wong
@ 2022-01-21 18:26   ` Eric Wong
  2022-01-21 18:26   ` [PATCH v3 6/7] make-debs: use version from RPM .spec Eric Wong
                     ` (2 subsequent siblings)
  7 siblings, 0 replies; 37+ messages in thread
From: Eric Wong @ 2022-01-21 18:26 UTC (permalink / raw)
  To: io-uring; +Cc: Stefan Metzmacher, Liu Changcheng, Eric Wong

Reported-by: Stefan Metzmacher <[email protected]>
Link: https://lore.kernel.org/io-uring/[email protected]/
Signed-off-by: Eric Wong <[email protected]>
---
 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%)

diff --git a/debian/control b/debian/control
index 831a314..afce9b1 100644
--- a/debian/control
+++ b/debian/control
@@ -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
diff --git a/debian/liburing1-udeb.install b/debian/liburing2-udeb.install
similarity index 100%
rename from debian/liburing1-udeb.install
rename to debian/liburing2-udeb.install
diff --git a/debian/liburing1.install b/debian/liburing2.install
similarity index 100%
rename from debian/liburing1.install
rename to debian/liburing2.install
diff --git a/debian/liburing1.symbols b/debian/liburing2.symbols
similarity index 97%
rename from debian/liburing1.symbols
rename to debian/liburing2.symbols
index 29109f2..5bb203f 100644
--- a/debian/liburing1.symbols
+++ b/debian/liburing2.symbols
@@ -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
diff --git a/debian/rules b/debian/rules
index f26271e..d0b4eea 100755
--- a/debian/rules
+++ b/debian/rules
@@ -21,7 +21,7 @@ endif
 
 export CC
 
-lib := liburing1
+lib := liburing2
 libdbg := $(lib)-dbg
 libudeb := $(lib)-udeb
 libdev := liburing-dev

^ permalink raw reply related	[flat|nested] 37+ messages in thread

* [PATCH v3 6/7] make-debs: use version from RPM .spec
  2022-01-21 18:26 ` [PULL|PATCH v3 0/7] liburing debian packaging fixes Eric Wong
                     ` (4 preceding siblings ...)
  2022-01-21 18:26   ` [PATCH v3 5/7] debian: rename package to liburing2 to match .so version Eric Wong
@ 2022-01-21 18:26   ` Eric Wong
  2022-01-21 18:26   ` [PATCH v3 7/7] make-debs: remove dependency on git Eric Wong
  2022-04-03  8:48   ` [PULL|PATCH v3 0/7] liburing debian packaging fixes Eric Wong
  7 siblings, 0 replies; 37+ messages in thread
From: Eric Wong @ 2022-01-21 18:26 UTC (permalink / raw)
  To: io-uring; +Cc: Stefan Metzmacher, Liu Changcheng, 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.

Signed-off-by: Eric Wong <[email protected]>
---
 Makefile     | 5 ++++-
 make-debs.sh | 2 +-
 2 files changed, 5 insertions(+), 2 deletions(-)

diff --git a/Makefile b/Makefile
index 28c0fd8..48fb48a 100644
--- a/Makefile
+++ b/Makefile
@@ -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
diff --git a/make-debs.sh b/make-debs.sh
index aea05f0..0913c47 100755
--- a/make-debs.sh
+++ b/make-debs.sh
@@ -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 '-' '_')
 

^ permalink raw reply related	[flat|nested] 37+ messages in thread

* [PATCH v3 7/7] make-debs: remove dependency on git
  2022-01-21 18:26 ` [PULL|PATCH v3 0/7] liburing debian packaging fixes Eric Wong
                     ` (5 preceding siblings ...)
  2022-01-21 18:26   ` [PATCH v3 6/7] make-debs: use version from RPM .spec Eric Wong
@ 2022-01-21 18:26   ` Eric Wong
  2022-04-03  8:48   ` [PULL|PATCH v3 0/7] liburing debian packaging fixes Eric Wong
  7 siblings, 0 replies; 37+ messages in thread
From: Eric Wong @ 2022-01-21 18:26 UTC (permalink / raw)
  To: io-uring; +Cc: Stefan Metzmacher, Liu Changcheng, 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.

Signed-off-by: Eric Wong <[email protected]>
---
 make-debs.sh | 9 +++++++--
 1 file changed, 7 insertions(+), 2 deletions(-)

diff --git a/make-debs.sh b/make-debs.sh
index 0913c47..867612b 100755
--- a/make-debs.sh
+++ b/make-debs.sh
@@ -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

^ permalink raw reply related	[flat|nested] 37+ messages in thread

* Re: [PULL|PATCH v3 0/7] liburing debian packaging fixes
  2022-01-21 18:26 ` [PULL|PATCH v3 0/7] liburing debian packaging fixes Eric Wong
                     ` (6 preceding siblings ...)
  2022-01-21 18:26   ` [PATCH v3 7/7] make-debs: remove dependency on git Eric Wong
@ 2022-04-03  8:48   ` Eric Wong
  2022-04-03 14:54     ` Jens Axboe
  7 siblings, 1 reply; 37+ messages in thread
From: Eric Wong @ 2022-04-03  8:48 UTC (permalink / raw)
  To: Jens Axboe; +Cc: io-uring, Stefan Metzmacher, Liu Changcheng

Eric Wong <[email protected]> wrote:
> 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)

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

^ permalink raw reply	[flat|nested] 37+ messages in thread

* Re: [PULL|PATCH v3 0/7] liburing debian packaging fixes
  2022-04-03  8:48   ` [PULL|PATCH v3 0/7] liburing debian packaging fixes Eric Wong
@ 2022-04-03 14:54     ` Jens Axboe
  2022-04-03 20:43       ` Eric Wong
  2022-04-04 16:13       ` Stefan Metzmacher
  0 siblings, 2 replies; 37+ messages in thread
From: Jens Axboe @ 2022-04-03 14:54 UTC (permalink / raw)
  To: Eric Wong; +Cc: io-uring, Stefan Metzmacher, Liu Changcheng

On 4/3/22 2:48 AM, Eric Wong wrote:
> Eric Wong <[email protected]> wrote:
>> 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)
> 
> 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?

-- 
Jens Axboe


^ permalink raw reply	[flat|nested] 37+ messages in thread

* Re: [PULL|PATCH v3 0/7] liburing debian packaging fixes
  2022-04-03 14:54     ` Jens Axboe
@ 2022-04-03 20:43       ` Eric Wong
  2022-04-04 16:13       ` Stefan Metzmacher
  1 sibling, 0 replies; 37+ messages in thread
From: Eric Wong @ 2022-04-03 20:43 UTC (permalink / raw)
  To: Jens Axboe; +Cc: io-uring, Stefan Metzmacher, Liu Changcheng

Jens Axboe <[email protected]> wrote:
> 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.

> Does it still apply to the curren tree?

Yes :>

^ permalink raw reply	[flat|nested] 37+ messages in thread

* Re: [PULL|PATCH v3 0/7] liburing debian packaging fixes
  2022-04-03 14:54     ` Jens Axboe
  2022-04-03 20:43       ` Eric Wong
@ 2022-04-04 16:13       ` Stefan Metzmacher
  2022-04-04 16:17         ` Stefan Metzmacher
  1 sibling, 1 reply; 37+ messages in thread
From: Stefan Metzmacher @ 2022-04-04 16:13 UTC (permalink / raw)
  To: Jens Axboe, Eric Wong; +Cc: io-uring, Liu Changcheng


Am 03.04.22 um 16:54 schrieb Jens Axboe:
> On 4/3/22 2:48 AM, Eric Wong wrote:
>> Eric Wong <[email protected]> wrote:
>>> 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)
>>
>> 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?

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

^ permalink raw reply	[flat|nested] 37+ messages in thread

* Re: [PULL|PATCH v3 0/7] liburing debian packaging fixes
  2022-04-04 16:13       ` Stefan Metzmacher
@ 2022-04-04 16:17         ` Stefan Metzmacher
  0 siblings, 0 replies; 37+ messages in thread
From: Stefan Metzmacher @ 2022-04-04 16:17 UTC (permalink / raw)
  To: Jens Axboe, Eric Wong; +Cc: io-uring, Liu Changcheng

Am 04.04.22 um 18:13 schrieb Stefan Metzmacher:
> 
> Am 03.04.22 um 16:54 schrieb Jens Axboe:
>> On 4/3/22 2:48 AM, Eric Wong wrote:
>>> Eric Wong <[email protected]> wrote:
>>>> 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)
>>>
>>> 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?
> 
> 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

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


^ permalink raw reply	[flat|nested] 37+ messages in thread

end of thread, other threads:[~2022-04-04 21:18 UTC | newest]

Thread overview: 37+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2021-11-16 22:44 [PATCH 0/4] liburing debian packaging fixes Eric Wong
2021-11-16 22:44 ` [PATCH 1/4] make-debs: fix version detection Eric Wong
2021-11-17 10:17   ` Stefan Metzmacher
2021-11-18  1:25     ` Eric Wong
2021-11-16 22:44 ` [PATCH 2/4] debian: avoid prompting package builder for signature Eric Wong
2021-11-17 10:01   ` Stefan Metzmacher
2021-11-18  3:14     ` Eric Wong
2021-11-16 22:44 ` [PATCH 3/4] debian/rules: fix for newer debhelper Eric Wong
2021-11-17 10:04   ` Stefan Metzmacher
2021-11-18  1:20     ` Eric Wong
2021-11-16 22:44 ` [PATCH 4/4] debian/rules: support parallel build Eric Wong
2021-11-18  3:10 ` [PATCH v2 0/7] liburing debian packaging fixes Eric Wong
2021-11-18  3:10   ` [PATCH v2 1/7] make-debs: fix version detection Eric Wong
2021-11-18  3:10   ` [PATCH v2 2/7] debian: avoid prompting package builder for signature Eric Wong
2021-11-18  3:10   ` [PATCH v2 3/7] debian/rules: fix for newer debhelper Eric Wong
2021-11-18  4:42     ` Stefan Metzmacher
2021-11-18  5:11       ` Eric Wong
2021-11-18  5:35         ` Eric Wong
2021-11-18 14:37           ` Stefan Metzmacher
2021-11-18  3:10   ` [PATCH v2 4/7] debian/rules: support parallel build Eric Wong
2021-11-18  3:10   ` [PATCH v2 5/7] debian: rename package to liburing2 to match .so version Eric Wong
2021-11-18  3:10   ` [PATCH v2 6/7] make-debs: use version from RPM .spec Eric Wong
2021-11-18  3:10   ` [PATCH v2 7/7] make-debs: remove dependency on git Eric Wong
2021-11-18 18:50   ` [PATCHv2 8/7] debian/rules: fix version comparison for Ubuntu Eric Wong
2022-01-21 18:26 ` [PULL|PATCH v3 0/7] liburing debian packaging fixes Eric Wong
2022-01-21 18:26   ` [PATCH v3 1/7] make-debs: fix version detection Eric Wong
2022-01-21 18:26   ` [PATCH v3 2/7] debian: avoid prompting package builder for signature Eric Wong
2022-01-21 18:26   ` [PATCH v3 3/7] debian/rules: fix for newer debhelper Eric Wong
2022-01-21 18:26   ` [PATCH v3 4/7] debian/rules: support parallel build Eric Wong
2022-01-21 18:26   ` [PATCH v3 5/7] debian: rename package to liburing2 to match .so version Eric Wong
2022-01-21 18:26   ` [PATCH v3 6/7] make-debs: use version from RPM .spec Eric Wong
2022-01-21 18:26   ` [PATCH v3 7/7] make-debs: remove dependency on git Eric Wong
2022-04-03  8:48   ` [PULL|PATCH v3 0/7] liburing debian packaging fixes Eric Wong
2022-04-03 14:54     ` Jens Axboe
2022-04-03 20:43       ` Eric Wong
2022-04-04 16:13       ` Stefan Metzmacher
2022-04-04 16:17         ` Stefan Metzmacher

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox