Re: git: a8b4678fc925 - main - emulators/virtualbox-ose-70: Fix 15-CURRENT kmod build

From: Cy Schubert <Cy.Schubert_at_cschubert.com>
Date: Thu, 01 May 2025 01:54:46 UTC
On Thu, 1 May 2025 03:55:41 +0300
Vladimir Druzenko <vvd@freebsd.org> wrote:

> 29.04.2025 02:29, Cy Schubert пишет:
> > On Tue, 29 Apr 2025 00:59:36 +0300
> > Vladimir Druzenko<vvd@freebsd.org> wrote:
> >  
> >> Hello!
> >>
> >> Thanks for patch, but!
> >> 1. What is the purpose of such changes:  
> >>> -@@ -155,8 +157,6 @@ DECLHIDDEN(int) rtR0MemObjNativeFree(RTR0MEMOBJ pMem)
> >>> +@@ -155,8 +157,6 @@  
> >> ?  
> > Patch regeneration. diff -u produces a new patch.  
> 
> As already mentioned, according to the handbook, the preferred way to 
> create patches is make makepatch, not diff -u. If you look at the 
> history of changes to this file, you will see that in the previous 
> commit, the patch made by diff -u was replaced with make makepatch.
> I insist that this needs to be fixed.
> 
> >> 2. AFAIK, I'm the only one in vbox@ (maintainer of all VirtualBox ports)
> >> and I'm active. Why did you committed this patch without at least notify me?  
> > Build fixes are implicitly approved by portmgr. I should have put "approved by: portmgr (break fix)".  
> >> It isn't "port breakage" - 15 isn't releases yet and we can prepare  
> > Actually it is port breakage.
> >
> > --- memuserkernel-r0drv-freebsd.o ---
> > --- memobj-r0drv-freebsd.o ---
> > /wrkdirs/usr/ports/emulators/virtualbox-ose-kmod-70/work/VirtualBox-7.0.24/out/freebsd.amd64/release/bin/src/vboxdrv/r0drv/freebsd/memobj-r0drv-freebsd.c:474:53: error: member reference type 'int' is not a pointer
> >    474 |                 pMemFreeBSD->Core.u.Phys.PhysBase = VM_PAGE_TO_PHYS(vm_page_find_least(pMemFreeBSD->pObject, 0));
> >        |                                                     ^~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
> > /usr/src/sys/vm/vm_page.h:504:42: note: expanded from macro 'VM_PAGE_TO_PHYS'
> >    504 | #define VM_PAGE_TO_PHYS(entry)  ((entry)->phys_addr)
> >        |                                  ~~~~~~~  ^
> > 1 error generated.
> > *** [memobj-r0drv-freebsd.o] Error code 1  
> On which of the supported versions of FreeBSD (14.2, 13.4, 13.5) does 
> the port not build?
> I'll answer myself - it works on all versions. Therefore "approved by:

I'll take your word for it then. Though a 15-CURRENT built as of this
morning still fails without the patch
 
> portmgr (break fix)" is not applicable - nothing is broken.
> Users of CURRENT know what they are getting into and should be prepared 
> to wait a few days after such destructive changes in base.

Well, I started using -CURRENT when I got my src commit bit twelve
years ago. It's part of the job. ;)

> Things turned out much worse with ports on go several weeks ago.
> 
> >> patch several days as was in:
> >> https://bugs.freebsd.org/286206
> >> https://bugs.freebsd.org/286193
> >> https://bugs.freebsd.org/286204
> >> If you want, you can join vbox@.  
> > Sure.  
> I don't know the exact procedure for joining the working group, but just 
> in case I'll say that I'd be only too happy to work together with such 
> an experienced ports developer.

Neither do I. 

> >> Otherwise, it is unclear what these groups and maintainers are for, if
> >> everyone can commit whatever they want at their own discretion.  
> > As I understand, break fixes are implicitly approved by portmgr.
> >  
> >> 3. Have you checked other versions of VirtualBox:
> >> emulators/virtualbox-ose-kmod and emulators/virtualbox-ose-kmod-legacy?
> >> Do they need the same patch?  
> > They all need the patch since vm_page_find_least() was removed from 15.
> > This affected not only the vbox ports but the graphics/drm* ports as
> > well.  
> 
> Let's apply this patch to other versions of VirtualBox (taking into 
> account the requirement to use make makepatch).

Sure. I'll look at that tomorrow then. My testbed box will be free then.

