diff mbox series

[2/3] kbuild: deb-pkg: hard-code Build-Depends

Message ID 20231219181957.1449958-2-masahiroy@kernel.org (mailing list archive)
State New
Headers show
Series [1/3] kbuild: deb-pkg: do not query DEB_HOST_MULTIARCH | expand

Commit Message

Masahiro Yamada Dec. 19, 2023, 6:19 p.m. UTC
The condition to require libelf-dev:native is stale because objtool is
now enabled by CONFIG_OBJTOOL instead of CONFIG_UNWINDER_ORC. Not only
objtool but also resolve_btfids requires libelf-dev:native; therefore,
CONFIG_DEBUG_INFO_BTF should be checked as well.

Similarly, CONFIG_SYSTEM_TRUSTED_KEYRING is not the only case that
requires libssl-dev:native.

Perhaps, the following code would provide better coverage, but it is
hard to maintain (and may still be imperfect).

  if is_enabled CONFIG_OBJTOOL || is_enabled CONFIG_DEBUG_INFO_BTF; then
          build_depends="${build_depends}, libelf-dev:native"
  fi

  if is_enabled CONFIG_SYSTEM_TRUSTED_KEYRING ||
     is_enabled CONFIG_SYSTEM_REVOCATION_LIST ||
     is_enabled CONFIG_MODULE_SIG_FORMAT; then
          build_depends="${build_depends}, libssl-dev:native"
  fi

Let's hard-code the build dependency.

Signed-off-by: Masahiro Yamada <masahiroy@kernel.org>
---

 scripts/package/mkdebian | 5 ++---
 1 file changed, 2 insertions(+), 3 deletions(-)

Comments

Nicolas Schier Dec. 22, 2023, 2:26 p.m. UTC | #1
On Wed, Dec 20, 2023 at 03:19:56AM +0900, Masahiro Yamada wrote:
> The condition to require libelf-dev:native is stale because objtool is
> now enabled by CONFIG_OBJTOOL instead of CONFIG_UNWINDER_ORC. Not only
> objtool but also resolve_btfids requires libelf-dev:native; therefore,
> CONFIG_DEBUG_INFO_BTF should be checked as well.
> 
> Similarly, CONFIG_SYSTEM_TRUSTED_KEYRING is not the only case that
> requires libssl-dev:native.
> 
> Perhaps, the following code would provide better coverage, but it is
> hard to maintain (and may still be imperfect).
> 
>   if is_enabled CONFIG_OBJTOOL || is_enabled CONFIG_DEBUG_INFO_BTF; then
>           build_depends="${build_depends}, libelf-dev:native"
>   fi
> 
>   if is_enabled CONFIG_SYSTEM_TRUSTED_KEYRING ||
>      is_enabled CONFIG_SYSTEM_REVOCATION_LIST ||
>      is_enabled CONFIG_MODULE_SIG_FORMAT; then
>           build_depends="${build_depends}, libssl-dev:native"
>   fi
> 
> Let's hard-code the build dependency.
> 
> Signed-off-by: Masahiro Yamada <masahiroy@kernel.org>
> ---

Reviewed-by: Nicolas Schier <n.schier@avm.de>
diff mbox series

Patch

diff --git a/scripts/package/mkdebian b/scripts/package/mkdebian
index 91f0e09600b1..93a24712b9a1 100755
--- a/scripts/package/mkdebian
+++ b/scripts/package/mkdebian
@@ -176,8 +176,6 @@  else
 fi
 
 echo $debarch > debian/arch
-extra_build_depends=", $(if_enabled_echo CONFIG_UNWINDER_ORC libelf-dev:native)"
-extra_build_depends="$extra_build_depends, $(if_enabled_echo CONFIG_SYSTEM_TRUSTED_KEYRING libssl-dev:native)"
 
 # Generate a simple changelog template
 cat <<EOF > debian/changelog
@@ -195,7 +193,8 @@  Section: kernel
 Priority: optional
 Maintainer: $maintainer
 Rules-Requires-Root: no
-Build-Depends: bc, debhelper, rsync, kmod, cpio, bison, flex $extra_build_depends
+Build-Depends: debhelper
+Build-Depends-Arch: bc, bison, cpio, flex, kmod, libelf-dev:native, libssl-dev:native, rsync
 Homepage: https://www.kernel.org/
 
 Package: $packagename-$version