Bug 277545

Summary: editors/vim implicitly requires libsodium (or lacks dependency)
Product: Ports & Packages Reporter: dewayne
Component: Individual Port(s)Assignee: Adam Weinberger <adamw>
Status: Closed FIXED    
Severity: Affects Only Me Flags: bugzilla: maintainer-feedback? (adamw)
Priority: ---    
Version: Latest   
Hardware: Any   
OS: Any   

Description dewayne 2024-03-07 03:25:42 UTC
Could you either ensure that libsodium is a build and run dependency or, and preferably make it an option?  Without libsodium installed it fails to build without any explanation.

I only use the FLAVOR=tiny for the simpliest of uses which don't require playing with encrypted files. So I added
--disable-libsodium

as follows:
.elif ${FLAVOR:U} == tiny
GUI=            no
CONFIGURE_ARGS+=--without-x --disable-libsodium

It also removes another unnecessary run-time library.
Comment 1 Adam Weinberger freebsd_committer freebsd_triage 2024-03-07 22:31:58 UTC
I've not seen any libsodium-related build failures. Can you show me an example?

Even if it's installed libsodium shouldn't be used without an explicit switch, so let's see if we can figure out what's different about your environment so I can replicate it.
Comment 2 dewayne 2024-03-08 02:54:47 UTC
(In reply to Adam Weinberger from comment #1)
Hi Adam.  I was trying to determine why vim required libsodium per 
/usr/local/bin/vim:
        libm.so.5 => /lib/libm.so.5 (0x3f09e1bc1000)
        libtinfo.so.6 => /usr/local/lib/libtinfo.so.6 (0x3f09e223b000)
        libsodium.so.23 => /usr/local/lib/libsodium.so.23 (0x3f09e342b000)
        librt.so.1 => /lib/librt.so.1 (0x3f09e2be0000)
        libc.so.7 => /lib/libc.so.7 (0x3f09e510d000)
        libthr.so.3 => /lib/libthr.so.3 (0x3f09e3805000)
        [vdso] (0x3f09e0790000)
Platform: 14.0-RELEASE-p5 amd64

Build log contains
checking --enable-libsodium argument... Defaulting to yes

Examining configure.ac which contains the "--enable-libsodium" test arises from
  # include <sodium.h>
but I was only removing /usr/local/lib/libsodium.so.23 to try to prevent the build.  My mistake.  So there is no build failure arising IF libsodium isn't installed.  However as we do we build on one and distribute to 16 other servers most do not have libsodium, preventing a vim with libsodium from working. A hidden pain :)

When I add --disable-libsodium, our world is a much more predictable and productive place. :)

I've gotten to really hate these hidden implicit dependencies, hence my request to make it explicit, or at least provide an option to --disable-libsodium, and with tiny - who needs it?  ;)
Comment 3 Adam Weinberger freebsd_committer freebsd_triage 2024-03-08 23:16:16 UTC
(In reply to dewayne from comment #2)
Definitely, that's all the evidence I need. I'll add --disable-libsodium.
Comment 4 commit-hook freebsd_committer freebsd_triage 2024-03-08 23:52:52 UTC
A commit in branch main references this bug:

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

commit e7350d88cce440077dce06f6caf269f071f6749d
Author:     Adam Weinberger <adamw@FreeBSD.org>
AuthorDate: 2024-03-08 23:50:16 +0000
Commit:     Adam Weinberger <adamw@FreeBSD.org>
CommitDate: 2024-03-08 23:50:31 +0000

    editors/vim: Update to 9.1.0158

    While here:
    - Add explicit --disable-libsodium [1]
    - Clear PORTREVISION on xxd as it gets a bump from this update

    PR:             277545
    Reported by:    dewayne heuristicsystems com au [1]

 editors/vim/Makefile  | 4 ++--
 editors/vim/distinfo  | 6 +++---
 sysutils/xxd/Makefile | 1 -
 3 files changed, 5 insertions(+), 6 deletions(-)
Comment 5 Adam Weinberger freebsd_committer freebsd_triage 2024-03-08 23:53:14 UTC
Committed along with this month's update. Thanks!