• Re: [gentoo-dev] Re: [PATCH 4/5] linux-mod-r1.eclass: make modules_proc

    From Ionen Wolkens@21:1/5 to Ionen Wolkens on Wed Mar 19 02:00:01 2025
    On Tue, Mar 18, 2025 at 08:34:43PM -0400, Ionen Wolkens wrote:
    On Tue, Mar 18, 2025 at 03:14:13AM -0000, Duncan wrote:
    Nowa Ammerlaan posted on Mon, 17 Mar 2025 11:11:06 +0100 as excerpted:

    I had really hoped to receive more comments on my earlier RFC. [...]
    I really do want to know what others think so I can
    make a better judgment on whether or not my idea is really this crazy
    and if I should just shut up about it or not (so dear reader if you have an opinion then please share).

    So because I carried over my own already "works for me" kernel maintenance scripts from Mandrake when I switched in 2004 and have continued maintaining and using them over the decades since, I normally try to stay out of Gentoo kernel packaging discussion. But given both the above explicit invitation and that as I've read the thread a thought occurred to me...

    First, DKMS /is/ a cross-distro standard solution. As such, I believe in general it should be reasonably supported in Gentoo unless it simply doesn't make sense (note that "doesn't make sense" can also include the case of simply no one stepping up to do it, not the case here).

    But, the thought that occurred to me reading the thread, was that there are obvious parallels between this and another very significant and controversial now "cross distro standard solution" (which I guess I don't need to name explicitly).

    As there, I believe "the Gentoo approach" should (again assuming developer willingness to do the work, seemingly the case here) make it available as an additional integrated *option*, while keeping the current Gentoo option as well.

    So I support DKMS integration /as/ /an/ /option/.

    If anything, if go forward with this, I'd rather that it be with the
    plan to (eventually) either make it the default after enough testing
    and then later drop support for the old way entirely (then merge the eclasses), or revert if we think it's no good.

    One of the thing I did not like here is the idea to gain more ways
    to do the same thing that need to be tested to ensure some quality.
    Can't ignore it and leave it all to Nowa given if e.g. nvidia changes
    some path or something else and I don't test it on bump, then I push
    a broken package for all dkms users until someone reports it. Would
    even need to boot with it to be sure.

    It's nice to have choices in general, but still need to draw some
    lines to keep things maintainable.

    And if picking, in the end do we pick an option that requires to
    install sources and (imo) adds very little, or let the PM (that has
    access to sources unlike binary distros) handle it (with full control
    for handling issues) just like for dist kernels and improve on that
    as needed?

    Either way, as I said initially, I won't revert if this gets merged
    (even if optional forever). Just stating that I don't like it and
    probably won't offer real support, not blocking it.

    wrt merging eclasses, could add that I wasn't really against the
    support for this being in linux-mod-r1 directly except for the part
    where it did not work when not using modlist being confusing, in the
    end I'd probably just have asked for Nowa to add themselves as
    maintainer.

    (by the modlist bit, by that I meant initially -- I know dkms support
    been added to emake-type ebuilds too now)

    On a related note about modlist, I've been semi-regretting keeping that modlist-type idea from the original linux-mod eclass and felt that a
    simple emake wrapper (incl. modules args) for all packages "might" have
    been better and easier to use for ebuilds and not miss modules on bump
    and had been pondering "potential" deprecation in the future (not that
    I had really explored that idea yet, would need to check packages).
    --
    ionen

    -----BEGIN PGP SIGNATURE-----

    iQEzBAABCAAdFiEEx3SLh1HBoPy/yLVYskQGsLCsQzQFAmfaFiQACgkQskQGsLCs QzQJfAgAgAbOaYClzedwGsWVbBVhA9Kof5722zAZlwU+Sg3Nh30eV021WZAjKnTd v6QElXJf/b5H7SnOVFReDZ0qp/vC3o+Rsc1odfHG/jd7Pevh4WkMXfr0wuKxZ7BQ PQ87R35LPFm/Zyr1u2x6luohBgBph9zvOBiJVhAUOFzMFdqTFmAYfb5CXvnsRqsB nWO/AFtBA5PQXVJnkdMI/+N/jVra20o1hXi8aIwGiFuuhYSrCwWtHDr66at0Rqlq Bt7O1yE6i9cYEh6si0IsUFyD5MMSbEeTWcPMjeE/OyyX5pTs7BBxXQL4Yqo6Wpdn qwh2c306VV6buDPO4G8HUAXJs1Swmw==
    =lsGX
    -----END PGP SIGNATURE-----

    --- SoupGate-Win32 v1.05
    * Origin: fsxNet Usenet Gateway (21:1/5)
  • From Ionen Wolkens@21:1/5 to Duncan on Wed Mar 19 01:40:01 2025
    On Tue, Mar 18, 2025 at 03:14:13AM -0000, Duncan wrote:
    Nowa Ammerlaan posted on Mon, 17 Mar 2025 11:11:06 +0100 as excerpted:

    I had really hoped to receive more comments on my earlier RFC. [...]
    I really do want to know what others think so I can
    make a better judgment on whether or not my idea is really this crazy
    and if I should just shut up about it or not (so dear reader if you have
    an opinion then please share).

    So because I carried over my own already "works for me" kernel maintenance scripts from Mandrake when I switched in 2004 and have continued
    maintaining and using them over the decades since, I normally try to stay out of Gentoo kernel packaging discussion. But given both the above
    explicit invitation and that as I've read the thread a thought occurred to me...

    First, DKMS /is/ a cross-distro standard solution. As such, I believe in general it should be reasonably supported in Gentoo unless it simply
    doesn't make sense (note that "doesn't make sense" can also include the
    case of simply no one stepping up to do it, not the case here).

    But, the thought that occurred to me reading the thread, was that there
    are obvious parallels between this and another very significant and controversial now "cross distro standard solution" (which I guess I don't need to name explicitly).

    As there, I believe "the Gentoo approach" should (again assuming developer willingness to do the work, seemingly the case here) make it available as
    an additional integrated *option*, while keeping the current Gentoo option as well.

    So I support DKMS integration /as/ /an/ /option/.

    If anything, if go forward with this, I'd rather that it be with the
    plan to (eventually) either make it the default after enough testing
    and then later drop support for the old way entirely (then merge the
    eclasses), or revert if we think it's no good.

    One of the thing I did not like here is the idea to gain more ways
    to do the same thing that need to be tested to ensure some quality.
    Can't ignore it and leave it all to Nowa given if e.g. nvidia changes
    some path or something else and I don't test it on bump, then I push
    a broken package for all dkms users until someone reports it. Would
    even need to boot with it to be sure.

    It's nice to have choices in general, but still need to draw some
    lines to keep things maintainable.

    And if picking, in the end do we pick an option that requires to
    install sources and (imo) adds very little, or let the PM (that has
    access to sources unlike binary distros) handle it (with full control
    for handling issues) just like for dist kernels and improve on that
    as needed?

    Either way, as I said initially, I won't revert if this gets merged
    (even if optional forever). Just stating that I don't like it and
    probably won't offer real support, not blocking it.

    wrt merging eclasses, could add that I wasn't really against the
    support for this being in linux-mod-r1 directly except for the part
    where it did not work when not using modlist being confusing, in the
    end I'd probably just have asked for Nowa to add themselves as
    maintainer.

    On a related note about modlist, I've been semi-regretting keeping that modlist-type idea from the original linux-mod eclass and felt that a
    simple emake wrapper (incl. modules args) for all packages "might" have
    been better and easier to use for ebuilds and not miss modules on bump
    and had been pondering "potential" deprecation in the future (not that
    I had really explored that idea yet, would need to check packages).
    --
    ionen

    -----BEGIN PGP SIGNATURE-----

    iQEzBAABCAAdFiEEx3SLh1HBoPy/yLVYskQGsLCsQzQFAmfaESMACgkQskQGsLCs QzQvDQgApIWIVWJmkEzcegWZ+lIfijSkrt7oRDVWp0q6IJGyp2xNkrehh3E7MfoK oClgnPVIT77CuDv+gZOQBTESfs+8ILDC3TzjEgLHyKsMNGKLiJg7hIJpze3xfKLq Z3eP4U88ZsonE+bWxfTNFCG8sIZMYWdPUeFXx7S6f8/GzV4bWnawj94JJjOyDRqo JIq6LIYqFHzXoiYRW1HRQ28dGMGFsF/DYM66xhgcfXTeEimDJkhFxL0/mfBFAEQY 34sLgUfdDKsVoeUcbuUyX3k5znyskemrsjm24ueV3CIfDdJ9Tl447MY/HBadIGjI VQ2ysDo4kP8Po7zchy+IhM1tMV7GlQ==
    =QTdy
    -----END PGP SIGNATURE-----

    --- SoupGate-Win32 v1.05
    * Origin: fsxNet Usenet Gateway (21:1/5)
  • From Ionen Wolkens@21:1/5 to Ionen Wolkens on Wed Mar 19 02:10:01 2025
    On Tue, Mar 18, 2025 at 08:34:43PM -0400, Ionen Wolkens wrote:
    On Tue, Mar 18, 2025 at 03:14:13AM -0000, Duncan wrote:
    Nowa Ammerlaan posted on Mon, 17 Mar 2025 11:11:06 +0100 as excerpted:

    I had really hoped to receive more comments on my earlier RFC. [...]
    I really do want to know what others think so I can
    make a better judgment on whether or not my idea is really this crazy
    and if I should just shut up about it or not (so dear reader if you have an opinion then please share).

    So because I carried over my own already "works for me" kernel maintenance scripts from Mandrake when I switched in 2004 and have continued maintaining and using them over the decades since, I normally try to stay out of Gentoo kernel packaging discussion. But given both the above explicit invitation and that as I've read the thread a thought occurred to me...

    First, DKMS /is/ a cross-distro standard solution. As such, I believe in general it should be reasonably supported in Gentoo unless it simply doesn't make sense (note that "doesn't make sense" can also include the case of simply no one stepping up to do it, not the case here).

    But, the thought that occurred to me reading the thread, was that there are obvious parallels between this and another very significant and controversial now "cross distro standard solution" (which I guess I don't need to name explicitly).

    As there, I believe "the Gentoo approach" should (again assuming developer willingness to do the work, seemingly the case here) make it available as an additional integrated *option*, while keeping the current Gentoo option as well.

    So I support DKMS integration /as/ /an/ /option/.

    If anything, if go forward with this, I'd rather that it be with the
    plan to (eventually) either make it the default after enough testing
    and then later drop support for the old way entirely (then merge the eclasses), or revert if we think it's no good.

    One of the thing I did not like here is the idea to gain more ways
    to do the same thing that need to be tested to ensure some quality.
    Can't ignore it and leave it all to Nowa given if e.g. nvidia changes
    some path or something else and I don't test it on bump, then I push
    a broken package for all dkms users until someone reports it. Would
    even need to boot with it to be sure.

    It's nice to have choices in general, but still need to draw some
    lines to keep things maintainable.

    And if picking, in the end do we pick an option that requires to
    install sources and (imo) adds very little, or let the PM (that has
    access to sources unlike binary distros) handle it (with full control
    for handling issues) just like for dist kernels and improve on that
    as needed?

    Either way, as I said initially, I won't revert if this gets merged
    (even if optional forever). Just stating that I don't like it and
    probably won't offer real support, not blocking it.

    wrt merging eclasses, could add that I wasn't really against the
    support for this being in linux-mod-r1 directly except for the part
    where it did not work when not using modlist being confusing, in the
    end I'd probably just have asked for Nowa to add themselves as
    maintainer.

    On a related note about modlist, I've been semi-regretting keeping that modlist-type idea from the original linux-mod eclass and felt that a
    simple emake wrapper (incl. modules args) for all packages "might" have
    been better and easier to use for ebuilds and not miss modules on bump
    and had been pondering "potential" deprecation in the future (not that
    I had really explored that idea yet, would need to check packages).

    (this was in my notes of things to consider for EAPI 9, but likely won't
    try if there is another eclass built upon linux-mod-r1 that I need to
    not break)
    --
    ionen

    -----BEGIN PGP SIGNATURE-----

    iQEzBAABCAAdFiEEx3SLh1HBoPy/yLVYskQGsLCsQzQFAmfaGOUACgkQskQGsLCs QzSpfAgArw/2poxERhexgnOqqRbNCGH+LocA6qjEPNdxbMJxsGuAUFUjQBJl/b5q CKo4MVJwT3YEzDc2HjNTJofuOEP2lfQmSfjoN25sWy6od8KvVl0n3TAd+aTRNkhg u1cbHa+H1DqINXWn9rhYogsi1Q8WhhUKmZE0n8qf1UhbkwhKwGxgBNIMz37hPSPJ veaWpvIK2uQg8ZAjCj149loeOVV3PhsWf24sclgngCFOOpZz+ZQ11XEwo0WtPXL5 8nZ6MzMePmnB4CiMWFUygNYy2oQzqYShLFDExILxEMyzyUzZ3lglO6o7JEHVRD+v yKcnF88pxA53RgZG4cEPqx+WzDLY1w==
    =+pyA
    -----END PGP SIGNATURE-----

    --- SoupGate-Win32 v1.05
    * Origin: fsxNet Usenet Gateway (21:1/5)
  • From Ionen Wolkens@21:1/5 to Ionen Wolkens on Wed Mar 19 04:10:01 2025
    On Tue, Mar 18, 2025 at 08:34:43PM -0400, Ionen Wolkens wrote:
    On Tue, Mar 18, 2025 at 03:14:13AM -0000, Duncan wrote:
    Nowa Ammerlaan posted on Mon, 17 Mar 2025 11:11:06 +0100 as excerpted:

    I had really hoped to receive more comments on my earlier RFC. [...]
    I really do want to know what others think so I can
    make a better judgment on whether or not my idea is really this crazy
    and if I should just shut up about it or not (so dear reader if you have an opinion then please share).

    So because I carried over my own already "works for me" kernel maintenance scripts from Mandrake when I switched in 2004 and have continued maintaining and using them over the decades since, I normally try to stay out of Gentoo kernel packaging discussion. But given both the above explicit invitation and that as I've read the thread a thought occurred to me...

    First, DKMS /is/ a cross-distro standard solution. As such, I believe in general it should be reasonably supported in Gentoo unless it simply doesn't make sense (note that "doesn't make sense" can also include the case of simply no one stepping up to do it, not the case here).

    But, the thought that occurred to me reading the thread, was that there are obvious parallels between this and another very significant and controversial now "cross distro standard solution" (which I guess I don't need to name explicitly).

    As there, I believe "the Gentoo approach" should (again assuming developer willingness to do the work, seemingly the case here) make it available as an additional integrated *option*, while keeping the current Gentoo option as well.

    So I support DKMS integration /as/ /an/ /option/.

    If anything, if go forward with this, I'd rather that it be with the
    plan to (eventually) either make it the default after enough testing
    and then later drop support for the old way entirely (then merge the eclasses), or revert if we think it's no good.

    One of the thing I did not like here is the idea to gain more ways
    to do the same thing that need to be tested to ensure some quality.
    Can't ignore it and leave it all to Nowa given if e.g. nvidia changes
    some path or something else and I don't test it on bump, then I push
    a broken package for all dkms users until someone reports it. Would
    even need to boot with it to be sure.

    And looking at ebuilds in the PR, fair amount of ebuilds now have
    extra `use dkms` logic to consider and not fully transparently handled
    by the eclass. I'd rather see this dropped in the future to support
    only one way whichever it is.


    It's nice to have choices in general, but still need to draw some
    lines to keep things maintainable.

    And if picking, in the end do we pick an option that requires to
    install sources and (imo) adds very little, or let the PM (that has
    access to sources unlike binary distros) handle it (with full control
    for handling issues) just like for dist kernels and improve on that
    as needed?

    ...not that I feel the dkms way is the right one (for us).


    Either way, as I said initially, I won't revert if this gets merged
    (even if optional forever). Just stating that I don't like it and
    probably won't offer real support, not blocking it.

    wrt merging eclasses, could add that I wasn't really against the
    support for this being in linux-mod-r1 directly except for the part
    where it did not work when not using modlist being confusing, in the
    end I'd probably just have asked for Nowa to add themselves as
    maintainer.

    On a related note about modlist, I've been semi-regretting keeping that modlist-type idea from the original linux-mod eclass and felt that a
    simple emake wrapper (incl. modules args) for all packages "might" have
    been better and easier to use for ebuilds and not miss modules on bump
    and had been pondering "potential" deprecation in the future (not that
    I had really explored that idea yet, would need to check packages).
    --
    ionen

    -----BEGIN PGP SIGNATURE-----

    iQEzBAABCAAdFiEEx3SLh1HBoPy/yLVYskQGsLCsQzQFAmfaNJcACgkQskQGsLCs QzQAEQgAvGF91JB/t3roEq8Ru34C4Souc/KGLAB0ehSkxajYk5P2qIPnGql/XvTt Qow/6bfyvIsLzXEfGh9uQM94OZruEI21LaeT8pzZTzbQSwbNRjhpsjLI+8JhOX0K LjnKppD3pXi8HebfsKoH3j7ogK+m6nNp8jP3GJCD3rP27jnrg8/qZ3gRd9xVxRLA CzClGnk/cWhqaqQ1uBNFtnHOWf2kOVvxKPgPy5OxFxyDiSytt4YqFtfSGTNTwQ8B MRtuZZfg6JY3BOz+JlCQCZLyMQMmDxp/jPtSm3YtQRee2JMuOaCmQQ7RmiGMfyET r4hsIugD73WKwuJcsIkWzFeWqZ6odw==
    =8ewg
    -----END PGP SIGNATURE-----

    --- SoupGate-Win32 v1.05
    * Origin: fsxNet Usenet Gateway (21:1/5)
  • From Nowa Ammerlaan@21:1/5 to Ionen Wolkens on Wed Mar 19 09:00:01 2025
    On 19/03/2025 02:07, Ionen Wolkens wrote:
    On Tue, Mar 18, 2025 at 08:34:43PM -0400, Ionen Wolkens wrote:
    On Tue, Mar 18, 2025 at 03:14:13AM -0000, Duncan wrote:
    Nowa Ammerlaan posted on Mon, 17 Mar 2025 11:11:06 +0100 as excerpted:

    I had really hoped to receive more comments on my earlier RFC. [...]
    I really do want to know what others think so I can
    make a better judgment on whether or not my idea is really this crazy
    and if I should just shut up about it or not (so dear reader if you have >>>> an opinion then please share).

    So because I carried over my own already "works for me" kernel maintenance >>> scripts from Mandrake when I switched in 2004 and have continued
    maintaining and using them over the decades since, I normally try to stay >>> out of Gentoo kernel packaging discussion. But given both the above
    explicit invitation and that as I've read the thread a thought occurred to >>> me...

    First, DKMS /is/ a cross-distro standard solution. As such, I believe in >>> general it should be reasonably supported in Gentoo unless it simply
    doesn't make sense (note that "doesn't make sense" can also include the
    case of simply no one stepping up to do it, not the case here).

    But, the thought that occurred to me reading the thread, was that there
    are obvious parallels between this and another very significant and
    controversial now "cross distro standard solution" (which I guess I don't >>> need to name explicitly).

    As there, I believe "the Gentoo approach" should (again assuming developer >>> willingness to do the work, seemingly the case here) make it available as >>> an additional integrated *option*, while keeping the current Gentoo option >>> as well.

    So I support DKMS integration /as/ /an/ /option/.

    If anything, if go forward with this, I'd rather that it be with the
    plan to (eventually) either make it the default after enough testing
    and then later drop support for the old way entirely (then merge the
    eclasses), or revert if we think it's no good.

    As I have already stated elsewhere, DKMS can do things that we cannot
    achieve with the package manager, and the package manager can do things
    that we cannot achieve with DKMS. Each pathway has its use cases. And
    for that reason DKMS is not a replacement for the package manager. Nor
    can I think of a possible future package manager based solution that can
    fully replace what DKMS does (though who knows, maybe someone will prove
    me wrong in 20 years)

    This dual-approach is not controversial either, other distributions
    often offer a "normal" package as well as a DKMS package. Now since we
    have USE flags we do not have to make two separate packages, but
    nonetheless the core of letting the user choose to use DKMS or not
    remains the same.

    One of the thing I did not like here is the idea to gain more ways
    to do the same thing that need to be tested to ensure some quality.
    Can't ignore it and leave it all to Nowa given if e.g. nvidia changes
    some path or something else and I don't test it on bump, then I push
    a broken package for all dkms users until someone reports it. Would
    even need to boot with it to be sure.

    I'll grant that you'd indeed have to test both USE=dkms and USE=-dkms, especially if the ebuild does not use a modlist and therefore the
    dkms.conf is not constructed fully automatically. Though I do not see
    why this would require actually rebooting the system for both cases.
    DKMS either builds and installs the module successfully in postinst or
    it does not. And regardless of who did the module installing, it either
    loads successfully or it does not. Note that we are intentionally using
    the exact same commands to actually build the module in DKMS.

    I'll also note again that Nvidia is one of the upstreams that supports
    DKMS, in contrast to our own linux-mod-r1 solution in portage which I
    don't think they care about at all. I'd therefore say that it is far
    more likely for Nvidia to change something that breaks the existing
    non-dkms pathway in the ebuild, then it is for them to break the dkms
    pathway that lots of other distributions rely on.

    It's nice to have choices in general, but still need to draw some
    lines to keep things maintainable.

    This maintainability argument would be a lot stronger if I was
    reinventing the wheel and proposing some custom Gentoo specific solution
    to the problem at hand. Note though that this is not what I am doing (in
    fact one could even turn that around and say that this is what you are
    doing). You are of course right that more options means more things to
    test. But really, it's not a lot of work, I know because I did the work
    for almost all of the kernel module ebuilds we have in ::gentoo and was finished in half a day. The bulk of the work was designing and writing
    the eclass and figuring out all the different cases that should be
    supported, that part is done now.

    And if picking, in the end do we pick an option that requires to
    install sources and (imo) adds very little, or let the PM (that has
    access to sources unlike binary distros) handle it (with full control
    for handling issues) just like for dist kernels and improve on that
    as needed?

    Either way, as I said initially, I won't revert if this gets merged
    (even if optional forever). Just stating that I don't like it and
    probably won't offer real support, not blocking it.

    wrt merging eclasses, could add that I wasn't really against the
    support for this being in linux-mod-r1 directly except for the part
    where it did not work when not using modlist being confusing, in the
    end I'd probably just have asked for Nowa to add themselves as
    maintainer.

    The main reason this is in a separate eclass is because we need a
    pkg_prerm for dkms that linux-mod-r1 does not have. And as you pointed
    out earlier, exporting an extra phase function in an established eclass
    is not a good idea.

    On a related note about modlist, I've been semi-regretting keeping that
    modlist-type idea from the original linux-mod eclass and felt that a
    simple emake wrapper (incl. modules args) for all packages "might" have
    been better and easier to use for ebuilds and not miss modules on bump
    and had been pondering "potential" deprecation in the future (not that
    I had really explored that idea yet, would need to check packages).

    (this was in my notes of things to consider for EAPI 9, but likely won't
    try if there is another eclass built upon linux-mod-r1 that I need to
    not break)

    Note that none of this hard requires the modlist. The requirement is
    that we have one or more dkms.conf files. These may be provided by
    upstream (as is the case for nvidia-drivers), or generated by some build
    system script (as is the case for zfs-kmod), or included in the
    FILESDIR, or they can be generated by the eclass from the modlist.

    This auto-generation option is just for convenience. The modlist already contains all the information we need to define the dkms.conf, so all we
    have to do is make the translation. Doing so makes it very easy for the
    package maintainer to add dkms compatibility without actually writing a
    custom dkms.conf.

    If you wish to drop the modlist method from linux-mod-r1 then you can
    still do so. It just requires that when upgrading from EAPI 8 to 9 we
    also port the ebuild to so other method of providing the dkms.conf (for
    example putting a stub dkms.conf in FILESDIR, sed'ing in the PV, and
    then putting it in the proper place). I might then want to adjust the src_compile phase of the eclass a bit when bumping it to EAPI 9, but
    again these are all easily solvable problems, and they are also
    hypothetical problems.

    In the end this eclass does not really rely on the specifics of
    linux-mod-r1 more then a consumer ebuild does. We rely on linux-mod-r1
    setting the MODULES_MAKEARGS, we rely on linux-mod-r1 to process the
    modlist and set the default values there (I split this into a separate
    function to avoid code duplication), and we rely on the modules_process_dracut.conf.d function (again, just to avoid code
    duplication). And that's it. Now I could drop the linux-mod-r1 commits
    that split out this processing of the modlist and make the modules_process_dracut.conf.d function public. But we gain nothing from
    this since the ebuilds already rely on linux-mod-r1 doing what it does
    in this area in exactly the same way that the eclass does, it only
    results in some code duplication.

    Best regards,
    Nowa

    --- SoupGate-Win32 v1.05
    * Origin: fsxNet Usenet Gateway (21:1/5)
  • From Ionen Wolkens@21:1/5 to Nowa Ammerlaan on Wed Mar 19 09:50:01 2025
    On Wed, Mar 19, 2025 at 08:57:38AM +0100, Nowa Ammerlaan wrote:
    On 19/03/2025 02:07, Ionen Wolkens wrote:
    On Tue, Mar 18, 2025 at 08:34:43PM -0400, Ionen Wolkens wrote:
    On Tue, Mar 18, 2025 at 03:14:13AM -0000, Duncan wrote:
    Nowa Ammerlaan posted on Mon, 17 Mar 2025 11:11:06 +0100 as excerpted: >>>
    I had really hoped to receive more comments on my earlier RFC. [...] >>>> I really do want to know what others think so I can
    make a better judgment on whether or not my idea is really this crazy >>>> and if I should just shut up about it or not (so dear reader if you have >>>> an opinion then please share).

    So because I carried over my own already "works for me" kernel maintenance
    scripts from Mandrake when I switched in 2004 and have continued
    maintaining and using them over the decades since, I normally try to stay >>> out of Gentoo kernel packaging discussion. But given both the above
    explicit invitation and that as I've read the thread a thought occurred to
    me...

    First, DKMS /is/ a cross-distro standard solution. As such, I believe in >>> general it should be reasonably supported in Gentoo unless it simply
    doesn't make sense (note that "doesn't make sense" can also include the >>> case of simply no one stepping up to do it, not the case here).

    But, the thought that occurred to me reading the thread, was that there >>> are obvious parallels between this and another very significant and
    controversial now "cross distro standard solution" (which I guess I don't >>> need to name explicitly).

    As there, I believe "the Gentoo approach" should (again assuming developer
    willingness to do the work, seemingly the case here) make it available as >>> an additional integrated *option*, while keeping the current Gentoo option
    as well.

    So I support DKMS integration /as/ /an/ /option/.

    If anything, if go forward with this, I'd rather that it be with the
    plan to (eventually) either make it the default after enough testing
    and then later drop support for the old way entirely (then merge the
    eclasses), or revert if we think it's no good.

    As I have already stated elsewhere, DKMS can do things that we cannot achieve with the package manager, and the package manager can do things
    that we cannot achieve with DKMS. Each pathway has its use cases. And
    for that reason DKMS is not a replacement for the package manager. Nor
    can I think of a possible future package manager based solution that can fully replace what DKMS does (though who knows, maybe someone will prove
    me wrong in 20 years)

    This dual-approach is not controversial either, other distributions
    often offer a "normal" package as well as a DKMS package. Now since we
    have USE flags we do not have to make two separate packages, but
    nonetheless the core of letting the user choose to use DKMS or not
    remains the same.

    One of the thing I did not like here is the idea to gain more ways
    to do the same thing that need to be tested to ensure some quality.
    Can't ignore it and leave it all to Nowa given if e.g. nvidia changes
    some path or something else and I don't test it on bump, then I push
    a broken package for all dkms users until someone reports it. Would
    even need to boot with it to be sure.

    I'll grant that you'd indeed have to test both USE=dkms and USE=-dkms, especially if the ebuild does not use a modlist and therefore the
    dkms.conf is not constructed fully automatically. Though I do not see
    why this would require actually rebooting the system for both cases.
    DKMS either builds and installs the module successfully in postinst or
    it does not. And regardless of who did the module installing, it either loads successfully or it does not. Note that we are intentionally using
    the exact same commands to actually build the module in DKMS.

    I'll also note again that Nvidia is one of the upstreams that supports
    DKMS, in contrast to our own linux-mod-r1 solution in portage which I
    don't think they care about at all. I'd therefore say that it is far
    more likely for Nvidia to change something that breaks the existing
    non-dkms pathway in the ebuild, then it is for them to break the dkms pathway that lots of other distributions rely on.

    It's nice to have choices in general, but still need to draw some
    lines to keep things maintainable.

    This maintainability argument would be a lot stronger if I was
    reinventing the wheel and proposing some custom Gentoo specific solution
    to the problem at hand. Note though that this is not what I am doing (in fact one could even turn that around and say that this is what you are doing). You are of course right that more options means more things to
    test. But really, it's not a lot of work, I know because I did the work
    for almost all of the kernel module ebuilds we have in ::gentoo and was finished in half a day. The bulk of the work was designing and writing
    the eclass and figuring out all the different cases that should be supported, that part is done now.

    And if picking, in the end do we pick an option that requires to
    install sources and (imo) adds very little, or let the PM (that has
    access to sources unlike binary distros) handle it (with full control
    for handling issues) just like for dist kernels and improve on that
    as needed?

    Either way, as I said initially, I won't revert if this gets merged
    (even if optional forever). Just stating that I don't like it and
    probably won't offer real support, not blocking it.

    wrt merging eclasses, could add that I wasn't really against the
    support for this being in linux-mod-r1 directly except for the part
    where it did not work when not using modlist being confusing, in the
    end I'd probably just have asked for Nowa to add themselves as
    maintainer.

    The main reason this is in a separate eclass is because we need a
    pkg_prerm for dkms that linux-mod-r1 does not have. And as you pointed
    out earlier, exporting an extra phase function in an established eclass
    is not a good idea.

    Yes, but it could've either have become a linux-mod-r2 (and deprecate
    -r1 eventually) or done on EAPI bump in the future.

    I don't really see why any ebuilds should inherit linux-mod-r1 right
    now when they'll just be the odd one out if they don't support dkms.
    May as well merge it into dkms.eclass and get rid of it after consumers
    are gone.

    On that note, please just take over linux-mod-r1 maintenance if merge
    this so that I won't have to care anymore.


    On a related note about modlist, I've been semi-regretting keeping that
    modlist-type idea from the original linux-mod eclass and felt that a
    simple emake wrapper (incl. modules args) for all packages "might" have
    been better and easier to use for ebuilds and not miss modules on bump
    and had been pondering "potential" deprecation in the future (not that
    I had really explored that idea yet, would need to check packages).

    (this was in my notes of things to consider for EAPI 9, but likely won't try if there is another eclass built upon linux-mod-r1 that I need to
    not break)

    Note that none of this hard requires the modlist. The requirement is
    that we have one or more dkms.conf files. These may be provided by
    upstream (as is the case for nvidia-drivers), or generated by some build system script (as is the case for zfs-kmod), or included in the
    FILESDIR, or they can be generated by the eclass from the modlist.

    This auto-generation option is just for convenience. The modlist already contains all the information we need to define the dkms.conf, so all we
    have to do is make the translation. Doing so makes it very easy for the package maintainer to add dkms compatibility without actually writing a custom dkms.conf.

    If you wish to drop the modlist method from linux-mod-r1 then you can
    still do so. It just requires that when upgrading from EAPI 8 to 9 we
    also port the ebuild to so other method of providing the dkms.conf (for example putting a stub dkms.conf in FILESDIR, sed'ing in the PV, and
    then putting it in the proper place). I might then want to adjust the src_compile phase of the eclass a bit when bumping it to EAPI 9, but
    again these are all easily solvable problems, and they are also
    hypothetical problems.

    In the end this eclass does not really rely on the specifics of
    linux-mod-r1 more then a consumer ebuild does. We rely on linux-mod-r1 setting the MODULES_MAKEARGS, we rely on linux-mod-r1 to process the
    modlist and set the default values there (I split this into a separate function to avoid code duplication), and we rely on the modules_process_dracut.conf.d function (again, just to avoid code duplication). And that's it. Now I could drop the linux-mod-r1 commits
    that split out this processing of the modlist and make the modules_process_dracut.conf.d function public. But we gain nothing from
    this since the ebuilds already rely on linux-mod-r1 doing what it does
    in this area in exactly the same way that the eclass does, it only
    results in some code duplication.

    Best regards,
    Nowa


    --
    ionen

    -----BEGIN PGP SIGNATURE-----

    iQEzBAABCAAdFiEEx3SLh1HBoPy/yLVYskQGsLCsQzQFAmfahO4ACgkQskQGsLCs QzQ7Mgf/ali29QBpnhp5Sbc2RqEmsuQKnsdiMctQFVG4hLDQHVM7fBvqqvCyAcmj Rhl8SGd/cDf0OZfJXsIJDXxVI95v4CrT+weeBpK9bb1f8H32gjNKEE3xpJYT5/vo s9KM7skFKjkGgOtBfu2jCLhxxzRnznWP1hWDB9gjLVvAclPbdiJc4qRzeoe60mNJ dW6SUGeyVqr2vQVZYh1qeKhTcruwOwHD3kbC3kzToou0uVllmc6vI4ywEi7y7wqK HBLed8irEz+O61taV3iQe8cPyI4sUpvG7LQN0g0kBMnPB0KVKo7I+soVwvs6JBhg +AhUV/u6u/00BmZyoocLzlBCySPXMA==
    =pCt9
    -----END PGP SIGNATURE-----

    --- SoupGate-Win32 v1.05
    * Origin: fsxNet Usenet Gateway (21:1/5)
  • From Nowa Ammerlaan@21:1/5 to Ionen Wolkens on Wed Mar 19 13:50:01 2025
    On 19/03/2025 09:48, Ionen Wolkens wrote:
    On Wed, Mar 19, 2025 at 08:57:38AM +0100, Nowa Ammerlaan wrote:
    On 19/03/2025 02:07, Ionen Wolkens wrote:
    On Tue, Mar 18, 2025 at 08:34:43PM -0400, Ionen Wolkens wrote:
    On Tue, Mar 18, 2025 at 03:14:13AM -0000, Duncan wrote:
    Nowa Ammerlaan posted on Mon, 17 Mar 2025 11:11:06 +0100 as excerpted: >>>>>
    I had really hoped to receive more comments on my earlier RFC. [...] >>>>>> I really do want to know what others think so I can
    make a better judgment on whether or not my idea is really this crazy >>>>>> and if I should just shut up about it or not (so dear reader if you have >>>>>> an opinion then please share).

    So because I carried over my own already "works for me" kernel maintenance
    scripts from Mandrake when I switched in 2004 and have continued
    maintaining and using them over the decades since, I normally try to stay >>>>> out of Gentoo kernel packaging discussion. But given both the above
    explicit invitation and that as I've read the thread a thought occurred to
    me...

    First, DKMS /is/ a cross-distro standard solution. As such, I believe in >>>>> general it should be reasonably supported in Gentoo unless it simply >>>>> doesn't make sense (note that "doesn't make sense" can also include the >>>>> case of simply no one stepping up to do it, not the case here).

    But, the thought that occurred to me reading the thread, was that there >>>>> are obvious parallels between this and another very significant and
    controversial now "cross distro standard solution" (which I guess I don't >>>>> need to name explicitly).

    As there, I believe "the Gentoo approach" should (again assuming developer
    willingness to do the work, seemingly the case here) make it available as >>>>> an additional integrated *option*, while keeping the current Gentoo option
    as well.

    So I support DKMS integration /as/ /an/ /option/.

    If anything, if go forward with this, I'd rather that it be with the
    plan to (eventually) either make it the default after enough testing
    and then later drop support for the old way entirely (then merge the
    eclasses), or revert if we think it's no good.

    As I have already stated elsewhere, DKMS can do things that we cannot
    achieve with the package manager, and the package manager can do things
    that we cannot achieve with DKMS. Each pathway has its use cases. And
    for that reason DKMS is not a replacement for the package manager. Nor
    can I think of a possible future package manager based solution that can
    fully replace what DKMS does (though who knows, maybe someone will prove
    me wrong in 20 years)

    This dual-approach is not controversial either, other distributions
    often offer a "normal" package as well as a DKMS package. Now since we
    have USE flags we do not have to make two separate packages, but
    nonetheless the core of letting the user choose to use DKMS or not
    remains the same.

    One of the thing I did not like here is the idea to gain more ways
    to do the same thing that need to be tested to ensure some quality.
    Can't ignore it and leave it all to Nowa given if e.g. nvidia changes
    some path or something else and I don't test it on bump, then I push
    a broken package for all dkms users until someone reports it. Would
    even need to boot with it to be sure.

    I'll grant that you'd indeed have to test both USE=dkms and USE=-dkms,
    especially if the ebuild does not use a modlist and therefore the
    dkms.conf is not constructed fully automatically. Though I do not see
    why this would require actually rebooting the system for both cases.
    DKMS either builds and installs the module successfully in postinst or
    it does not. And regardless of who did the module installing, it either
    loads successfully or it does not. Note that we are intentionally using
    the exact same commands to actually build the module in DKMS.

    I'll also note again that Nvidia is one of the upstreams that supports
    DKMS, in contrast to our own linux-mod-r1 solution in portage which I
    don't think they care about at all. I'd therefore say that it is far
    more likely for Nvidia to change something that breaks the existing
    non-dkms pathway in the ebuild, then it is for them to break the dkms
    pathway that lots of other distributions rely on.

    It's nice to have choices in general, but still need to draw some
    lines to keep things maintainable.

    This maintainability argument would be a lot stronger if I was
    reinventing the wheel and proposing some custom Gentoo specific solution
    to the problem at hand. Note though that this is not what I am doing (in
    fact one could even turn that around and say that this is what you are
    doing). You are of course right that more options means more things to
    test. But really, it's not a lot of work, I know because I did the work
    for almost all of the kernel module ebuilds we have in ::gentoo and was
    finished in half a day. The bulk of the work was designing and writing
    the eclass and figuring out all the different cases that should be
    supported, that part is done now.

    And if picking, in the end do we pick an option that requires to
    install sources and (imo) adds very little, or let the PM (that has
    access to sources unlike binary distros) handle it (with full control
    for handling issues) just like for dist kernels and improve on that
    as needed?

    Either way, as I said initially, I won't revert if this gets merged
    (even if optional forever). Just stating that I don't like it and
    probably won't offer real support, not blocking it.

    wrt merging eclasses, could add that I wasn't really against the
    support for this being in linux-mod-r1 directly except for the part
    where it did not work when not using modlist being confusing, in the
    end I'd probably just have asked for Nowa to add themselves as
    maintainer.

    The main reason this is in a separate eclass is because we need a
    pkg_prerm for dkms that linux-mod-r1 does not have. And as you pointed
    out earlier, exporting an extra phase function in an established eclass
    is not a good idea.

    Yes, but it could've either have become a linux-mod-r2 (and deprecate
    -r1 eventually) or done on EAPI bump in the future.

    I don't really see why any ebuilds should inherit linux-mod-r1 right
    now when they'll just be the odd one out if they don't support dkms.
    May as well merge it into dkms.eclass and get rid of it after consumers
    are gone.

    We can still do that (i.e. merge it all into one eclass named
    linux-mod-r2 instead of inheriting linux-mod-r1), but from our earlier discussion it was my impression that this is not what you wanted. We
    could even add dkms as a separate eclass now, and then merge it back
    into a possible linux-mod-r2 in the future (if/when there are other
    things we want to do that warrant a revision bump such as the
    multi-build approach that you suggested before).

    On that note, please just take over linux-mod-r1 maintenance if merge
    this so that I won't have to care anymore.

    Ionen, I'm getting the impression that you're taking what I said a bit personally. It is not my intention to attack you or your work, on the
    contrary. I may argue (too) passionately, but that is because I believe
    I am right and I am still trying to convince you of this because I'd
    rather not merge this in if you are strongly opposed. Now I am happy to co-maintain linux-mod-r1 (or -r2 if that is the route we want to take),
    as you know I've already submitted a number of patches for it before
    because it intersects closely with the dist-kernel eclasses. That being
    said, I do not wish to usurp your position here.

    Best regards,
    Nowa

    --- SoupGate-Win32 v1.05
    * Origin: fsxNet Usenet Gateway (21:1/5)
  • From Sam James@21:1/5 to Duncan on Wed Mar 19 23:20:02 2025
    Duncan <1i5t5.duncan@cox.net> writes:

    Nowa Ammerlaan posted on Mon, 17 Mar 2025 11:11:06 +0100 as excerpted:

    I had really hoped to receive more comments on my earlier RFC. [...]
    I really do want to know what others think so I can
    make a better judgment on whether or not my idea is really this crazy
    and if I should just shut up about it or not (so dear reader if you have
    an opinion then please share).

    So because I carried over my own already "works for me" kernel maintenance scripts from Mandrake when I switched in 2004 and have continued
    maintaining and using them over the decades since, I normally try to stay
    out of Gentoo kernel packaging discussion. But given both the above
    explicit invitation and that as I've read the thread a thought occurred to me...

    First, DKMS /is/ a cross-distro standard solution. As such, I believe in general it should be reasonably supported in Gentoo unless it simply
    doesn't make sense (note that "doesn't make sense" can also include the
    case of simply no one stepping up to do it, not the case here).

    But, the thought that occurred to me reading the thread, was that there
    are obvious parallels between this and another very significant and controversial now "cross distro standard solution" (which I guess I don't need to name explicitly).

    As there, I believe "the Gentoo approach" should (again assuming developer willingness to do the work, seemingly the case here) make it available as
    an additional integrated *option*, while keeping the current Gentoo option
    as well.

    So I support DKMS integration /as/ /an/ /option/.

    I do generally appreciate your input, but I'll note that this email
    boils down to "choice is good" (even though you're seemingly not going
    to use this at all).

    This is somewhat of a meme and doesn't really make sense in isolation,
    given maintainability and clear documentation is always something we
    have to weigh up more options with.

    --- SoupGate-Win32 v1.05
    * Origin: fsxNet Usenet Gateway (21:1/5)
  • From Sam James@21:1/5 to Nowa Ammerlaan on Wed Mar 19 23:20:02 2025
    Nowa Ammerlaan <nowa@gentoo.org> writes:

    On 19/03/2025 02:07, Ionen Wolkens wrote:
    On Tue, Mar 18, 2025 at 08:34:43PM -0400, Ionen Wolkens wrote:
    On Tue, Mar 18, 2025 at 03:14:13AM -0000, Duncan wrote:
    Nowa Ammerlaan posted on Mon, 17 Mar 2025 11:11:06 +0100 as excerpted: >>>>
    I had really hoped to receive more comments on my earlier RFC. [...] >>>>> I really do want to know what others think so I can
    make a better judgment on whether or not my idea is really this crazy >>>>> and if I should just shut up about it or not (so dear reader if you have >>>>> an opinion then please share).

    So because I carried over my own already "works for me" kernel maintenance >>>> scripts from Mandrake when I switched in 2004 and have continued
    maintaining and using them over the decades since, I normally try to stay >>>> out of Gentoo kernel packaging discussion. But given both the above
    explicit invitation and that as I've read the thread a thought occurred to >>>> me...

    First, DKMS /is/ a cross-distro standard solution. As such, I believe in >>>> general it should be reasonably supported in Gentoo unless it simply
    doesn't make sense (note that "doesn't make sense" can also include the >>>> case of simply no one stepping up to do it, not the case here).

    But, the thought that occurred to me reading the thread, was that there >>>> are obvious parallels between this and another very significant and
    controversial now "cross distro standard solution" (which I guess I don't >>>> need to name explicitly).

    As there, I believe "the Gentoo approach" should (again assuming developer >>>> willingness to do the work, seemingly the case here) make it available as >>>> an additional integrated *option*, while keeping the current Gentoo option >>>> as well.

    So I support DKMS integration /as/ /an/ /option/.

    If anything, if go forward with this, I'd rather that it be with the
    plan to (eventually) either make it the default after enough testing
    and then later drop support for the old way entirely (then merge the
    eclasses), or revert if we think it's no good.

    As I have already stated elsewhere, DKMS can do things that we cannot
    achieve with the package manager, and the package manager can do
    things that we cannot achieve with DKMS. Each pathway has its use
    cases. And for that reason DKMS is not a replacement for the package
    manager. Nor can I think of a possible future package manager based
    solution that can fully replace what DKMS does (though who knows,
    maybe someone will prove me wrong in 20 years)

    This dual-approach is not controversial either, other distributions
    often offer a "normal" package as well as a DKMS package. Now since we
    have USE flags we do not have to make two separate packages, but
    nonetheless the core of letting the user choose to use DKMS or not
    remains the same.

    One of the thing I did not like here is the idea to gain more ways
    to do the same thing that need to be tested to ensure some quality.
    Can't ignore it and leave it all to Nowa given if e.g. nvidia changes
    some path or something else and I don't test it on bump, then I push
    a broken package for all dkms users until someone reports it. Would
    even need to boot with it to be sure.

    I'll grant that you'd indeed have to test both USE=dkms and USE=-dkms, especially if the ebuild does not use a modlist and therefore the
    dkms.conf is not constructed fully automatically. Though I do not see
    why this would require actually rebooting the system for both
    cases. DKMS either builds and installs the module successfully in
    postinst or it does not. And regardless of who did the module
    installing, it either loads successfully or it does not. Note that we
    are intentionally using the exact same commands to actually build the
    module in DKMS.

    If we're doing it orphaned, it should be done as hooks instead rather
    than with any integration in the ebuild, though. postinst / orphaned
    files are broadly a hack. Orphaned files break a bunch of invariants
    including Just Working for binpkgs properly.

    I also agree with Ionen that this is important enough that I'd want this
    to be the primary path (and fully tested & supported), not done at
    all. But wanting to support *both* long-time makes me uneasy.

    [...]

    It's nice to have choices in general, but still need to draw some
    lines to keep things maintainable.

    This maintainability argument would be a lot stronger if I was
    reinventing the wheel and proposing some custom Gentoo specific
    solution to the problem at hand. Note though that this is not what I
    am doing (in fact one could even turn that around and say that this is
    what you are doing). You are of course right that more options means
    more things to test. But really, it's not a lot of work, I know
    because I did the work for almost all of the kernel module ebuilds we
    have in ::gentoo and was finished in half a day. The bulk of the work
    was designing and writing the eclass and figuring out all the
    different cases that should be supported, that part is done now.


    But none of this does feel particularly native to Gentoo. Most of the
    Linux world is of binary distros, so while it may not be NIH, it
    somewhat is NIH wrt source distros (or can feel like that).

    In the same way, Eli and I have some different opinions on splitpkgs --
    he's sort of convinced me that there's some utility in them, but they're
    in no way *as useful* as they are on primarily-binary distributions.

    But I don't consider myself an expert on kernel modules either, just the
    fact that Ionen shares my unease (or I share his) makes me feel like
    mine isn't unwarranted.

    [...]

    thanks,
    sam

    --- SoupGate-Win32 v1.05
    * Origin: fsxNet Usenet Gateway (21:1/5)
  • From Eli Schwartz@21:1/5 to Sam James on Wed Mar 19 23:40:01 2025
    This is an OpenPGP/MIME signed message (RFC 4880 and 3156) --------------By2Tj9x4ZSdkrbqaiRpDsZGq
    Content-Type: text/plain; charset=UTF-8
    Content-Transfer-Encoding: quoted-printable

    On 3/19/25 6:10 PM, Sam James wrote:
    If we're doing it orphaned, it should be done as hooks instead rather
    than with any integration in the ebuild, though. postinst / orphaned
    files are broadly a hack. Orphaned files break a bunch of invariants including Just Working for binpkgs properly.

    I also agree with Ionen that this is important enough that I'd want this
    to be the primary path (and fully tested & supported), not done at
    all. But wanting to support *both* long-time makes me uneasy.


    Shower thought, but if interested in guaranteeing a single tested path,
    it is possible to unconditionally prep the source tree for dkms, then
    have USE=dkms decide whether to:

    - install the sources to /usr/src

    - build the module in the ebuild and install it in src_install, via
    running the `dkms build` command


    This would mean making dkms a dependency as such:

    BDEPEND="
    !dkms? ( sys-kernel/dkms )
    "
    RDEPEND="
    dkms? ( sys-kernel/dkms )
    "

    I suppose that not everyone will necessarily like this. But it should be technically feasible, at least.


    [...]

    It's nice to have choices in general, but still need to draw some
    lines to keep things maintainable.

    This maintainability argument would be a lot stronger if I was
    reinventing the wheel and proposing some custom Gentoo specific
    solution to the problem at hand. Note though that this is not what I
    am doing (in fact one could even turn that around and say that this is
    what you are doing). You are of course right that more options means
    more things to test. But really, it's not a lot of work, I know
    because I did the work for almost all of the kernel module ebuilds we
    have in ::gentoo and was finished in half a day. The bulk of the work
    was designing and writing the eclass and figuring out all the
    different cases that should be supported, that part is done now.


    But none of this does feel particularly native to Gentoo. Most of the
    Linux world is of binary distros, so while it may not be NIH, it
    somewhat is NIH wrt source distros (or can feel like that).

    In the same way, Eli and I have some different opinions on splitpkgs --
    he's sort of convinced me that there's some utility in them, but they're
    in no way *as useful* as they are on primarily-binary distributions.


    Couldn't you say the same thing about gentoo-sources? Like dkms, this
    entails installing source code which users will then compile and install outside of an ebuild.

    In fact this is one of the biggest reasons I think supporting dkms on
    Gentoo is important, because I can't see how one could *build* a kernel
    module in src_install and install it as part of CONTENTS, when you don't actually know what kernels are installed.

    I mean, sure, you could treat emerge as a hook program to iteratively
    build orphaned modules for orphaned kernels via manual non-portage steps
    to bamboozle emerge into thinking that's "the kernel" to use. Many
    things are possible, given sufficient determination. But the discussion
    is about what feels native and clean and "not a hack".

    And what seems "not a hack" to me is that if you install kernel sources,
    you should be able to install module sources too.


    But I don't consider myself an expert on kernel modules either, just the
    fact that Ionen shares my unease (or I share his) makes me feel like
    mine isn't unwarranted.

    [...]

    thanks,
    sam



    --
    Eli Schwartz

    --------------By2Tj9x4ZSdkrbqaiRpDsZGq--

    -----BEGIN PGP SIGNATURE-----

    wnsEABYIACMWIQTnFNnmK0TPZHnXm3qEp9ErcA0vVwUCZ9tHHgUDAAAAAAAKCRCEp9ErcA0vV10U AP4/4f6u4UGBOtJKM5h15lUbBlkkDVzmD7qIjvnxSMmiGgD7BbPfLvlYky3qGO0kcaGNZ0/wihqh QF18KAZ2O/xrhwI=
    =CCEO
    -----END PGP SIGNATURE-----

    --- SoupGate-Win32 v1.05
    * Origin: fsxNet Usenet Gateway (21:1/5)
  • From Nowa Ammerlaan@21:1/5 to Sam James on Thu Mar 20 09:20:01 2025
    On 19/03/2025 23:10, Sam James wrote:
    Nowa Ammerlaan <nowa@gentoo.org> writes:

    On 19/03/2025 02:07, Ionen Wolkens wrote:
    On Tue, Mar 18, 2025 at 08:34:43PM -0400, Ionen Wolkens wrote:
    On Tue, Mar 18, 2025 at 03:14:13AM -0000, Duncan wrote:
    Nowa Ammerlaan posted on Mon, 17 Mar 2025 11:11:06 +0100 as excerpted: >>>>>
    I had really hoped to receive more comments on my earlier RFC. [...] >>>>>> I really do want to know what others think so I can
    make a better judgment on whether or not my idea is really this crazy >>>>>> and if I should just shut up about it or not (so dear reader if you have >>>>>> an opinion then please share).

    So because I carried over my own already "works for me" kernel maintenance
    scripts from Mandrake when I switched in 2004 and have continued
    maintaining and using them over the decades since, I normally try to stay >>>>> out of Gentoo kernel packaging discussion. But given both the above
    explicit invitation and that as I've read the thread a thought occurred to
    me...

    First, DKMS /is/ a cross-distro standard solution. As such, I believe in >>>>> general it should be reasonably supported in Gentoo unless it simply >>>>> doesn't make sense (note that "doesn't make sense" can also include the >>>>> case of simply no one stepping up to do it, not the case here).

    But, the thought that occurred to me reading the thread, was that there >>>>> are obvious parallels between this and another very significant and
    controversial now "cross distro standard solution" (which I guess I don't >>>>> need to name explicitly).

    As there, I believe "the Gentoo approach" should (again assuming developer
    willingness to do the work, seemingly the case here) make it available as >>>>> an additional integrated *option*, while keeping the current Gentoo option
    as well.

    So I support DKMS integration /as/ /an/ /option/.

    If anything, if go forward with this, I'd rather that it be with the
    plan to (eventually) either make it the default after enough testing
    and then later drop support for the old way entirely (then merge the
    eclasses), or revert if we think it's no good.

    As I have already stated elsewhere, DKMS can do things that we cannot
    achieve with the package manager, and the package manager can do
    things that we cannot achieve with DKMS. Each pathway has its use
    cases. And for that reason DKMS is not a replacement for the package
    manager. Nor can I think of a possible future package manager based
    solution that can fully replace what DKMS does (though who knows,
    maybe someone will prove me wrong in 20 years)

    This dual-approach is not controversial either, other distributions
    often offer a "normal" package as well as a DKMS package. Now since we
    have USE flags we do not have to make two separate packages, but
    nonetheless the core of letting the user choose to use DKMS or not
    remains the same.

    One of the thing I did not like here is the idea to gain more ways
    to do the same thing that need to be tested to ensure some quality.
    Can't ignore it and leave it all to Nowa given if e.g. nvidia changes
    some path or something else and I don't test it on bump, then I push
    a broken package for all dkms users until someone reports it. Would
    even need to boot with it to be sure.

    I'll grant that you'd indeed have to test both USE=dkms and USE=-dkms,
    especially if the ebuild does not use a modlist and therefore the
    dkms.conf is not constructed fully automatically. Though I do not see
    why this would require actually rebooting the system for both
    cases. DKMS either builds and installs the module successfully in
    postinst or it does not. And regardless of who did the module
    installing, it either loads successfully or it does not. Note that we
    are intentionally using the exact same commands to actually build the
    module in DKMS.

    If we're doing it orphaned, it should be done as hooks instead rather
    than with any integration in the ebuild, though. postinst / orphaned
    files are broadly a hack. Orphaned files break a bunch of invariants including Just Working for binpkgs properly.

    I'm sorry but this does not make any sense to me. What is orphaned here?
    The module sources are owned by the package (installed in src_install),
    the only thing that is not owned by the package is the built kernel
    module itself. And, by design, this is already effectively orphaned
    since the package manager does not remove files from /lib/modules
    anyway. I don't see how my proposal is orphaning more files.

    I also agree with Ionen that this is important enough that I'd want this
    to be the primary path (and fully tested & supported), not done at
    all. But wanting to support *both* long-time makes me uneasy.

    [...]

    It's nice to have choices in general, but still need to draw some
    lines to keep things maintainable.

    This maintainability argument would be a lot stronger if I was
    reinventing the wheel and proposing some custom Gentoo specific
    solution to the problem at hand. Note though that this is not what I
    am doing (in fact one could even turn that around and say that this is
    what you are doing). You are of course right that more options means
    more things to test. But really, it's not a lot of work, I know
    because I did the work for almost all of the kernel module ebuilds we
    have in ::gentoo and was finished in half a day. The bulk of the work
    was designing and writing the eclass and figuring out all the
    different cases that should be supported, that part is done now.


    But none of this does feel particularly native to Gentoo. Most of the
    Linux world is of binary distros, so while it may not be NIH, it
    somewhat is NIH wrt source distros (or can feel like that).

    Can you explain to me what exactly about DKMS makes you feel like it is
    not for Gentoo? I do not share this feeling and I am having a hard time wrapping my head around it. As I already said elsewhere, binary distros
    (e.g. Arch) can and do offer *both* prebuilt packages *and* dkms source packages. So evidently binary distros do not have to use DKMS if they do
    not want to, though many choose to because it is convenient. This
    convenience of dynamically managing the kernel modules instead of
    statically applies to Gentoo just as much as it does to other
    distributions. It has absolutely nothing to do with the package manager
    being able to build from source itself or not.

    It is inherent to the nature of the kernel modules that they will have
    to be built from source (by the user or the packager) targeting a
    specific kernel version. All I am changing here is *when* the module is
    built and installed (dynamically versus statically). And I believe this
    choice of when the module is built should be left to the user (just as
    we have gentoo-sources vs gentoo-kernel).

    In the same way, Eli and I have some different opinions on splitpkgs --
    he's sort of convinced me that there's some utility in them, but they're
    in no way *as useful* as they are on primarily-binary distributions.

    But I don't consider myself an expert on kernel modules either, just the
    fact that Ionen shares my unease (or I share his) makes me feel like
    mine isn't unwarranted.

    [...]

    thanks,
    sam

    --- SoupGate-Win32 v1.05
    * Origin: fsxNet Usenet Gateway (21:1/5)
  • From Nowa Ammerlaan@21:1/5 to Eli Schwartz on Thu Mar 20 09:30:01 2025
    On 19/03/2025 23:37, Eli Schwartz wrote:
    On 3/19/25 6:10 PM, Sam James wrote:
    If we're doing it orphaned, it should be done as hooks instead rather
    than with any integration in the ebuild, though. postinst / orphaned
    files are broadly a hack. Orphaned files break a bunch of invariants
    including Just Working for binpkgs properly.

    I also agree with Ionen that this is important enough that I'd want this
    to be the primary path (and fully tested & supported), not done at
    all. But wanting to support *both* long-time makes me uneasy.


    Shower thought, but if interested in guaranteeing a single tested path,
    it is possible to unconditionally prep the source tree for dkms, then
    have USE=dkms decide whether to:

    - install the sources to /usr/src

    - build the module in the ebuild and install it in src_install, via
    running the `dkms build` command

    Making the prepping (i.e. the creation/seding/moving of the dkms.conf
    files) unconditional is definitely doable.

    I'm not sure about calling 'dkms build' in src_install. DKMS has some
    switches to move around the location of the module and dkms tree that we
    could in theory use to have it operate on the ED instead of the EROOT.
    But it does expect some files to be already there. Though perhaps we
    could solve this with some symlinks.

    That being said, this would add more complexity, and we also run into
    the problem that sys-kernel/dkms is not keyworded everywhere (yet). Furthermore, we still keep the dkms USE flag, so fundamentally there are
    still two paths to test.


    This would mean making dkms a dependency as such:

    BDEPEND="
    !dkms? ( sys-kernel/dkms )
    "
    RDEPEND="
    dkms? ( sys-kernel/dkms )
    "

    I suppose that not everyone will necessarily like this. But it should be technically feasible, at least.


    --- SoupGate-Win32 v1.05
    * Origin: fsxNet Usenet Gateway (21:1/5)