Page MenuHomeFreeBSD

graphics/nvidia-drm-kmod: Make distinfo auto-merged on build
Needs ReviewPublic

Authored by junchoon_dec.sakura.ne.jp on May 10 2025, 2:27 PM.
Tags
None
Referenced Files
Unknown Object (File)
Tue, Jul 1, 6:00 PM
Unknown Object (File)
Mon, Jun 30, 5:56 AM
Unknown Object (File)
Sat, Jun 28, 7:53 AM
Unknown Object (File)
Wed, Jun 25, 3:32 AM
Unknown Object (File)
Mon, Jun 23, 11:14 AM
Unknown Object (File)
Mon, Jun 23, 3:46 AM
Unknown Object (File)
Mon, Jun 23, 3:46 AM
Unknown Object (File)
Sun, Jun 22, 10:14 PM
Subscribers

Details

Reviewers
manu
kbowling
ashafer
arrowd
Group Reviewers
x11
Summary

graphics/nvidia-drm-kmod: Make distinfo auto-merged on build

Currently, distinfo for graphics/nvidia-drm-*-kmod are required
to be updated manually when whichever of x11/nvidia-driver and
corresponding graphics/drm-*-kmod is upgraded, not to be forgotton
to be updated/committed.

And with graphics/drm-*-kmod part, although the contents of
their distfile always 100% matches, the downloaded filename
differs as of the differences of the method for downloading,
avoiding to simply replace corresponding part of distinfo
with the ones for gaphics/drm-*-kmod.

This change removes existing distinfo from graphics/nvidia-drm-*-kmod
and merges distinfo for x11/nvidia-driver and corresponding
graphics/drm-*-kmod on-the-fly on fetch and cleans up on
clean phase of builds.

This distinfo merges should be sane, as each source distinfo are already
confirmed by their maintainers / committers on commit.

Also includes changes of distfile names for DRM part to match
with graphics/drm-*-kmod to allow auto-merge.

This change depends on D50142 that splits distinfo of x11/nvidia-driver
into master and each legacy ports.

Depends on: D50142

Diff Detail

Repository
R11 FreeBSD ports repository
Lint
Lint Skipped
Unit
Tests Skipped

Event Timeline

Now that distinfo's are separated, why do we need this autogen stuff at all?

I do see the improvement here for the drm maintainers not having to deal with all this, but I'd like someone with more ports infra experience to evaluate the implementation.

graphics/nvidia-drm-kmod/Makefile.common
9

as in the other rev the portrevision does not need to be bumped here since the package will not change

Rebase after commit 3adb70282914 and commit 8495963ac01c.
Stopped bumping PORTREVISION as pointed out by kbowling@.

Note that commit 9506d5a4e713 does not affect this review (prerequisite for this, though)..

So, while I am still not sure what problem we're solving here, this what I came up with:

diff --git a/x11/nvidia-driver/Makefile.common b/x11/nvidia-driver/Makefile.common
index 1236ca04b803..ff5e84ea5197 100644
--- a/x11/nvidia-driver/Makefile.common
+++ b/x11/nvidia-driver/Makefile.common
@@ -26,3 +26,20 @@ NVVERSION=   ${DISTVERSION:S/./.0/}                          # allow minor > 99
 NVVERSION=     ${DISTVERSION}
 .  endif
 .endif
+
+MAKESUM_PORTS= graphics/nvidia-drm-510-kmod \
+               graphics/nvidia-drm-515-kmod \
+               graphics/nvidia-drm-61-kmod \
+               graphics/nvidia-drm-66-kmod \
+               x11/nvidia-driver \
+               x11/nvidia-driver-304 \
+               x11/nvidia-driver-340 \
+               x11/nvidia-driver-390 \
+               x11/nvidia-driver-470
+
+.ifndef REAL_MAKESUM
+makesum:
+.  for p in ${MAKESUM_PORTS}
+       ${MAKE} -C ${PORTSDIR}/${p} makesum REAL_MAKESUM=yes
+.  endfor
+.endif

