Bug 297279 - graphics/drm-kmod: pkg upgrade should not try to install an earlier version
Summary: graphics/drm-kmod: pkg upgrade should not try to install an earlier version
Status: Open
Alias: None
Product: Ports & Packages
Classification: Unclassified
Component: Individual Port(s) (show other bugs)
Version: Latest
Hardware: Any Any
: --- Affects Only Me
Assignee: freebsd-x11 (Nobody)
URL:
Keywords:
Depends on:
Blocks:
 
Reported: 2026-08-04 17:41 UTC by Alexander Ziaee
Modified: 2026-08-11 17:44 UTC (History)
10 users (show)

See Also:
arrowd: maintainer-feedback+


Attachments

Note You need to log in before you can comment on or make changes to this bug.
Description Alexander Ziaee freebsd_committer freebsd_triage 2026-08-04 17:41:39 UTC
Setup:

I have drm-612 on stable/15, using the latest pkg repos, which do not have drm-612 yet [0].

Problem:

Running pkg upgrade, pkg tries to rip out drm-612 and install drm-66.

Consequence:

1. This rewinds graphics drivers by a full year, and on some machines this will make them generally unusable, so pkg should never try to downgrade drm-kmod.

2. If downgrading drm-kmod is not an option due to e.g. drm-612 contains critical bugfixes, then this makes pkg upgrade without args unusable, leading to massively increased user intervention for maintenance. The operator would need to manually pkg upgrade $pkg for every pkg leaf that needs upgraded, or some other cumbersome workaround to keep their packages upgraded.

[0]: this is a separate bug, https://bugs.freebsd.org/297254
Comment 1 Gleb Popov freebsd_committer freebsd_triage 2026-08-04 17:44:14 UTC
Show the log of pkg upgrade.
Comment 2 Alexander Ziaee freebsd_committer freebsd_triage 2026-08-04 17:48:42 UTC
# pkg upg
Updating FreeBSD-ports repository catalogue...
FreeBSD-ports repository is up to date.
Updating FreeBSD-ports-kmods repository catalogue...
FreeBSD-ports-kmods repository is up to date.
All repositories are up to date.
Checking for upgrades (134 candidates): 100%
Processing candidates (134 candidates): 100%
The following 124 package(s) will be affected (of 0 checked):

New packages to be INSTALLED:
	drm-66-kmod: 6.6.25.1501000_9 [FreeBSD-ports-kmods]
	nvidia-drm-66-kmod: 595.84.1500068_1 [FreeBSD-ports]

