Skip to contentSkip to conversation

kbuild: deb-pkg: apply short --rules-file option

PATCH In review Dmitrii Bundin 2 participants 5 messages Nov 3, 2023 – Nov 24, 2023 Kbuild

lore
Share & tools
lore
#0 lore raw

PATCH 1/1 kbuild: deb-pkg: apply short --rules-file option

The long --rules-file option might not be available for some older versions of dpkg-buildpackage resulting in build failures. The -R option has been available since 1.14.17 allowing builds for larger allowing builds for larger set of versions of dpkg-buildpackage.

---
 scripts/Makefile.package | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)
scripts/Makefile.package +1 -1
index 2bcab02da965..0afbf5ad2919 100644
@@ -148,7 +148,7 @@ deb-pkg srcdeb-pkg bindeb-pkg:
 	$(if $(findstring source, $(build-type)), \
 		--unsigned-source --compression=$(KDEB_SOURCE_COMPRESS)) \
 	$(if $(findstring binary, $(build-type)), \
-		--rules-file='$(MAKE) -f debian/rules' --jobs=1 -r$(KBUILD_PKG_ROOTCMD) -a$$(cat debian/arch), \
+		-R'$(MAKE) -f debian/rules' --jobs=1 -r$(KBUILD_PKG_ROOTCMD) -a$$(cat debian/arch), \
 		--no-check-builddeps) \
 	$(DPKG_FLAGS))
 
Signature · 1 line
2.17.1
#1 lore raw
Quoted 25 lines · Dmitrii Bundin

The long --rules-file option might not be available for some older versions of dpkg-buildpackage resulting in build failures. The -R option has been available since 1.14.17 allowing builds for larger allowing builds for larger set of versions of dpkg-buildpackage.

---
 scripts/Makefile.package | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)
scripts/Makefile.package +1 -2
index 2bcab02da965..0afbf5ad2919 100644
@@ -148,7 +148,7 @@ deb-pkg srcdeb-pkg bindeb-pkg:
        $(if $(findstring source, $(build-type)), \
                --unsigned-source --compression=$(KDEB_SOURCE_COMPRESS)) \
        $(if $(findstring binary, $(build-type)), \
-               --rules-file='$(MAKE) -f debian/rules' --jobs=1 -r$(KBUILD_PKG_ROOTCMD) -a$$(cat debian/arch), \
+               -R'$(MAKE) -f debian/rules' --jobs=1 -r$(KBUILD_PKG_ROOTCMD) -a$$(cat debian/arch), \
                --no-check-builddeps) \
        $(DPKG_FLAGS))
 
--
Quoted 2 lines

2.17.1

The replacement is inconsistent because you replaced --rule-file, but kept --jobs, both of which are available since 1.18.8

-j, --jobs[=jobs|auto]
Specifies the number of jobs allowed to be run simultaneously (since dpkg 1.14.7, long option since dpkg 1.18.8).

-R, --rules-file=rules‐file
Building a Debian package usually involves invoking debian/rules as a command with several standard parameters (since dpkg 1.14.17, long option since dpkg 1.18.8).

I do not think it is a big deal because the version 1.18.8 was released in 2016.

Signature · 2 lines
Best Regards
Masahiro Yamada
#2 lore raw
Quoted 7 lines · Masahiro Yamada

I do not think it is a big deal because the version 1.18.8 was released in 2016.

Best Regards
Masahiro Yamada

Even in spite of being documented that way the long option --rules-file was fixed to behave the way it currently does in the commit 5cd52673aabdf5eaa58181972119a41041fc85f2 of dpkg dated dated 23.07.18 and become available starting 1.19.1. That might cause build failures for some versions newer than 1.18.8. I faced
dpkg-buildpackage: error: unknown option or argument --rules-file when building the Kernel using Debian dpkg-buildpackage version 1.19.0.5 having no errors for --jobs. To avoid such inconsistencies I think it might be useful to apply short options that are guaranteed to be available starting 1.14.7.

#3 lore raw

PATCH v2 1/1 kbuild: deb-pkg: apply short -R and -j options

In reply to Masahiro Yamada

The long version --rules-file and --jobs are available since 1.18.8 while their short analogues -R and -j have been added since 1.14.7.

The option --rules-file the way it works currently was introduced in the commit 5cd52673aabdf5eaa58181972119a41041fc85f2 of dpkg dated 23.07.18 with the following changelog entry:

* Fix dpkg-buildpackage option --rules-file parsing. It was trying to parse it as --rules-target, which due to the ordering was a no-op.

The current behavior of the long version --rules-file is guaranteed to be in use starting 1.19.1 and might cause build failures for some versions newer than 1.18.8 even in spite of being documented that way.

---
 scripts/Makefile.package | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)
scripts/Makefile.package +1 -1
index 2bcab02da965..af96319be98e 100644
@@ -148,7 +148,7 @@ deb-pkg srcdeb-pkg bindeb-pkg:
 	$(if $(findstring source, $(build-type)), \
 		--unsigned-source --compression=$(KDEB_SOURCE_COMPRESS)) \
 	$(if $(findstring binary, $(build-type)), \
-		--rules-file='$(MAKE) -f debian/rules' --jobs=1 -r$(KBUILD_PKG_ROOTCMD) -a$$(cat debian/arch), \
+		-R'$(MAKE) -f debian/rules' -j1 -r$(KBUILD_PKG_ROOTCMD) -a$$(cat debian/arch), \
 		--no-check-builddeps) \
 	$(DPKG_FLAGS))
 
Signature · 1 line
2.17.1
#4 lore raw

Re: [PATCH v2] kbuild: deb-pkg: apply short -R and -j options

Quoted 11 lines · Dmitrii Bundin

The long version --rules-file and --jobs are available since 1.18.8 while their short analogues -R and -j have been added since 1.14.7.

The option --rules-file the way it works currently was introduced in the commit 5cd52673aabdf5eaa58181972119a41041fc85f2 of dpkg dated 23.07.18 with the following changelog entry:

* Fix dpkg-buildpackage option --rules-file parsing. It was trying to parse it as --rules-target, which due to the ordering was a no-op.

Quoted 6 lines

The current behavior of the long version --rules-file is guaranteed to be in use starting 1.19.1 and might cause build failures for some versions newer than 1.18.8 even in spite of being documented that way.

---

Applied to linux-kbuild.
Thanks.

Quoted 19 lines
 scripts/Makefile.package | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)
scripts/Makefile.package +1 -2
index 2bcab02da965..af96319be98e 100644
@@ -148,7 +148,7 @@ deb-pkg srcdeb-pkg bindeb-pkg:
        $(if $(findstring source, $(build-type)), \
                --unsigned-source --compression=$(KDEB_SOURCE_COMPRESS)) \
        $(if $(findstring binary, $(build-type)), \
-               --rules-file='$(MAKE) -f debian/rules' --jobs=1 -r$(KBUILD_PKG_ROOTCMD) -a$$(cat debian/arch), \
+               -R'$(MAKE) -f debian/rules' -j1 -r$(KBUILD_PKG_ROOTCMD) -a$$(cat debian/arch), \
                --no-check-builddeps) \
        $(DPKG_FLAGS))
 
--

2.17.1

Signature · 2 lines
Best Regards
Masahiro Yamada