Now running make makesum for any port that includes x11/nvidia-driver/Makefile.common causes recursive makesum on all ${MAKESUM_PORTS}. Does that solve the problem?

Thanks for the idea!

With this approach, graphics/drm-[510|515|61|66]-kmod need the same, too.
This is because graphics/nvidia-drm-[510|515|61|66]-kmod requires distfiles of both x11/nvidia-driver and corresponding graphics/drm-[510|515|61|66]-kmod.

And as graphics/nvidia-drm-[510|515|61|66]-kmod don't support legacy versions of drivers, x11/nvidia-driver-[304|340|390|470], these can be dropped.

Anyway, what approach manu@ wants is quite important here, as he is maintaining graphics/drm-[510|515|61|66]-kmod..

graphics/nvidia-drm-kmod/Makefile.common
9

Stopped bumping PORTREVISION.

Rebase after commit 940ca091de52.
Keeping concept until manu@ pops in as the de-facto maintainer of graphics/drm-*-kmod.

I'm ok for this but keep in mind that we will still need to bump PORTREVISION on nvidia kmod when we update drm-*-kmod so I'm not sure it's worth doing all that tbh

I'm ok for this but keep in mind that we will still need to bump PORTREVISION on nvidia kmod when we update drm-*-kmod so I'm not sure it's worth doing all that tbh

Thanks for your comment!

So as x11/nvidia-driver updates. And once something wrong happenes, fixes are still needed.

The advantage of this would be avoiding any of distinfo for graphics/nvidia-drm-*-kmod is/are missed to be updated.
Official pkg for DRM-related kmods are often broken for anything except the very Release that official pkgs are built on.

And on kernel updates, usually rebuild/reinstall is necessary. In these cases, missed bump are not affect. So a bit of delay would be allowable.

Even if auto-merging is not accepted, changes for distfile names would help you.
With changes of line 7 and 11 of graphics/nvidia-drm/Makefile.common, distfile names match with graphics/drm-*-kmod. At least these 2 lines would be worth committing.

Should I split out line 7 and 11 of graphics/nvidia-drm-kmod/Makefile.common, which renames drm-*-kmod part of distfiles to match graphics/drm-*-kmod, to be a separate review and make this (D50282) to depend on it?

mat added inline comments.
graphics/nvidia-drm-kmod/Makefile.common
7

This should probably be using USE_GITHUB.

47–51

This is writing in .CURDIR. The only place a port is allowed to write during the build is WRKDIR. In fetch, you are also allowed to write in DISTDIR as it's where the distfiles are fetched.

graphics/nvidia-drm-kmod/Makefile.common
7

I've once tried, without success. Using USE_GITHUB, previous line (nvidia) always failed. So this code is.

47–51

distinfo is needed on fetch and extract, and the latter uses wrkdir.

The most sane way would be adding something like LSTDIR in ports framework just for this kind of use-cases and use it (maybe ${.CURDIR}/lstdir like ${.CURDIR}/wrkdir), but it beyonds me.
If anyone possible implements it, I'll be happy to use it.

Why I've chosen this is because I don't want to pollute /usr/ports/distfiles/ especially when the build is interrupted by admins. Polluting shared place like distfiles/ makes it harder to clean up later in such an edge cases.

Anyway, thanks for your advice!

graphics/nvidia-drm-kmod/Makefile.common
7

Without having the example of what you actually did, it's hard to figure out why it failed.
If you used USE_GITHUB=yes, it probably would have failed, yes, you probably need USE_GITHUB=nodefault, but as I said, without the code, it's hard to figure out what went wrong.

graphics/nvidia-drm-kmod/Makefile.common
7

Sorry, I've not generated diff of what I did at the moment as it failed.
But IIRC, I've deleted lines for graphics/drm-*-kmod both for MASTER_SITES and DISTFILES, keeping lines for x11/nvidia-driver (removing line continuation "\" at the end), and then, copied what graphics/drm-*-kmod does for GH_* instead. Tried both before MASTER_SITES and after DISTFILES.

IIRC, fetch failed by attempting to download nvidia part of distfiles from GitHub.