Bug 279430 - devel/subversion{,-lts}: silent dependency on pkgconf
Summary: devel/subversion{,-lts}: silent dependency on pkgconf
Status: Closed FIXED
Alias: None
Product: Ports & Packages
Classification: Unclassified
Component: Individual Port(s) (show other bugs)
Version: Latest
Hardware: Any Any
: --- Affects Only Me
Assignee: Michael Osipov
URL:
Keywords:
Depends on:
Blocks:
 
Reported: 2024-05-31 10:57 UTC by jakub_lach
Modified: 2024-08-15 10:10 UTC (History)
3 users (show)

See Also:
vvd: maintainer-feedback?


Attachments

Note You need to log in before you can comment on or make changes to this bug.
Description jakub_lach 2024-05-31 10:57:27 UTC
/usr/ports/net-mgmt/observium $ sudo make clean
Password:
sh: pkgconf: not found
make[2]: "/usr/ports/devel/subversion/Makefile" line 137: warning: "pkgconf --libs --static sqlite3" returned non-zero status
===>  Cleaning for observium-php81-0.19.8_3

<...>

/usr/ports/devel/subversion $ sudo make clean
Password:
sh: pkgconf: not found
make: "/usr/ports/devel/subversion/Makefile" line 137: warning: "pkgconf --libs --static sqlite3" returned non-zero status
sh: pkgconf: not found
make[1]: "/usr/ports/devel/subversion/Makefile" line 137: warning: "pkgconf --libs --static sqlite3" returned non-zero status
sh: pkgconf: not found
make[1]: "/usr/ports/devel/subversion/Makefile" line 137: warning: "pkgconf --libs --static sqlite3" returned non-zero status
===>  Cleaning for subversion-1.14.3_7
sh: pkgconf: not found
make[1]: "/usr/ports/devel/subversion/Makefile" line 137: warning: "pkgconf --libs --static sqlite3" returned non-zero status
Comment 1 Bugzilla Automation freebsd_committer freebsd_triage 2024-05-31 10:57:27 UTC
Maintainer informed via mail
Comment 2 Vladimir Druzenko freebsd_committer freebsd_triage 2024-05-31 11:05:47 UTC
Try this:
 .if ${PORT_OPTIONS:MSTATIC}
+USES+=          pkgconfig
 LIBS_SQLITE3!=  pkgconf --libs --static sqlite3
 LIBS+=          ${LIBS_SQLITE3}
 # for work with ICU
 LIBS+=          -lc++ -lm
 .endif

Or this:
 .if ${PORT_OPTIONS:MSTATIC}
+USES+=                  pkgconfig
 .  if ${PORT_OPTIONS:MNLS}
 USES+=                  gettext-tools
 .  endif
 .  if ${PORT_OPTIONS:MBDB}
 BDB_BUILD_DEPENDS=      yes
 .  endif
 OLD_LIB_DEPENDS:=       ${LIB_DEPENDS:S!^!${LOCALBASE}/lib/!:C!(\.so|\.[0-9]+)?:!.a:!}
 BUILD_DEPENDS+=         ${OLD_LIB_DEPENDS}
 LIB_DEPENDS=
 .endif
Comment 3 Michael Osipov freebsd_committer freebsd_triage 2024-07-22 11:43:38 UTC
I believe that somthing is wrong on your end. Subversion already depends on pkgconfig in shared and static mode:
osipovmi@deblndw011x:~/var/Projekte/freebsd/ports/devel/subversion-lts (main =)
$ make -V USES
shebangfix python:env cpe libtool pathfix pkgconfig shebangfix tar:bzip2 gettext

static:
osipovmi@deblndw011x:~/var/Projekte/freebsd/ports/devel/subversion-lts (main =)
$ make -V USES
shebangfix python:env cpe libtool pathfix pkgconfig shebangfix tar:bzip2 gettext gettext-tools

osipovmi@deblndw011x:~/var/Projekte/freebsd/ports/devel/subversion (main =)
$ make -V USES
shebangfix python:env cpe libtool pathfix pkgconfig shebangfix tar:bzip2 gettext

