Bug#984862: iptables-netflow-dkms: module wants to build with gcc instead of kernel's compiler

2021-04-18 Thread Andreas Beckmann

On 18/04/2021 16.36, Axel Beckert wrote:

Hi Andreas,

Andreas Beckmann wrote:

Please bump the dkms dependency for bullseye, this issue can trigger on
upgrades from buster to bullseye where iptables-netflow-dkms is upgraded
before dkms.


Should that patch really close this bug report? IIRC you didn't close
all these bug reports with the dkms patch. Was this in anticipation of
this version bumping


Yes, as it will avoid broken combinations ;-)


or do you still want us to get upstream to do it
"right" (whatever exactly that would be).


I don't know a generic way to get the kernel compiler from the headers, 
i.e. something that would also work for e.g. vanilla kernels. Thus I 
know of no upstreamable solution.


I find it still curious that it worked for iptables-netflow-dkms out of 
the box in buster with gcc-8 but no gcc installed.


Andreas

PS: I don't do forced module compile tests for upgrades in piuparts due 
to too many failures (extra kernel headers are only installed while 
testing a -dkms package within a distro), but if the package 
dependencies pull in the headers, well, we are building modules ;-)




Bug#984862: iptables-netflow-dkms: module wants to build with gcc instead of kernel's compiler

2021-04-18 Thread Axel Beckert
Hi Andreas,

Andreas Beckmann wrote:
> Please bump the dkms dependency for bullseye, this issue can trigger on
> upgrades from buster to bullseye where iptables-netflow-dkms is upgraded
> before dkms.

Should that patch really close this bug report? IIRC you didn't close
all these bug reports with the dkms patch. Was this in anticipation of
this version bumping or do you still want us to get upstream to do it
"right" (whatever exactly that would be).

Regards, Axel
-- 
 ,''`.  |  Axel Beckert , https://people.debian.org/~abe/
: :' :  |  Debian Developer, ftp.ch.debian.org Admin
`. `'   |  4096R: 2517 B724 C5F6 CA99 5329  6E61 2FF9 CD59 6126 16B5
  `-|  1024D: F067 EA27 26B9 C3FC 1486  202E C09E 1D89 9593 0EDE



Bug#984862: iptables-netflow-dkms: module wants to build with gcc instead of kernel's compiler

2021-04-16 Thread Andreas Beckmann
Followup-For: Bug #984862
Control: tag -1 patch
Control: severity -1 serious

Please bump the dkms dependency for bullseye, this issue can trigger on
upgrades from buster to bullseye where iptables-netflow-dkms is upgraded
before dkms. (e.g. apt-get upgrade && apt-get dist-upgrade)
iptables-netflow-dkms worked fine in buster with only gcc-8 (via
linux-compiler-gcc-8-x86) but no gcc installed.

Andreas
diff -Nru iptables-netflow-2.5.1/debian/changelog 
iptables-netflow-2.5.1/debian/changelog
--- iptables-netflow-2.5.1/debian/changelog 2020-10-18 11:22:35.0 
+0200
+++ iptables-netflow-2.5.1/debian/changelog 2021-04-16 15:37:38.0 
+0200
@@ -1,3 +1,10 @@
+iptables-netflow (2.5.1-2) UNRELEASED; urgency=medium
+
+  * iptables-netflow-dkms: Bump dkms dependency to ensure CC/CXX are set to
+the kernel's compiler.  (Closes: #984862)
+
+ -- Andreas Beckmann   Fri, 16 Apr 2021 15:37:38 +0200
+
 iptables-netflow (2.5.1-1) unstable; urgency=medium
 
   * New upstream bugfix release 2.5.1.
diff -Nru iptables-netflow-2.5.1/debian/control 
iptables-netflow-2.5.1/debian/control
--- iptables-netflow-2.5.1/debian/control   2020-04-27 08:39:15.0 
+0200
+++ iptables-netflow-2.5.1/debian/control   2021-04-16 15:37:30.0 
+0200
@@ -15,7 +15,7 @@
 
 Package: iptables-netflow-dkms
 Architecture: linux-any
-Depends: dkms,
+Depends: dkms (>= 2.8.4-3~),
  libc6-dev,
  libxtables-dev,
  pkg-config,


Bug#984862: iptables-netflow-dkms: module wants to build with gcc instead of kernel's compiler

2021-03-10 Thread Andreas Beckmann

On 10/03/2021 03.25, Axel Beckert wrote:

Correct. But how do I determine that kernel-specific compiler without
tracking down package dependencies? linux-compiler-gcc-10-x86 seems
not to provide a symlink or similar.



Or is tracking down package dependencies the way to go?


If you are inside Kbuild, CC is set to the correct value. But you are 
calling a configure script outside of Kbuild ...



Actually I would have expected that DKMS already takes care of this.


That is actually a good idea. dkms knows which headers to use, so it 
should try to find the correct CC and set this. That should help all of 
these packages, unless they hardcode CC=gcc somewhere.


Andreas



Bug#984862: iptables-netflow-dkms: module wants to build with gcc instead of kernel's compiler

2021-03-09 Thread Axel Beckert
Hi Andreas,

Andreas Beckmann wrote:
> That error is very cryptic ... so let's run dkms manually

Ack.

> Check for working gcc: No
> ! You need gcc to install module from source
[...]
> Oh, your package insists on building the kernel module with gcc instead of
> getting the correct compiler (i.e. the same versioned gcc-X that was used to
> build the kernel and that is depended upon by the kernel header package used)
> from kbuild. A kernel module built with a different compiler version than the
> kernel itself may not work. The kernel is not neccessarily built with the
> same compiler version as gcc points to.

