Bug 258349 - benchmarks/fio: build fails if libnfs is installed
Summary: benchmarks/fio: build fails if libnfs is installed
Status: New
Alias: None
Product: Ports & Packages
Classification: Unclassified
Component: Individual Port(s) (show other bugs)
Version: Latest
Hardware: Any Any
: --- Affects Some People
Assignee: Kirill Ponomarev
Depends on:
Reported: 2021-09-07 20:34 UTC by John Hein
Modified: 2021-09-13 18:01 UTC (History)
2 users (show)

See Also:
bugzilla: maintainer-feedback? (krion)

[patch] add NFS option so dependency on libnfs is explicit (852 bytes, patch)
2021-09-09 20:47 UTC, John Hein
jcfyecrayz: maintainer-approval? (krion)
Details | Diff

Note You need to log in before you can comment on or make changes to this bug.
Description John Hein 2021-09-07 20:34:27 UTC
If the libnfs port/package is installed, 'make configure' enables nfs support and 'make build' fails:

    CC engines/nfs.o
In file included from engines/nfs.c:3:
/usr/local/include/nfsc/libnfs.h:1216:23: error: field has incomplete type
      'struct timeval'
       struct timeval atime;


 - patch to include sys/time.h (and pass upstream).  This is actually, now that I look at it closer, maybe more of a libnfs bug.

 - explicitly disable nfs support (--disable-libnfs)

 - make an NFS option (pass --enable-libnfs and add to LIB_DEPENDS).  This port should not be silently dependent on libnfs anyway - there should be an explicit LIB_DEPENDS for libnfs (if desired).

I guess I vote for patching libnfs to include the right file in libnfs.h, and makeing NFS support in fio an OPTION.
Comment 1 John Hein 2021-09-08 21:08:06 UTC
See also bug 258376 for a real world example.
Comment 2 VVD 2021-09-09 17:30:31 UTC
(In reply to John Hein from comment #0)
If you want I can create patches for both ports.

P.S. Just found same issue and prepared for report bug upstream, but found this: https://github.com/sahlberg/libnfs/issues/358.
Comment 3 John Hein 2021-09-09 20:47:06 UTC
Created attachment 227795 [details]
[patch] add NFS option so dependency on libnfs is explicit

Add NFS option so dependency on libnfs is explicit.  Right now, libnfs is detected at configure time.  If it is found, fio is linked with libnfs.  Since the dependency is not (currently) recorded, libnfs could later be removed, and fio would be left broken (not runnable due to missing lib).

This new option defaults to off which matches how packages were built when no libnfs was installed.

 portlint - ok
 testport - ok (tested with NFS off and on)
Comment 4 Kirill Ponomarev freebsd_committer 2021-09-10 06:21:17 UTC
libnfs package is not a dependency, I didn't intend to add it as a dependency yet, I assume you build the package not in poudriere. Anyway I'd like to wait for upstream decision and resolution on that.
Comment 5 John Hein 2021-09-13 18:01:14 UTC
(In reply to Kirill Ponomarev from comment #4)
libnfs becomes a dependency if it is installed and the fio 'configure' step detects it.  This can occur outside of poudriere certainly, but also inside poudriere if you do a 'bulk' build that includes both libnfs and fio.

I can understand waiting until libnfs is fixed before proceeding - either via the upstream issue #358 or bug 258376.  No response yet on either.