Page MenuHomeFreeBSD

nvidia-drm-kmod: bump distinfo after drm-kmod updates
AbandonedPublic

Authored by ashafer_badland.io on Oct 26 2024, 4:39 AM.
Tags
None
Referenced Files
Unknown Object (File)
Mon, Dec 23, 4:14 AM
Unknown Object (File)
Sun, Dec 22, 6:36 PM
Unknown Object (File)
Sun, Dec 22, 7:03 AM
Unknown Object (File)
Fri, Nov 29, 10:59 PM
Unknown Object (File)
Oct 29 2024, 11:07 PM
Unknown Object (File)
Oct 26 2024, 8:09 AM

Details

Reviewers
kbowling
Summary

This fixes compilation issues with the latest ports tree as the
nvidia-drm-kmod ports were not bumped alongside the drm-kmod ports.

Diff Detail

Repository
R11 FreeBSD ports repository
Lint
Lint Skipped
Unit
Tests Skipped
Build Status
Buildable 60199
Build 57083: arc lint + arc unit

Event Timeline

ashafer_badland.io created this revision.

Looks good to me.
Once this lands, I'll update my patch at Bug 282312 for further reviews.

Updated my patch at Bug 282312 as rev3, chasing @manu's commit, for further reviews.
And this review (D47290) can now be closed as of:

commit f2a03a6a45607086a94ee1aa9b9b847b0734da6b
graphics/nvidia-drm-515-kmod: Bump version after drm-515-kmod update
https://cgit.freebsd.org/ports/commit/?id=f2a03a6a45607086a94ee1aa9b9b847b0734da6b

and

commit 2716dbb157611eaae6e578d86202d86910026562
graphics/nvidia-drm-61-kmod: Bump version after drm-61-kmod update
https://cgit.freebsd.org/ports/commit/?id=2716dbb157611eaae6e578d86202d86910026562

Thanks, @manu for commiting!

Updated my patch at Bug 282312 as rev3, chasing @manu's commit, for further reviews.
And this review (D47290) can now be closed as of:

commit f2a03a6a45607086a94ee1aa9b9b847b0734da6b
graphics/nvidia-drm-515-kmod: Bump version after drm-515-kmod update
https://cgit.freebsd.org/ports/commit/?id=f2a03a6a45607086a94ee1aa9b9b847b0734da6b

and

commit 2716dbb157611eaae6e578d86202d86910026562
graphics/nvidia-drm-61-kmod: Bump version after drm-61-kmod update
https://cgit.freebsd.org/ports/commit/?id=2716dbb157611eaae6e578d86202d86910026562

Thanks, @manu for commiting!

