Bug 263418 - x11/nvidia-driver-390
Summary: x11/nvidia-driver-390
Status: Closed FIXED
Alias: None
Product: Ports & Packages
Classification: Unclassified
Component: Individual Port(s) (show other bugs)
Version: Latest
Hardware: Any Any
: --- Affects Only Me
Assignee: Alexey Dokuchaev
URL:
Keywords:
Depends on:
Blocks:
 
Reported: 2022-04-19 11:38 UTC by david
Modified: 2022-04-28 12:28 UTC (History)
1 user (show)

See Also:
bugzilla: maintainer-feedback? (danfe)


Attachments

Note You need to log in before you can comment on or make changes to this bug.
Description david 2022-04-19 11:38:44 UTC

    
Comment 1 david 2022-04-19 11:48:51 UTC
x11/nvidia-driver-390 fails to build in head as of main-n254915-f2edc9155721.
I had no issues building/using it in main-n254879-47bcbde91dea.  Or in stable/13-n250518-37c9ff4adfbd or stable/12-n235174-879a6b7b628.

Further, (on a different laptop), I had no issues with x11/nvidia-driver in main-n254879-47bcbde91dea, main-n254915-f2edc9155721, stable/13-n250518-37c9ff4adfbd, or stable/12-n235174-879a6b7b628.

In each case, the port is built in conjunction with building the kernel, by virtue of:

PORTS_MODULES+=x11/nvidia-driver-390  # for the original laptop

and

PORTS_MODULES+=x11/nvidia-driver      # for the newer laptop

in /etc/src.conf.

In the failing case, the relevant excerpt from the build typescript shows:

...
===>  Configuring for nvidia-driver-390-390.147
===>  Building for nvidia-driver-390-390.147
===> src (all)
===> src/nvidia (all)
machine -> /usr/src/sys/amd64/include
x86 -> /usr/src/sys/x86/include
awk -f /usr/src/sys/tools/makeobjops.awk /usr/src/sys/dev/acpica/acpi_if.m -h
awk -f /usr/src/sys/tools/makeobjops.awk /usr/src/sys/kern/bus_if.m -h
awk -f /usr/src/sys/tools/makeobjops.awk /usr/src/sys/kern/device_if.m -h
:> opt_acpi.h
awk -f /usr/src/sys/tools/makeobjops.awk /usr/src/sys/dev/pci/pci_if.m -h
awk -f /usr/src/sys/tools/vnode_if.awk /usr/src/sys/kern/vnode_if.src -p
awk -f /usr/src/sys/tools/vnode_if.awk /usr/src/sys/kern/vnode_if.src -q
awk -f /usr/src/sys/tools/vnode_if.awk /usr/src/sys/kern/vnode_if.src -h
touch opt_global.h
cc  -O2 -pipe -fno-strict-aliasing -DNV_VERSION_STRING=\"390.147\" -D__KERNEL__ -DNVRM -Wno-unused-function -Wuninitialized -O2 -fno-strict-aliasing -mno-red-zone -mcmodel=kernel -Wno-sign-compare -Wno-format-extra-args -UDEBUG -U_DEBUG -DNDEBUG -DNV_SPECTRE_V2=1 -DNV_KERNEL_INTERFACE_LAYER -Werror=undef  -Werror -D_KERNEL -DKLD_MODULE -nostdinc  -I. -I../common/inc -include /common/S4/obj/usr/src/amd64.amd64/sys/CANARY/common/ports/x11/nvidia-driver-390/work/NVIDIA-FreeBSD-x86_64-390.147/src/nvidia/opt_global.h -I. -I/usr/src/sys -I/usr/src/sys/contrib/ck/include -fno-common  -fno-omit-frame-pointer -mno-omit-leaf-frame-pointer -fdebug-prefix-map=./machine=/usr/src/sys/amd64/include -fdebug-prefix-map=./x86=/usr/src/sys/x86/include     -MD  -MF.depend.nvidia_acpi.o -MTnvidia_acpi.o -mcmodel=kernel -mno-red-zone -mno-mmx -mno-sse -msoft-float  -fno-asynchronous-unwind-tables -ffreestanding -fwrapv -fstack-protector -Wall -Wnested-externs -Wstrict-prototypes -Wmissing-prototypes -Wpointer-arith -Wcast-qual -Wundef -Wno-pointer-sign -D__printf__=__freebsd_kprintf__ -Wmissing-include-dirs -fdiagnostics-show-option -Wno-unknown-pragmas -Wno-error=tautological-compare -Wno-error=empty-body -Wno-error=parentheses-equality -Wno-error=unused-function -Wno-error=pointer-sign -Wno-error=shift-negative-value -Wno-address-of-packed-member -Wno-format-zero-length   -mno-aes -mno-avx  -std=iso9899:1999 -c nvidia_acpi.c -o nvidia_acpi.o
cc  -O2 -pipe -fno-strict-aliasing -DNV_VERSION_STRING=\"390.147\" -D__KERNEL__ -DNVRM -Wno-unused-function -Wuninitialized -O2 -fno-strict-aliasing -mno-red-zone -mcmodel=kernel -Wno-sign-compare -Wno-format-extra-args -UDEBUG -U_DEBUG -DNDEBUG -DNV_SPECTRE_V2=1 -DNV_KERNEL_INTERFACE_LAYER -Werror=undef  -Werror -D_KERNEL -DKLD_MODULE -nostdinc  -I. -I../common/inc -include /common/S4/obj/usr/src/amd64.amd64/sys/CANARY/common/ports/x11/nvidia-driver-390/work/NVIDIA-FreeBSD-x86_64-390.147/src/nvidia/opt_global.h -I. -I/usr/src/sys -I/usr/src/sys/contrib/ck/include -fno-common  -fno-omit-frame-pointer -mno-omit-leaf-frame-pointer -fdebug-prefix-map=./machine=/usr/src/sys/amd64/include -fdebug-prefix-map=./x86=/usr/src/sys/x86/include     -MD  -MF.depend.nvidia_ctl.o -MTnvidia_ctl.o -mcmodel=kernel -mno-red-zone -mno-mmx -mno-sse -msoft-float  -fno-asynchronous-unwind-tables -ffreestanding -fwrapv -fstack-protector -Wall -Wnested-externs -Wstrict-prototypes -Wmissing-prototypes -Wpointer-arith -Wcast-qual -Wundef -Wno-pointer-sign -D__printf__=__freebsd_kprintf__ -Wmissing-include-dirs -fdiagnostics-show-option -Wno-unknown-pragmas -Wno-error=tautological-compare -Wno-error=empty-body -Wno-error=parentheses-equality -Wno-error=unused-function -Wno-error=pointer-sign -Wno-error=shift-negative-value -Wno-address-of-packed-member -Wno-format-zero-length   -mno-aes -mno-avx  -std=iso9899:1999 -c nvidia_ctl.c -o nvidia_ctl.o
nvidia_ctl.c:75:9: error: variable 'status' set but not used [-Werror,-Wunused-but-set-variable]
    int status;
        ^