Installed packages to be UPGRADED:
	alacritty: 0.17.0_2 -> 0.17.0_3 [FreeBSD-ports]
	alsa-lib: 1.2.15.3 -> 1.2.16.1 [FreeBSD-ports]
	deno: 2.9.1_1 -> 2.9.1_2 [FreeBSD-ports]
	ebur128: 0.1.10_14 -> 0.1.10_15 [FreeBSD-ports]
	glslang: 16.3.0_1 -> 16.4.0 [FreeBSD-ports]
	glslang-shared: 16.3.0_1 -> 16.4.0 [FreeBSD-ports]
	gnupg: 2.5.20_1 -> 2.5.21 [FreeBSD-ports]
	gstreamer1: 1.28.4 -> 1.28.5_1 [FreeBSD-ports]
	gstreamer1-plugins: 1.28.4 -> 1.28.5 [FreeBSD-ports]
	gstreamer1-plugins-bad: 1.28.4 -> 1.28.5 [FreeBSD-ports]
	gstreamer1-plugins-gl: 1.28.4 -> 1.28.5 [FreeBSD-ports]
	gstreamer1-plugins-good: 1.28.4 -> 1.28.5 [FreeBSD-ports]
	gstreamer1-plugins-pulse: 1.28.4 -> 1.28.5 [FreeBSD-ports]
	gstreamer1-plugins-ugly: 1.28.4 -> 1.28.5 [FreeBSD-ports]
	jansson: 2.15.1 -> 2.15.1_1 [FreeBSD-ports]
	kf6-breeze-icons: 6.27.0 -> 6.28.0 [FreeBSD-ports]
	kf6-karchive: 6.27.0 -> 6.28.0 [FreeBSD-ports]
	kf6-kauth: 6.27.0 -> 6.28.0 [FreeBSD-ports]
	kf6-kbookmarks: 6.27.0 -> 6.28.0 [FreeBSD-ports]
	kf6-kcmutils: 6.27.0 -> 6.28.0 [FreeBSD-ports]
	kf6-kconfigwidgets: 6.27.0 -> 6.28.0 [FreeBSD-ports]
	kf6-kdbusaddons: 6.27.0 -> 6.28.0 [FreeBSD-ports]
	kf6-kdeclarative: 6.27.0 -> 6.28.0 [FreeBSD-ports]
	kf6-kded: 6.27.0 -> 6.28.0 [FreeBSD-ports]
	kf6-kdoctools: 6.27.0 -> 6.28.0 [FreeBSD-ports]
	kf6-kglobalaccel: 6.27.0 -> 6.28.0 [FreeBSD-ports]
	kf6-kiconthemes: 6.27.0 -> 6.28.0 [FreeBSD-ports]
	kf6-kio: 6.27.0 -> 6.28.0 [FreeBSD-ports]
	kf6-kirigami: 6.27.0 -> 6.28.0 [FreeBSD-ports]
	kf6-kitemmodels: 6.27.0 -> 6.28.0 [FreeBSD-ports]
	kf6-kjobwidgets: 6.27.0 -> 6.28.0 [FreeBSD-ports]
	kf6-knotifications: 6.27.0 -> 6.28.0 [FreeBSD-ports]
	kf6-knotifyconfig: 6.27.0 -> 6.28.0 [FreeBSD-ports]
	kf6-kparts: 6.27.0 -> 6.28.0 [FreeBSD-ports]
	kf6-kpty: 6.27.0 -> 6.28.0 [FreeBSD-ports]
	kf6-kservice: 6.27.0 -> 6.28.0 [FreeBSD-ports]
	kf6-ktextwidgets: 6.27.0 -> 6.28.0 [FreeBSD-ports]
	kf6-kwallet: 6.27.0 -> 6.28.0 [FreeBSD-ports]
	kf6-kwindowsystem: 6.27.0 -> 6.28.0 [FreeBSD-ports]
	kf6-kxmlgui: 6.27.0 -> 6.28.0 [FreeBSD-ports]
	kf6-prison: 6.27.0 -> 6.28.0 [FreeBSD-ports]
	kf6-purpose: 6.27.0 -> 6.28.0 [FreeBSD-ports]
	kf6-solid: 6.27.0 -> 6.28.0 [FreeBSD-ports]
	kf6-sonnet: 6.27.0 -> 6.28.0 [FreeBSD-ports]
	kf6-threadweaver: 6.27.0 -> 6.28.0 [FreeBSD-ports]
	libEMF: 1.0.13_1 -> 1.0.14 [FreeBSD-ports]
	libXpresent: 1.0.1 -> 1.0.2 [FreeBSD-ports]
	libarchive: 3.8.7,1 -> 3.8.8,1 [FreeBSD-ports]
	libdisplay-info: 0.3.0 -> 0.4.0 [FreeBSD-ports]
	libmatroska: 1.7.1 -> 1.7.2 [FreeBSD-ports]
	libmysofa: 1.3.4 -> 1.3.5 [FreeBSD-ports]
	libraqm: 0.10.3 -> 0.11.0 [FreeBSD-ports]
	librashader: 0.12.0 -> 0.12.0_1 [FreeBSD-ports]
	librist: 0.2.17 -> 0.2.18 [FreeBSD-ports]
	luajit: 2.1.0.20260629 -> 2.1.0.20260727 [FreeBSD-ports]
	mdcat: 2.7.1_13 -> 2.7.1_14 [FreeBSD-ports]
	mercurial: 7.1.2 -> 7.2.3 [FreeBSD-ports]
	mesa-dri: 26.1.4 -> 26.1.5_1 [FreeBSD-ports]
	mesa-libs: 26.1.5 -> 26.1.5_1 [FreeBSD-ports]
	mpv: 0.41.0_1,1 -> 0.41.0_2,1 [FreeBSD-ports]
	nushell: 0.114.0 -> 0.114.1_1 [FreeBSD-ports]
	pipewire: 1.6.6 -> 1.6.8 [FreeBSD-ports]
	poppler-qt5: 26.04.0 -> 26.04.0_1 [FreeBSD-ports]
	py310-build: 1.5.0 -> 1.5.1 [FreeBSD-ports]
	py311-build: 1.5.0 -> 1.5.1 [FreeBSD-ports]
	py312-argcomplete: 3.6.3 -> 3.7.0 [FreeBSD-ports]
	py312-asgiref: 3.11.1 -> 3.12.1 [FreeBSD-ports]
	py312-ast-serialize: 0.6.0 -> 0.6.0_1 [FreeBSD-ports]
	py312-bcrypt: 5.0.0_6 -> 5.0.0_7 [FreeBSD-ports]
	py312-build: 1.5.0 -> 1.5.1 [FreeBSD-ports]
	py312-cachecontrol: 0.14.0 -> 0.14.4 [FreeBSD-ports]
	py312-cffi: 2.0.0 -> 2.1.0 [FreeBSD-ports]
	py312-crosshair-tool: 0.0.107 -> 0.0.108 [FreeBSD-ports]
	py312-cryptography: 48.0.1,1 -> 48.0.1_1,1 [FreeBSD-ports]
	py312-filelock: 3.31.1 -> 3.32.0 [FreeBSD-ports]
	py312-hatchling: 1.30.1 -> 1.31.0 [FreeBSD-ports]
	py312-hypothesis: 6.155.7 -> 6.156.6_1 [FreeBSD-ports]
	py312-importlib-metadata: 8.7.1 -> 8.9.0 [FreeBSD-ports]
	py312-importlib-resources: 7.0.0 -> 7.1.0 [FreeBSD-ports]
	py312-librt: 0.11.0 -> 0.13.0 [FreeBSD-ports]
	py312-maturin: 1.14.1 -> 1.14.1_1 [FreeBSD-ports]
	py312-mkdocstrings: 1.0.4 -> 1.0.6 [FreeBSD-ports]
	py312-mypy: 2.1.0 -> 2.2.0 [FreeBSD-ports]
	py312-orjson: 3.11.4_6 -> 3.11.9_1 [FreeBSD-ports]
	py312-parso: 0.8.4_1 -> 0.8.7 [FreeBSD-ports]
	py312-pendulum: 3.2.0_3 -> 3.2.0_4 [FreeBSD-ports]
	py312-pre-commit: 4.6.0 -> 4.6.1 [FreeBSD-ports]
	py312-pydantic-core: 2.46.4_1 -> 2.46.4_2 [FreeBSD-ports]
	py312-pymdown-extensions: 11.0 -> 11.0.1 [FreeBSD-ports]
	py312-pyproject-metadata: 0.11.0 -> 0.12.1 [FreeBSD-ports]
	py312-pytest-env: 1.0.0 -> 1.1.2 [FreeBSD-ports]
	py312-pytest-randomly: 3.16.0 -> 4.0.0 [FreeBSD-ports]
	py312-pytest-rerunfailures: 15.0 -> 15.1 [FreeBSD-ports]
	py312-pytest-subprocess: 1.5.2_1 -> 1.5.4 [FreeBSD-ports]
	py312-python-discovery: 1.4.2 -> 1.5.0 [FreeBSD-ports]
	py312-pytz: 2026.2,1 -> 2026.3,1 [FreeBSD-ports]
	py312-rpds-py: 0.30.0_5 -> 0.30.0_6 [FreeBSD-ports]
	py312-ruff: 0.15.20 -> 0.16.0 [FreeBSD-ports]
	py312-scikit-build-core: 0.12.2 -> 1.0.3 [FreeBSD-ports]
	py312-tox: 4.36.1 -> 4.37.0 [FreeBSD-ports]
	py312-traitlets: 5.14.3 -> 5.15.1 [FreeBSD-ports]
	py312-types-setuptools: 82.0.0.20260518 -> 83.0.0.20260706 [FreeBSD-ports]
	py312-typing-extensions: 4.15.0 -> 4.16.0 [FreeBSD-ports]
	py312-tzdata: 2026.2 -> 2026.3 [FreeBSD-ports]
	py312-uv-build: 0.11.28 -> 0.12.0 [FreeBSD-ports]
	py312-virtualenv: 21.2.3 -> 21.7.0 [FreeBSD-ports]
	py312-websockets: 16.0 -> 16.1 [FreeBSD-ports]
	py312-xxhash: 3.8.0 -> 3.8.1 [FreeBSD-ports]
	py312-z3-solver: 4.16.0 -> 5.0.0.0_1 [FreeBSD-ports]
	py312-zipp: 3.23.0 -> 4.1.0 [FreeBSD-ports]
	py313t-build: 1.5.0 -> 1.5.1 [FreeBSD-ports]
	py314-build: 1.5.0 -> 1.5.1 [FreeBSD-ports]
	py315-build: 1.5.0 -> 1.5.1 [FreeBSD-ports]
	redis: 8.8.0 -> 8.8.1 [FreeBSD-ports]
	rust: 1.96.1 -> 1.97.1 [FreeBSD-ports]
	taglib: 2.3 -> 2.3.1 [FreeBSD-ports]
	uv: 0.11.29 -> 0.12.0 [FreeBSD-ports]
	vale: 3.15.1_1 -> 3.15.2 [FreeBSD-ports]
	wlroots020: 0.20.2 -> 0.20.2_1 [FreeBSD-ports]
	z3: 4.16.0.0 -> 5.0.0.0 [FreeBSD-ports]

