Bug#1025214: dkms: --environment-overrides causes several module build failures

2022-11-30 Thread наб
Control: severity -1 grave

Hi!

Guess who just spent two hours chasing this down in a big upgrade with
a half-bootable system in the mean-time :)

Retagging as grave ("unusable by most or all users, or causes data loss"
feels more appropriate than "severe violation of Debian policy").
I cannot tell you just how /tempting/ critical ‒ "makes unrelated
software on the system (or the whole system) break" is,
probably would be even more so if I weren't on battery :)

My system's on ZFS. Needs ZFS to boot, actually. It's very cool to see
" doesn't exist" in the log. Much cooler still to find that
I can run make myself in the build directory and it works! Very cool and
fun to spend multiple minutes per iteration with ZFS's long
configuration times!

The dkms bit from apt-listchanges is
-- >8 --
dkms (3.0.8-2) unstable; urgency=medium

  * export-CC, exact-cc: Merge and improve the two patches. Ensure that
compiler is set and exported as early in the prepartion stage as
possible, is not subsequently unset (already unset at the start of the
dkms script), and also export MAKEFLAGS to ensure that environment CC
variable is used by kernel's Makefile. Fixes LP: #1997841
  * Drop dangling unapplied patch from git.

 -- Dimitri John Ledkov   Thu, 24 Nov 2022 
14:59:45 +

dkms (3.0.8-1) unstable; urgency=medium

  [ Andreas Beckmann ]
  * update watch file
  * message consistency

  [ Gianfranco Costamagna ]
  * New upstream version 3.0.8
  * Drop upstream patches:
- 2b76d4aa29e65ae4ed8e89685c4e729f1276c5fc
- 3ca52f8769bdf7ebdc83735355fff7c5c0664152
- 7f3c4b03c506e40f0a5ce9315a8ade88b108ce0f
- 8d60956f6dcda0679066954215eb8be4045413b4
- 985bfd584f0e87bc726865bfdc17887d4713c854
  * Refresh patches

 -- Gianfranco Costamagna   Fri, 18 Nov 2022 22:34:50 
+0100
-- >8 --

I downgraded to 3.0.8-1 from snapshot.d.o (which surprisingly didn't
explode despite how fucked my dpkg config state was). That worked.

Please consider verifying whether an "improvement" doesn't straight-up
break every user before uploading.
This graph shows that the nvidia driver /alone/ is /4%/ of all reporting
installations (unfiltered rdeps for dkms):
  
https://qa.debian.org/popcon-graph.php?packages=zfs-dkms+zfs-dkms+r8168-dkms+nvidia-legacy-390xx-kernel-dkms+nvidia-kernel-dkms+broadcom-sta-dkms+zfs-dkms+acpi-call-dkms+dahdi-dkms+r8168-dkms+nvidia-tesla-470-kernel-dkms+nvidia-tesla-460-kernel-dkms+nvidia-tesla-450-kernel-dkms+nvidia-tesla-418-kernel-dkms+nvidia-legacy-390xx-kernel-dkms+nvidia-kernel-dkms+broadcom-sta-dkms+xtrx-dkms+xtables-addons-dkms+wireguard-dkms+west-chamber-dkms+v4l2loopback-dkms+tp-smapi-dkms+openrazer-driver-dkms+openafs-modules-dkms+octavia-agent+nat-rtsp-dkms+lttng-modules-dkms+live-task-recommended+lime-forensics-dkms+vpoll-dkms+langford-dkms+jool-dkms+iptables-netflow-dkms+gost-crypto-dkms+evdi-dkms+dpdk-kmods-dkms+dm-writeboost-dkms+digimend-dkms+ddcci-dkms+acpi-call-dkms+bbswitch-dkms+adv-17v35x-dkms_installed=on_percent=on_legend=on_ticks=on_date=_date=_date=_fmt=%25Y-%25m=1
:)

At least it didn't migrate to testing.

наб


signature.asc
Description: PGP signature


Bug#1025214: dkms: --environment-overrides causes several module build failures

2022-11-30 Thread Andreas Beckmann
Package: dkms
Version: 3.0.8-2
Severity: serious

Hi,

export MAKEFLAGS="--environment-overrides" causes several modules to
fail to build since this seems to inject unwanted environment variable
values into various build processes.

E.g. the nvidia modules react fragile to the ARCH variable, therefore we
unset that variable first:
  MAKE[0]="unset ARCH; env NV_VERBOSE=1 \
make ${parallel_jobs+-j$parallel_jobs} modules KERNEL_UNAME=${kernelver}"
but that does not work any longer. Verbose output shows that it tries to
build with ARCH=x86 (I have no clue where that value comes from)
instead of ARCH=x86_64 (which it even attempts to set).

I think you are mixing two things in the export-CC.patch:

1.) try to get the correct CC value from the kernel (.kernelvariables,
.config, ...) and export that for the benefit of the module build
system, overriding any CC value found in the environment (which is
likely to be wrong) (this does not need to be propagated back to
kbuild)

2.) support overriding the CC used by kbuild (and the module build
system) with some custom value


Andreas

PS: shouldn't you rather append to MAKEFLAGS and not override them?