Bug 258349 - benchmarks/fio: build fails if libnfs is installed
Summary: benchmarks/fio: build fails if libnfs is installed
Status: Closed FIXED
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
URL:
Keywords:
Depends on:
Blocks:
 
Reported: 2021-09-07 20:34 UTC by John Hein
Modified: 2022-05-19 07:12 UTC (History)
2 users (show)

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


Attachments
[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;
                      ^
  .
  .


Options:

 - 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 Vladimir Druzenko freebsd_committer freebsd_triage 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.

QA:
 portlint - ok
 testport - ok (tested with NFS off and on)
Comment 4 Kirill Ponomarev freebsd_committer freebsd_triage 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.
Comment 6 Vladimir Druzenko freebsd_committer freebsd_triage 2022-04-16 13:08:38 UTC
Update libnfs to 5.0.1:
https://bugs.freebsd.org/bugzilla/attachment.cgi?id=233249&action=diff
Comment 7 Vladimir Druzenko freebsd_committer freebsd_triage 2022-05-14 12:57:43 UTC
Can you add NFS option for port fio to prevent silent grab dependency on libnfs?
Comment 8 commit-hook freebsd_committer freebsd_triage 2022-05-19 07:11:15 UTC
A commit in branch main references this bug:

URL: https://cgit.FreeBSD.org/ports/commit/?id=cd14a91411b3b58f44c7d7b4d5940c356bb3602e

commit cd14a91411b3b58f44c7d7b4d5940c356bb3602e
Author:     Kirill Ponomarev <krion@FreeBSD.org>
AuthorDate: 2022-05-19 07:07:36 +0000
Commit:     Kirill Ponomarev <krion@FreeBSD.org>
CommitDate: 2022-05-19 07:10:57 +0000

    benchmarks/fio: Disable libnfs support by default

    PR:             258349
    Reported by:    John Hein <jcfyecrayz@liamekaens.com>

 benchmarks/fio/Makefile | 11 ++++++++---
 1 file changed, 8 insertions(+), 3 deletions(-)
Comment 9 commit-hook freebsd_committer freebsd_triage 2022-05-19 07:12:17 UTC
A commit in branch 2022Q2 references this bug:

URL: https://cgit.FreeBSD.org/ports/commit/?id=5934d43a8d971696eb77c3a7679d77ce87cbc59a

commit 5934d43a8d971696eb77c3a7679d77ce87cbc59a
Author:     Kirill Ponomarev <krion@FreeBSD.org>
AuthorDate: 2022-05-19 07:07:36 +0000
Commit:     Kirill Ponomarev <krion@FreeBSD.org>
CommitDate: 2022-05-19 07:11:37 +0000

    benchmarks/fio: Disable libnfs support by default

    PR:             258349
    Reported by:    John Hein <jcfyecrayz@liamekaens.com>

    (cherry picked from commit cd14a91411b3b58f44c7d7b4d5940c356bb3602e)

 benchmarks/fio/Makefile | 11 ++++++++---
 1 file changed, 8 insertions(+), 3 deletions(-)