nvidia_ctl.c:214:26: error: variable 'sc' set but not used [-Werror,-Wunused-but-set-variable]
    struct nvidia_softc *sc;
                         ^
2 errors generated.
*** Error code 1

Stop.
make[7]: stopped in /common/S4/obj/usr/src/amd64.amd64/sys/CANARY/common/ports/x11/nvidia-driver-390/work/NVIDIA-FreeBSD-x86_64-390.147/src/nvidia
*** Error code 1

Stop.
make[6]: stopped in /common/S4/obj/usr/src/amd64.amd64/sys/CANARY/common/ports/x11/nvidia-driver-390/work/NVIDIA-FreeBSD-x86_64-390.147/src
*** Error code 1
Comment 2 commit-hook freebsd_committer freebsd_triage 2022-04-28 11:24:57 UTC
A commit in branch main references this bug:

URL: https://cgit.FreeBSD.org/ports/commit/?id=adc6bf772068a1adc8aec74074988ebab048d769

commit adc6bf772068a1adc8aec74074988ebab048d769
Author:     Alexey Dokuchaev <danfe@FreeBSD.org>
AuthorDate: 2022-04-28 11:23:46 +0000
Commit:     Alexey Dokuchaev <danfe@FreeBSD.org>
CommitDate: 2022-04-28 11:23:46 +0000

    x11/nvidia-driver (legacy versions): unbreak the build on fresh -CURRENT

    Recently, FreeBSD had started to enforce -Werror,-Wunused-but-set-variable
    for kernel code, which affects 3rd-party modules such as nVidia drivers.
    Newer versions of the driver are ready for that, but legacy one were not.

    Reported by:    pkg-fallout
    PR:             263418

 x11/nvidia-driver/Makefile                         |  5 +++++
 .../files/extra-patch-src-nvidia_ctl.c.in          | 23 ++++++++++++++++++----
 2 files changed, 24 insertions(+), 4 deletions(-)
Comment 3 Alexey Dokuchaev freebsd_committer freebsd_triage 2022-04-28 12:28:29 UTC
Should be fixed by ports adc6bf772068, thanks for reporting (although pkg-fallout@ did it as well).