static:
osipovmi@deblndw011x:~/var/Projekte/freebsd/ports/devel/subversion (main =)
$ make -V USES
shebangfix python:env cpe libtool pathfix pkgconfig shebangfix tar:bzip2 gettext gettext-tools
Comment 4 jakub_lach 2024-07-22 14:39:27 UTC
(In reply to Michael Osipov from comment #3)

/usr/ports/devel/subversion $ make -V USES                                         
sh: pkgconf: not found
make: "/usr/ports/devel/subversion/Makefile" line 137: warning: "pkgconf --libs --static sqlite3" returned non-zero status
shebangfix python:env cpe libtool pathfix pkgconfig shebangfix tar:bzip2
Comment 5 Michael Osipov freebsd_committer freebsd_triage 2024-07-22 18:49:25 UTC
(In reply to jakub_lach from comment #4)

I understand it now. It exec the shell to run pkgconf. For me, this is a chicken-and-egg problem because USES runs for build and/or runtime dependencies, but "make -V USES" is way before since it needs to resolve all vars before printing anything to the screen.

I can reproduce this:
root@deblndw013x:/usr/ports/devel/subversion-lts
# make -V USES
sh: pkgconf: not found
make: "/usr/ports/devel/subversion-lts/Makefile" line 138: warning: "pkgconf --libs --static sqlite3" returned non-zero status
shebangfix python:env cpe libtool pathfix pkgconfig shebangfix tar:bzip2 gettext gettext-tools

But even if, how will this make it static:
# pkgconf --libs --static sqlite3
-L/usr/local/lib -lsqlite3 -lz -lm -lpthread

Let me play around with a bit.
Comment 6 Michael Osipov freebsd_committer freebsd_triage 2024-07-22 22:10:45 UTC
I was able to make some progress, but you need to report a PR with textproc/utf8proc because it does not provide a static library, dynamic only:
diff --git a/textproc/utf8proc/Makefile b/textproc/utf8proc/Makefile
index 05bb4bbf8fd4..cc23d0111060 100644
--- a/textproc/utf8proc/Makefile
+++ b/textproc/utf8proc/Makefile
@@ -1,5 +1,6 @@
 PORTNAME=  utf8proc
 DISTVERSION=   2.9.0
+PORTREVISION=  1
 CATEGORIES=    textproc devel
 MASTER_SITES=  https://github.com/JuliaStrings/${PORTNAME}/releases/download/v${DISTVERSION}/

@@ -13,12 +14,10 @@ LICENSE_FILE=   ${WRKSRC}/LICENSE.md
 USES=      cmake
 USE_LDCONFIG=  yes

-CMAKE_ON=  BUILD_SHARED_LIBS
+CMAKE_ON=  BUILD_STATIC_LIBS

 PLIST_FILES=   include/utf8proc.h \
-       lib/libutf8proc.so \
-       lib/libutf8proc.so.3 \
-       lib/libutf8proc.so.3.0.0 \
+       lib/libutf8proc.a \
Comment 7 Michael Osipov freebsd_committer freebsd_triage 2024-07-22 22:13:51 UTC
After some tricks in poudriere it did work:
nobody@133-release-amd64-default-head:/usr/ports/devel/subversion-lts $ ldd /usr/local/bin/svn
ldd: /usr/local/bin/svn: not a dynamic ELF executable
nobody@133-release-amd64-default-head:/usr/ports/devel/subversion-lts $ file /usr/local/bin/svn
/usr/local/bin/svn: ELF 64-bit LSB executable, x86-64, version 1 (FreeBSD), statically linked, for FreeBSD 13.3, FreeBSD-style, stripped

Waiting for utf8proc fix first.
Comment 8 Michael Osipov freebsd_committer freebsd_triage 2024-07-24 10:56:50 UTC
Issue created with utf8proc and review for this created as https://reviews.freebsd.org/D46096. The review can go live anytime it will not affect dynamic linking. As soon as utf8proc is fixed all will works. It works for me at least in poudriere flawlessly.
Comment 9 Michael Osipov freebsd_committer freebsd_triage 2024-07-25 08:57:33 UTC
Please check the review and the blocking issue, the maintainer isn't willing to provide an archive of libutf8proc.
Comment 10 jakub_lach 2024-07-25 12:43:06 UTC
Thanks, appreciated! I discovered the issue by chance.
Comment 11 Michael Osipov freebsd_committer freebsd_triage 2024-07-25 13:50:44 UTC
(In reply to jakub_lach from comment #10)

Good, then I can modify the commit message that there are no reports so far.
Comment 12 commit-hook freebsd_committer freebsd_triage 2024-08-15 10:09:35 UTC
A commit in branch main references this bug:

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

commit 223bd7be732992fecbb2d554623c8322eb2dea2b
Author:     Michael Osipov <michaelo@apache.org>
AuthorDate: 2024-07-22 20:44:53 +0000
Commit:     Michael Osipov <michaelo@FreeBSD.org>
CommitDate: 2024-08-15 10:07:59 +0000

    devel/subversion{,-lts}: remove port option STATIC

    Since the switch to CMake for textproc/utf8proc
    (207abfe1369d1ef1d89fae73b1091b37b9060ef7) the static library is not being built
    anymore. This means that the static build of Subversion has been broken since
    2022-01. For the past two years only one has complained (PR 279430) and
    the maintainer of textproc/utf8proc (PR 280429) cannot easily provide an archive
    with CMake anymore. Therefore, removing the STATIC port option for good.

    PR:             279430
    Approved by:    jrm (mentor)
    Differential Revision:  https://reviews.freebsd.org/D46096

 UPDATING                             |  7 +++
 devel/subversion-lts/Makefile        | 29 +-----------
 devel/subversion-lts/Makefile.common | 15 +-----
 devel/subversion-lts/pkg-plist       | 90 ++++++++++++++++++------------------
 devel/subversion/Makefile            | 29 +-----------
 devel/subversion/Makefile.common     | 15 +-----
 devel/subversion/pkg-plist           | 90 ++++++++++++++++++------------------
 7 files changed, 103 insertions(+), 172 deletions(-)
Comment 13 Michael Osipov freebsd_committer freebsd_triage 2024-08-15 10:10:02 UTC
Port option has been removed.