Installed packages to be REINSTALLED:
	nvidia-drm-kmod-595.84 [FreeBSD-ports] (direct dependency changed: nvidia-drm-612-kmod (removed), nvidia-drm-66-kmod (added))
	sox-14.4.2.20210509_7 [FreeBSD-ports] (option changed: AMRNB (removed), AMR (added), AMRWB (removed), AO (added), AO (removed), FLAC (added), FLAC (removed), GSM (added), GSM (removed), ID3TAG (added), ID3TAG (removed), LADSPA (added), LADSPA (removed), LAME (added), LAME (removed), MAD (added), MAD (removed), OPUS (added), OPUS (removed), OSS (added), OSS (removed), PNG (added), PNG (removed), PULSEAUDIO (added), PULSEAUDIO (removed), SNDFILE (added), SNDFILE (removed), SNDIO (added), SNDIO (removed), SYMLINK (added))

Number of packages to be installed: 2
Number of packages to be upgraded: 120
Number of packages to be reinstalled: 2

The process will require 118 MiB more space.
435 MiB to be downloaded.

Proceed with this action? [y/N]:
Comment 3 Gleb Popov freebsd_committer freebsd_triage 2026-08-04 17:51:08 UTC
(In reply to Alexander Ziaee from comment #2)
As you can see, this is a nvidia-drm problem:

nvidia-drm-kmod-595.84 [FreeBSD-ports] (direct dependency changed:
nvidia-drm-612-kmod (removed), nvidia-drm-66-kmod (added))

For some reason it started depending on drm-66-kmod.
Comment 4 Alexander Ziaee freebsd_committer freebsd_triage 2026-08-04 17:54:03 UTC
That makes sense, I cc'ed nvidia maintainer as well already.

Note that the above output does not show trying to delete them because I have them locked:

# pkg lock --show-locked
Currently locked packages:
drm-612-kmod-6.12.85.1501501_1
nvidia-drm-612-kmod-595.84.1501501

This also exposes pkg-lock is broken, locked packages are not being all the way respected, I will file a separate issue on the pkg issue tracker.
Comment 5 Alexander Ziaee freebsd_committer freebsd_triage 2026-08-04 17:54:26 UTC
Thanks for taking a look Gleb.
Comment 6 Gleb Popov freebsd_committer freebsd_triage 2026-08-04 18:01:17 UTC
(In reply to Alexander Ziaee from comment #4)
pkg lock is OK, the plan does not contain package removals.
Comment 7 Tomoaki AOKI 2026-08-05 22:16:47 UTC
(In reply to Gleb Popov from comment #3)
Strange.

The logic to choose dependency in graphics/nvidia-drm-kmod/Makefile is as follows.

.if ${OPSYS} != FreeBSD
IGNORE=         not supported on anything but FreeBSD (missing linuxkpi functionality)
.else
.  if ${OSVERSION} >= 1500509 && ${ARCH} == amd64
RUN_DEPENDS+=	${KMODDIR}/nvidia-drm.ko:graphics/nvidia-drm-612-kmod${PKGNAMESUFFIX}
.  elif ${OSVERSION} >= 1500031 && ${ARCH} == amd64
RUN_DEPENDS+=	${KMODDIR}/nvidia-drm.ko:graphics/nvidia-drm-66-kmod${PKGNAMESUFFIX}
.  else
RUN_DEPENDS+=  ${KMODDIR}/nvidia-drm.ko:graphics/nvidia-drm-61-kmod${PKGNAMESUFFIX}
.  endif
.endif


15.1-RELEASE{-p*} should have __FreeBSD_version (== OSVERSION in ports framework) >= 1501000, thus, graphics/nvidia-drm-612-kmod should be chosen.
And stable/15 AFTER releng/15.1 branched has at minimum 1501500 (currently bumped to 1501501), which is larger than 1501000.

PKGNAMESUFFIX is for -580 and -devel variants (set by Makefile of each) and not set for graphics/nvidia-drm-kmod.

Note that graphics/nvidia-drm-kmod/Makefile.common is NOT used for graphics/nvidia-drm-kmod{-580|-devel}, but included by each "actual" kmod ports graphics/nvidia-drm-{515|61|66|612|latest}-kmod{-580|devel}.
Comment 8 Emmanuel Vadot freebsd_committer freebsd_triage 2026-08-06 08:38:35 UTC
Same "problem" as bug #297254, since we build packages on 15.0 drm-612 isn't built, so the nvidia-drm ports depends on drm-66.
Everything is ok here.
Comment 9 Alexander Ziaee freebsd_committer freebsd_triage 2026-08-06 22:40:04 UTC
(In reply to Emmanuel Vadot from comment #8)

Please consider the usage and not the architecture. People have broken drm-66, we have ported an entire year later of work to 15.1, and yet the architecture is preventing it from being available, this is absolutely a bug. Further, if you compile it manually, it makes pkg upgrade unusable completely because it tries to downgrade.

This is absolutely a pile of bugs and a broken UX.
Comment 10 Alexander Ziaee freebsd_committer freebsd_triage 2026-08-08 19:13:36 UTC
Demonstration of pkg lock malfunctioning:

# pkg lock -l
Currently locked packages:
drm-612-kmod-6.12.85.1501501_1
nvidia-drm-612-kmod-595.84.1501501
# pkg upg
Updating FreeBSD-ports repository catalogue...
FreeBSD-ports repository is up to date.
Updating FreeBSD-ports-kmods repository catalogue...
FreeBSD-ports-kmods repository is up to date.
All repositories are up to date.
Checking for upgrades (11 candidates): 100%
Processing candidates (11 candidates): 100%
The following 5 package(s) will be affected (of 0 checked):

New packages to be INSTALLED:
	drm-66-kmod: 6.6.25.1501000_9 [FreeBSD-ports-kmods]
	nvidia-drm-66-kmod: 595.91.07.1500068 [FreeBSD-ports]

Installed packages to be UPGRADED:
	nvidia-driver: 595.84 -> 595.91.07 [FreeBSD-ports]
	nvidia-drm-kmod: 595.84 -> 595.91.07 [FreeBSD-ports]
	nvidia-kmod: 595.84.1500068 -> 595.91.07.1500068 [FreeBSD-ports]

Number of packages to be installed: 2
Number of packages to be upgraded: 3

The process will require 18 MiB more space.
235 MiB to be downloaded.

Proceed with this action? [y/N]:
Comment 11 Gleb Popov freebsd_committer freebsd_triage 2026-08-08 19:20:18 UTC
(In reply to Alexander Ziaee from comment #10)
See comment #6, the plan does not touch drm-612-kmod.
Comment 12 Kyle Evans freebsd_committer freebsd_triage 2026-08-09 00:25:44 UTC
(In reply to Alexander Ziaee from comment #10)

Did you try locking the meta packages like I suggested?
Comment 13 Alexander Ziaee freebsd_committer freebsd_triage 2026-08-11 17:44:06 UTC
(In reply to Kyle Evans from comment #12)

Yes, the first time it did not resolve the pkg upg plan being crazy, however the second time I uninstalled all drm related everything, built them all as deps of nvidia-drm-kmod, and then locked that.

So, we have to see what happens when there's updates.