> 
> >> Please either fix the patch taking into account the comments above, and
> >> also prepare patches for other versions of VirtualBox, or revert the
> >> commit and create a PR with the proposed patch, and I will fix it myself
> >> and port it to other versions of VirtualBox (if necessary).
> >>
> >> If you don't do any of the above, then I, as the maintainer, will do
> >> everything myself on May 1st.  
> > I can apply the same fixes to all the vbox ports if you want or if you
> > prefer, that's fine by me as well.
> >
> > Sorry for stepping on your toes here. It wasn't my intention to take
> > over, just to fix a broken port. I'm perfectly fine only opening PRs for
> > the vbox ports if you prefer.  
> 
> Let's start with the fact that we will prepare a corrective patch for 
> 7.0 using make makepatch. Then for the two remaining ports.

I can upload a patch to the PR you reference below.

> The only thing is that I don't have FreeBSD 15 anywhere to test the 
> build, so this task is either on you or I will ask someone else.

All I have is 15 here at home. Again, it's part of the job. I (we) use
13 and 14 -RELEASE (managed using binary updates) at $JOB.

> 
> I suggest continuing the technical discussion in PR 
> https://bugs.freebsd.org/286206.

Sure.

> 
> 
> P.S. Almost all of my answers in this letter were translated using an 
> online translator, so there may be errors, but it's still better than if 
> I wrote everything myself without using them.
> 
> >> 28.04.2025 23:32, Cy Schubert пишет:  
> >>> The branch main has been updated by cy:
> >>>
> >>> URL:https://cgit.FreeBSD.org/ports/commit/?id=a8b4678fc9255e3c2c95598c95bf5972941998fd
> >>>
> >>> commit a8b4678fc9255e3c2c95598c95bf5972941998fd
> >>> Author:     Cy Schubert<cy@FreeBSD.org>
> >>> AuthorDate: 2025-04-28 17:19:13 +0000
> >>> Commit:     Cy Schubert<cy@FreeBSD.org>
> >>> CommitDate: 2025-04-28 20:29:16 +0000
> >>>
> >>>       emulators/virtualbox-ose-70: Fix 15-CURRENT kmod build
> >>>       
> >>>       One remaining instance of vm_page_find_least(), which was removed in
> >>>       15-CURRENT, remained. Replace it with a call to vm_radix_lookup_ge()
> >>>       instead.
> >>> ---
> >>>    ...ox_Runtime_r0drv_freebsd_memobj-r0drv-freebsd.c | 80 +++++++++++++---------
> >>>    1 file changed, 46 insertions(+), 34 deletions(-)
> >>>
> >>> diff --git a/emulators/virtualbox-ose-70/files/patch-src_VBox_Runtime_r0drv_freebsd_memobj-r0drv-freebsd.c b/emulators/virtualbox-ose-70/files/patch-src_VBox_Runtime_r0drv_freebsd_memobj-r0drv-freebsd.c
> >>> index 7b8767a8aa58..205c897c818d 100644
> >>> --- a/emulators/virtualbox-ose-70/files/patch-src_VBox_Runtime_r0drv_freebsd_memobj-r0drv-freebsd.c
> >>> +++ b/emulators/virtualbox-ose-70/files/patch-src_VBox_Runtime_r0drv_freebsd_memobj-r0drv-freebsd.c
> >>> @@ -1,6 +1,6 @@
> >>> ---- src/VBox/Runtime/r0drv/freebsd/memobj-r0drv-freebsd.c.orig	2025-01-21 14:07:00 UTC
> >>> -+++ src/VBox/Runtime/r0drv/freebsd/memobj-r0drv-freebsd.c
> >>> -@@ -139,8 +139,10 @@ DECLHIDDEN(int) rtR0MemObjNativeFree(RTR0MEMOBJ pMem)
> >>> +--- src/VBox/Runtime/r0drv/freebsd/memobj-r0drv-freebsd.c.orig	2025-04-11 05:12:39.000000000 -0700
> >>> ++++ src/VBox/Runtime/r0drv/freebsd/memobj-r0drv-freebsd.c	2025-04-28 10:14:45.981609000 -0700
> >>> +@@ -139,8 +139,10 @@  
> 
> 



-- 
Cheers,
Cy Schubert <Cy.Schubert@cschubert.com>
FreeBSD UNIX:  <cy@FreeBSD.org>   Web:  https://FreeBSD.org
NTP:           <cy@nwtime.org>    Web:  https://nwtime.org

			e^(i*pi)+1=0