Correct. But how do I determine that kernel-specific compiler without
tracking down package dependencies? linux-compiler-gcc-10-x86 seems
not to provide a symlink or similar.

→ dpkg -L linux-compiler-gcc-10-x86
/.
/usr
/usr/share
/usr/share/doc
/usr/share/doc/linux-compiler-gcc-10-x86
/usr/share/doc/linux-compiler-gcc-10-x86/changelog.Debian.gz
/usr/share/doc/linux-compiler-gcc-10-x86/copyright

Or is tracking down package dependencies the way to go?

Actually I would have expected that DKMS already takes care of this.
Because I deliberately added this patch to avoid this situation:

-CC = gcc
+CC ?= gcc

> There are more dkms packages looking for a proper solution for this problem:
>   openafs-modules-dkms (#945506)
>   zfs-dkms (#946497)

I see. Thanks! Doesn't look very promising though.

> Please depend on gcc if you cannot find a way to use the kernel
> compiler.

Actually I thought that DKMS does this already, but I see that _any_ C
compiler can fulfil it's dependency. Hrm.

> You cannot expect build-essential to be available.

Correct. But that's also not needed, given dkms' dependencies.

Regards, Axel
-- 
 ,''`.  |  Axel Beckert , https://people.debian.org/~abe/
: :' :  |  Debian Developer, ftp.ch.debian.org Admin
`. `'   |  4096R: 2517 B724 C5F6 CA99 5329  6E61 2FF9 CD59 6126 16B5
  `-|  1024D: F067 EA27 26B9 C3FC 1486  202E C09E 1D89 9593 0EDE



Bug#984862: iptables-netflow-dkms: module wants to build with gcc instead of kernel's compiler

2021-03-09 Thread Andreas Beckmann
Package: iptables-netflow-dkms
Version: 2.5.1-1
Severity: serious
User: debian...@lists.debian.org
Usertags: piuparts

Hi,

during a test with piuparts I noticed your package failed to install. As
per definition of the release team this makes the package too buggy for
a release, thus the severity.

>From the attached log (scroll to the bottom...):

  Setting up iptables-netflow-dkms (2.5.1-1) ...
  Loading new ipt-netflow-2.5.1 DKMS files...
  It is likely that 4.19.0-9-amd64 belongs to a chroot's host
  Building for 5.10.0-4-amd64
  Building initial module for 5.10.0-4-amd64
  Error! Bad return status for module build on kernel: 5.10.0-4-amd64 (x86_64)
  Consult /var/lib/dkms/ipt-netflow/2.5.1/build/make.log for more information.
  dpkg: error processing package iptables-netflow-dkms (--configure):
   installed iptables-netflow-dkms package post-installation script subprocess 
returned error exit status 10
  Processing triggers for libc-bin (2.31-9) ...
  Errors were encountered while processing:
   iptables-netflow-dkms

/var/lib/dkms/zfs/0.8.2/build/make.log contains:

DKMS make.log for ipt-netflow-2.5.1 for kernel 5.10.0-4-amd64 (x86_64)
Tue Mar  9 11:02:15 UTC 2021
make: *** No rule to make target 'ipt_NETFLOW.ko'.  Stop.

That error is very cryptic ... so let's run dkms manually

# dkms build -k 5.10.0-4-amd64 ipt-netflow/2.5.1

Kernel preparation unnecessary for this kernel.  Skipping...

Running the pre_build script:
Module version: 2.5.1
Kernel version: 4.19.118 (proc)
Kernel sources: /lib/modules/5.10.0-4-amd64/build (dkms)
! Warning: proc kernel version (4.19.118) and dkms version of kernel source 
(5.10.19) doesn't match!
!   You may try to specify only kernel source tree with 
--kdir=/lib/modules/5.10.0-4-amd64/build
!   and configure will pick up version properly.
! Assuming you want to build for 5.10.19
Checking for presence of include/linux/netfilter.h... No
Checking for presence of include/linux/llist.h... No
Checking for presence of include/linux/grsecurity.h... No
Iptables binary version: no iptables binary found
Xtables version: 1.8.7 (detected from /usr/bin/pkg-config)
Check for working gcc: No
! You need gcc to install module from source
! 
! Under Debian GNU/Linux try to run this:
!   root# apt-get install gcc
! 

Building module:
cleaning build area...(bad exit status: 2)
make -j16 KERNELRELEASE=5.10.0-4-amd64 ipt_NETFLOW.ko...(bad exit status: 2)
Error! Bad return status for module build on kernel: 5.10.0-4-amd64 (x86_64)
Consult /var/lib/dkms/ipt-netflow/2.5.1/build/make.log for more information.


Oh, your package insists on building the kernel module with gcc instead of
getting the correct compiler (i.e. the same versioned gcc-X that was used to
build the kernel and that is depended upon by the kernel header package used)
from kbuild. A kernel module built with a different compiler version than the
kernel itself may not work. The kernel is not neccessarily built with the
same compiler version as gcc points to.

Please depend on gcc if you cannot find a way to use the kernel
compiler. You cannot expect build-essential to be available.

There are more dkms packages looking for a proper solution for this problem:
  openafs-modules-dkms (#945506)
  zfs-dkms (#946497)


cheers,

Andreas


iptables-netflow-dkms_2.5.1-1.log.gz
Description: application/gzip