Bug 243864

Summary: emulators/open-vm-tools-nox11: fails to build after r357287 and/or r357403
Product: Ports & Packages Reporter: Ruslan Garipov <brigadir15>
Component: Individual Port(s)Assignee: Josh Paetzel <jpaetzel>
Status: Closed FIXED    
Severity: Affects Only Me CC: mjg
Priority: --- Flags: bugzilla: maintainer-feedback? (jpaetzel)
Version: Latest   
Hardware: Any   
OS: Any   
Attachments:
Description Flags
Remove the VDESC_NOMAP_VPP and VDESC_VPP_WILLRELE flags (v0)
none
Remove the VDESC_NOMAP_VPP and VDESC_VPP_WILLRELE flags (v1) none

Description Ruslan Garipov 2020-02-04 11:05:11 UTC
Created attachment 211338 [details]
Remove the VDESC_NOMAP_VPP and VDESC_VPP_WILLRELE flags (v0)

I'm trying to build emulators/open-vm-tools-nox11 on FreeBSD 13.0-CURRENT r357195 with /usr/src updated to r357494:

# cd /usr/ports/emulators/open-vm-tools-nox11
# make build
...
vnops.c:536:31: error: use of undeclared identifier 'VDESC_NOMAP_VPP'
       !(descp->vdesc_flags & VDESC_NOMAP_VPP) &&
                              ^

vnops.c:543:32: error: use of undeclared identifier 'VDESC_VPP_WILLRELE'
      if (descp->vdesc_flags & VDESC_VPP_WILLRELE) {
                               ^

2 errors generated
...

The first error is caused by r357287[1] which removed the VDESC_NOMAP_VPP flag.  The second one -- by r357403[2] which removed the VDESC_VPP_WILLRELE flag.

I picked the changes made in those revisions in file sys/fs/nullfs/null_vnops.c and applied them to the port's file modules/freebsd/vmblock/vnops.c using define-guards.  But, because neither r357287, nor r357403 changed the __FreeBSD_version, I have to use `#if __FreeBSD_version < 1300076` to be able to build the port on FreeBSD 13.0-CURRENT r357195 (which is 1300076; since r356511[3]).  Therefore, the patch I attached may not be completely correct if the removed flags somehow are in use between r356511 and r357287.

Please review.

[1] https://svnweb.freebsd.org/base?view=revision&revision=357287
[2] https://svnweb.freebsd.org/base?view=revision&revision=357403
[3] https://svnweb.freebsd.org/base?view=revision&revision=356511
Comment 1 Mateusz Guzik freebsd_committer freebsd_triage 2020-02-05 22:08:22 UTC
Sorry for build breakage.

You can unconditionally stop handling handling both flags. If my git log is right, FreeBSD *never* set them. They got inherited from the original BSD codebase and not cleaned up. iow no version checks are necessary.
Comment 2 Josh Paetzel freebsd_committer freebsd_triage 2020-02-05 22:15:50 UTC
Thanks for the quick reply.  No apologies needed, such is the way of things for out of tree drivers.
Comment 3 Ruslan Garipov 2020-02-06 03:11:02 UTC
Created attachment 211404 [details]
Remove the VDESC_NOMAP_VPP and VDESC_VPP_WILLRELE flags (v1)

> You can unconditionally stop handling handling both flags
I removed define-guards from my original patch.

Mateusz, thanks for your hints!
Comment 4 Josh Paetzel freebsd_committer freebsd_triage 2020-02-06 19:54:09 UTC
Ruslan,

The patch you attached contains a change from patches you submitted previously I've already committed, I'm just going to pull those changes out and commit your new changes.

As always, thanks for your help with this.
Comment 5 commit-hook freebsd_committer freebsd_triage 2020-02-06 20:19:08 UTC
A commit references this bug:

Author: jpaetzel
Date: Thu Feb  6 20:18:10 UTC 2020
New revision: 525444
URL: https://svnweb.freebsd.org/changeset/ports/525444

Log:
  Unbreak build on HEAD

  PR:	243864
  Submitted by:	Ruslan Garipov <brigadir15@gmail.com>
  Sponsored by:	Panzura

Changes:
  head/emulators/open-vm-tools/Makefile
  head/emulators/open-vm-tools/files/patch-modules_freebsd_vmblock_vnops.c
Comment 6 Ruslan Garipov 2020-02-07 03:16:56 UTC
(In reply to Josh Paetzel from comment #4)
> The patch you attached contains a change from patches you submitted
> previously I've already committed, I'm just going to pull those
> changes out and commit your new changes.
Josh, I'm sorry I've added an extra work for you.  Yes, I recreate
patch-modules_freebsd_vmblock_vnops.c with `make makepatch` from the
scratch to preserve the previous changes (read: to be able to build the
port).  I just failed to think that posting "complete" patch would force
you to pick some parts from it.

Thanks for committing!