Yeah sorry I've missed this review before commiting.
@ashafer_badland.io btw when I update drm-kmod and if I forgot to refresh the nvidia ports we need to bump PORTREVISION (as the package changed we can't have the same pkgname).

No worries, thanks for submitting a fix.

@ashafer_badland.io @manu it seems like there might still be some remaining in drm-kmod, this is still failing for me and @junchoon_dec.sakura.ne.jp

@ashafer_badland.io @manu it seems like there might still be some remaining in drm-kmod, this is still failing for me and @junchoon_dec.sakura.ne.jp

@kbowling, does it still fail with rev5 of the patch at Bug 282312?
It includes workaround in graphics/nvidia-drm-kmod/Makefile.common, obtained from (with a change of a variable to fit with this) freebsd-current ML by Benjamin Jacobs. And it doesn't fail on stable/14 (still clang18), so something changed in clang19 on main (any of new default option, maybe) is causing the issue.

https://lists.freebsd.org/archives/freebsd-current/2024-October/006558.html

@ashafer_badland.io @manu it seems like there might still be some remaining in drm-kmod, this is still failing for me and @junchoon_dec.sakura.ne.jp

@kbowling, does it still fail with rev5 of the patch at Bug 282312?
It includes workaround in graphics/nvidia-drm-kmod/Makefile.common, obtained from (with a change of a variable to fit with this) freebsd-current ML by Benjamin Jacobs. And it doesn't fail on stable/14 (still clang18), so something changed in clang19 on main (any of new default option, maybe) is causing the issue.

https://lists.freebsd.org/archives/freebsd-current/2024-October/006558.html

No your workaround is good but I think the path needs to be dropped in drm-kmod

@ashafer_badland.io @manu it seems like there might still be some remaining in drm-kmod, this is still failing for me and @junchoon_dec.sakura.ne.jp

@kbowling, does it still fail with rev5 of the patch at Bug 282312?
It includes workaround in graphics/nvidia-drm-kmod/Makefile.common, obtained from (with a change of a variable to fit with this) freebsd-current ML by Benjamin Jacobs. And it doesn't fail on stable/14 (still clang18), so something changed in clang19 on main (any of new default option, maybe) is causing the issue.

https://lists.freebsd.org/archives/freebsd-current/2024-October/006558.html

No your workaround is good but I think the path needs to be dropped in drm-kmod

What's strange are that:

*graphics/drm-61-kmod does not fail for me without workaround.
*Filenames of distfile differs (non-nvidia-specific one) in graphics/drm-*-kmod and graphics/nvidia-drm-*-kmod,
 but their size and SHA256 hash matches, so the contents should (usually) 100% matches.

Not sure why the workaround is needed only for graphics/nvidia-drm-*-kmod only.

A possibility is that all fixes in drm-kmod upstream are anywhere nvidia-drm-*-kmod builds and left some more that nvidia-drm-*-kmod build picks. The fixes in upstream seems to remove "CFLAGS+= -I${.CURDIR:H:H}/linuxkpi/dummy/include" lines from Makefile here and there, according to commit logs.

Not sure which leftover is affecting here, but at least (not sure actually picked or not though) ,
https://github.com/freebsd/drm-kmod/blob/master/drm/Makefile
still has

CFLAGS+= -I${.CURDIR:H}/linuxkpi/dummy/include # fallback to dummy
CFLAGS+= -I${SYSDIR}/compat/linuxkpi/dummy/include

lines.

Yes the drm-kmod builds fine now it is just the nvida-drm kmod which is still failing, probably uses some more features like you see.

I've never dug into upstream repo of drm-kmod before, so possibly I'm overlooking or mis-understanding, but tag name drm_v5.10.163_7 (specified by graphics/drm-510-kmod/Makefile.version) still has linuxkpi/dummy/include, so it wouldn't be affected.
So, our options would be:

a) Commit rev5 of the patch at Bug 282312 as-is, and once upstream addressed this issue,
   revert graphics/nvidia-drm-kmod/Makefile.common part of the patch and bump portrevision.

b) Drop graphics/nvidia-drm-kmod/Makefile.common part of the patch and create patch for
   graphics/nvidia-drm-[515|61] kmod (or reimplace) to remove unwanted include paths,
   and once upstream addressed this issue, remove the temporary patch and bump portrevision.

c) Simply wait for upstream and do not commit workarounds.

Option b) needs investigations and c) could take some more days (would need investigating whether or not the fixes break upstream).

Intermediate results of option b).
Look for the offending lines after make patch for graphics/nvidia-drm-61-kmod without the workaround by

% rg "^CFLAGS.*CURDIR.*\/linuxkpi\/dummy\/include" /usr/ports/graphics/nvidia-drm-61-kmod/work/
/usr/ports/graphics/nvidia-drm-61-kmod/work/drm-kmod-drm_v6.1.92_2/drm/Makefile
128:CFLAGS+= -I${.CURDIR:H}/linuxkpi/dummy/include # fallback to dummy

/usr/ports/graphics/nvidia-drm-61-kmod/work/drm-kmod-drm_v6.1.92_2/ttm/Makefile
33:CFLAGS+= -I${.CURDIR:H}/linuxkpi/dummy/include

/usr/ports/graphics/nvidia-drm-61-kmod/work/drm-kmod-drm_v6.1.92_2/dummygfx/Makefile
16:CFLAGS+= -I${.CURDIR:H}/linuxkpi/dummy/include

3 files above are detected.
As this test is done on stable/14, any workrounds are actually unneeded, and unfortunately I cannot take time to switch to main and test now, replacing workaround on rev5 of the patch to REINPLACE is unknown to work or not.

Found the root cause in nvidia codes. No need to touch upstream graphics/drm-[515|61]-kmod side.

${WRKSRC}/Makefile had a line below and removing this fixed the issue.

-I${DRMKMODDIR}/linuxkpi/dummy/include/ \

Now considering 2 way to fix.

d) Put a patch for Makefile in graphics/nvidia-drm-[510|515|61]-kmod/files/
e) Replace current workaround in graphics/nvidia-drm-kmod/Makefile.common
   with ${REINPLACE_CMD}.

Deleting 3 lines I noted previous comment alone didn't help in all conbinations.

Maybe option e) would be better, as it needs to modify single file and wouldn't break builds when distfile of x11/nvidia-driver fixes the offending Makefile in future releases. Simply does nothing as no match should be found in the case.

Uploaded updated patch (rev6) using option e) at Bug 282312.