Bug 265904 - www/wt: update to 4.8.0
Summary: www/wt: update to 4.8.0
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: Fernando Apesteguía
URL: https://www.webtoolkit.eu/wt/doc/refe...
Keywords:
Depends on:
Blocks:
 
Reported: 2022-08-17 14:43 UTC by Mohammad S. Babaei
Modified: 2022-08-18 17:22 UTC (History)
1 user (show)

See Also:


Attachments
www/wt 4.7.2 to 4.8.0 (1.99 KB, patch)
2022-08-17 14:44 UTC, Mohammad S. Babaei
info: maintainer-approval+
info: maintainer-approval+
Details | Diff
www/wt 4.7.2 to 4.8.0 with DEBUG option (6.80 KB, patch)
2022-08-18 11:41 UTC, Mohammad S. Babaei
info: maintainer-approval+
info: maintainer-approval+
Details | Diff
www/wt 4.7.2 to 4.8.0 with simplified DEBUG option (6.80 KB, patch)
2022-08-18 11:53 UTC, Mohammad S. Babaei
info: maintainer-approval+
Details | Diff
www/wt 4.7.2 to 4.8.0 (5.93 KB, patch)
2022-08-18 13:01 UTC, Mohammad S. Babaei
info: maintainer-approval+
Details | Diff
www/wt 4.7.2 to 4.8.0 (5.95 KB, patch)
2022-08-18 15:16 UTC, Mohammad S. Babaei
info: maintainer-approval+
Details | Diff

Note You need to log in before you can comment on or make changes to this bug.
Description Mohammad S. Babaei 2022-08-17 14:43:33 UTC

    
Comment 1 Mohammad S. Babaei 2022-08-17 14:44:08 UTC
Created attachment 235968 [details]
www/wt 4.7.2 to 4.8.0
Comment 2 Fernando Apesteguía freebsd_committer freebsd_triage 2022-08-18 08:56:46 UTC
Hi Mohammad,

There are some issues with the plist. Would you have a look?

====> Running Q/A tests (stage-qa)
====> Checking for pkg-plist issues (check-plist)
===> Parsing plist
===> Checking for items in STAGEDIR missing from pkg-plist
Error: Orphaned: lib/cmake/wt/wt-target-dbo-%%CMAKE_BUILD_TYPE%%.cmake
Error: Orphaned: lib/cmake/wt/wt-target-dbosqlite3-%%CMAKE_BUILD_TYPE%%.cmake
Error: Orphaned: lib/cmake/wt/wt-target-fcgi-%%CMAKE_BUILD_TYPE%%.cmake
Error: Orphaned: lib/cmake/wt/wt-target-http-%%CMAKE_BUILD_TYPE%%.cmake
Error: Orphaned: lib/cmake/wt/wt-target-test-%%CMAKE_BUILD_TYPE%%.cmake
Error: Orphaned: lib/cmake/wt/wt-target-wt-%%CMAKE_BUILD_TYPE%%.cmake
Error: Orphaned: lib/libwtd.so
Error: Orphaned: lib/libwtd.so.%%VERSION%%
Error: Orphaned: lib/libwtdbod.so
Error: Orphaned: lib/libwtdbod.so.%%VERSION%%
Error: Orphaned: lib/libwtdbosqlite3d.so
Error: Orphaned: lib/libwtdbosqlite3d.so.%%VERSION%%
Error: Orphaned: lib/libwtfcgid.so
Error: Orphaned: lib/libwtfcgid.so.%%VERSION%%
Error: Orphaned: lib/libwthttpd.so
Error: Orphaned: lib/libwthttpd.so.%%VERSION%%
Error: Orphaned: lib/libwttestd.so
Error: Orphaned: lib/libwttestd.so.%%VERSION%%
===> Checking for items in pkg-plist which are not in STAGEDIR
Error: Missing: lib/cmake/wt/wt-target-dbo-release.cmake
Error: Missing: lib/cmake/wt/wt-target-dbosqlite3-release.cmake
Error: Missing: lib/cmake/wt/wt-target-fcgi-release.cmake
Error: Missing: lib/cmake/wt/wt-target-http-release.cmake
Error: Missing: lib/cmake/wt/wt-target-test-release.cmake
Error: Missing: lib/cmake/wt/wt-target-wt-release.cmake
Error: Missing: lib/libwt.so
Error: Missing: lib/libwt.so.%%VERSION%%
Error: Missing: lib/libwtdbo.so
Error: Missing: lib/libwtdbo.so.%%VERSION%%
Error: Missing: lib/libwtdbosqlite3.so
Error: Missing: lib/libwtdbosqlite3.so.%%VERSION%%
Error: Missing: lib/libwtfcgi.so
Error: Missing: lib/libwtfcgi.so.%%VERSION%%
Error: Missing: lib/libwthttp.so
Error: Missing: lib/libwthttp.so.%%VERSION%%
Error: Missing: lib/libwttest.so
Error: Missing: lib/libwttest.so.%%VERSION%%
===> Error: Plist issues found.
*** Error code 1
Comment 3 Mohammad S. Babaei 2022-08-18 10:01:12 UTC
Thank you for informing me.

I did not change the pkg-plist file for this release since there were not any file changes.

For me make stage and stage-qa pass successfully. But, I see the 'd' prefix in your logs which indicates this is a debug build not a release, hence the issue. Somehow your build builds the Debug variant (probably instead of the Release variant wihtout thr d prefix).

That's why for example you get:

Error: Orphaned: lib/libwtdbod.so

And:

Error: Missing: lib/libwtdbo.so

In the Port itself, we do not have any options for building a Debug variant. Shouldn't it by default build the release all the time in that case? If so, I can add the option to the CMake arguments list to always build the release variant.

If you thing, a Debug build is necessary as well for development, I could add the Option to the port to switch between Debug/Release and then modify the pkg-plist to handle separate Debug/Release produced files.
Comment 4 Mohammad S. Babaei 2022-08-18 11:00:47 UTC
OK, I've figured it out. I ended up adding a DEBUG option and it seems to work with the default options. Now testing the other options which require Qt, Postgres, Firebird, etc to build and after it's done, I'll submit a new patch.
Comment 5 Mohammad S. Babaei 2022-08-18 11:41:28 UTC
Created attachment 235990 [details]
www/wt 4.7.2 to 4.8.0 with DEBUG option

This patch works with DEBUG options enabled/disabled. Just wondering something. Why this works:

.if ${PORT_OPTIONS:MDEBUG}
WITH_DEBUG=	yes
PLIST_SUB+=	DEBUG_BUILD=""
PLIST_SUB+=	RELEASE_BUILD="@comment "
.else
PLIST_SUB+=	DEBUG_BUILD="@comment "
PLIST_SUB+=	RELEASE_BUILD=""
.endif

But, not this one:

.if ${PORT_OPTIONS:MDEBUG}
WITH_DEBUG=	yes
.endif

.if defined(${WITH_DEBUG})
PLIST_SUB+=	DEBUG_BUILD=""
PLIST_SUB+=	RELEASE_BUILD="@comment "
.else
PLIST_SUB+=	DEBUG_BUILD="@comment "
PLIST_SUB+=	RELEASE_BUILD=""
.endif
Comment 6 Mohammad S. Babaei 2022-08-18 11:53:25 UTC
Created attachment 235991 [details]
www/wt 4.7.2 to 4.8.0 with simplified DEBUG option

This is even more simplified. Instead of defining two variables in order to be used by pkg-plist. It just defines one.
Comment 7 Fernando Apesteguía freebsd_committer freebsd_triage 2022-08-18 12:10:17 UTC
(In reply to Mohammad S. Babaei from comment #6)
Nice work!

Would you have a look at a simpler way to do this? DEBUG_CMAKE_ON=...?
Comment 8 Mohammad S. Babaei 2022-08-18 12:59:28 UTC
Thank you!

I don't mind updating the patch, just I don't get where DEBUG_CMAKE_ON could be useful, except for passing variables to cmake in case of debug builds.

I looked up https://docs.freebsd.org/en/books/porters-handbook/book/ and found no information about it and it seems not so many ports are using it.

$ find /usr/ports/ -iname 'Makefile' | xargs grep -s 'DEBUG_CMAKE_ON'
/usr/ports/textproc/ctpp2/Makefile:DEBUG_CMAKE_ON=	-DDEBUG_MODE=ON
/usr/ports/deskutils/owncloudclient/Makefile:DEBUG_CMAKE_ON=		-DCMAKE_BUILD_TYPE:STRING=Debug
/usr/ports/multimedia/x265/Makefile:DEBUG_CMAKE_ON=		-DCMAKE_ASM_NASM_FLAGS:STRING="-g -O0"
/usr/ports/audio/audacity/Makefile:DEBUG_CMAKE_ON=		wxWidgets_USE_DEBUG
/usr/ports/mail/spmfilter-clamav/Makefile:DEBUG_CMAKE_ON=	-DENABLE_DEBUG=TRUE
/usr/ports/www/webkit2-gtk3/Makefile:DEBUG_CMAKE_ON=		-DCMAKE_AR=${LOCALBASE}/bin/ar \
/usr/ports/www/webkit2-gtk4/Makefile:DEBUG_CMAKE_ON=	-DCMAKE_AR=${LOCALBASE}/bin/ar \
/usr/ports/devel/caf/Makefile:DEBUG_CMAKE_ON=	-DCAF_ENABLE_RUNTIME_CHECKS:BOOL=yes
/usr/ports/devel/caf/Makefile:LOG_LEVEL_DEBUG_CMAKE_ON=	-DCAF_LOG_LEVEL:STRING=DEBUG
/usr/ports/x11-toolkits/termit/Makefile:DEBUG_CMAKE_ON=	-DDEBUG:BOOL=YES

According to the handbook WITH_DEBUG enables "DEBUG_CMAKE_ON=		-DCMAKE_BUILD_TYPE:STRING=Debug" as in the case of deskutils/owncloudclient. And also, WITH_DEBUG exports lower-cased value of CMAKE_BUILD_TYPE to PLIST_SUB in order for the the port to install *.cmake depending on the build type (www/wt use case).

So, that's why I am not sure what can I do with DEBUG_CMAKE_ON other than passing cmake flags. I'd appreciate it if you could elaborate.

Thank you!
Comment 9 Mohammad S. Babaei 2022-08-18 13:01:50 UTC
Created attachment 235994 [details]
www/wt 4.7.2 to 4.8.0

Sorry, the attached patch was the wrong one. Here is the correct one.
Comment 10 Fernando Apesteguía freebsd_committer freebsd_triage 2022-08-18 13:52:35 UTC
I was thinking of something like (UNTESTED):

DEBUG_CMAKE_ON = -DCMAKE_BUILD_TYPE=Debug

And then, the PLIST_SUB in a condition like this (as in www/squid):

if ${PORT_OPTIONS:MDEBUG} || defined(WITH_DEBUG)
...

In fact I triggered the problem using (accidentally) WITH_DEBUG. So we need to do the prefix thing in both cases.
Comment 11 Mohammad S. Babaei 2022-08-18 15:16:16 UTC
Created attachment 235995 [details]
www/wt 4.7.2 to 4.8.0

Thank you very much for the hints!

I guess this patch should address everything now. It builds with(out) DEBUG option whether WITH_DEBUG is defined inside make.conf or through env vars, or not.

I was doing this wrong in the snippet above:

.if defined(${WITH_DEBUG})

Which should be:

.if defined(WITH_DEBUG)

But, yours was a more compact solution that I like as well:

.if ${PORT_OPTIONS:MDEBUG} || defined(WITH_DEBUG)
WITH_DEBUG?=	yes
PLIST_SUB+=	DEBUG_LIBS_POSTFIX="d"
.else
PLIST_SUB+=	DEBUG_LIBS_POSTFIX=""
.endif

Since WITH_DEBUG adds -DCMAKE_BUILD_TYPE=Debug or Release depending on the build type, the following seems redundant:

DEBUG_CMAKE_ON = -DCMAKE_BUILD_TYPE=Debug

And without it, everything works in any of the cases.
Comment 12 Fernando Apesteguía freebsd_committer freebsd_triage 2022-08-18 16:35:03 UTC
(In reply to Mohammad S. Babaei from comment #11)
Super!

Thanks!
Comment 13 commit-hook freebsd_committer freebsd_triage 2022-08-18 17:22:23 UTC
A commit in branch main references this bug:

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

commit 48e45257a7225100a3e11f476cb0bd0911f2a096
Author:     Mohammad S. Babaei <info@babaei.net>
AuthorDate: 2022-08-18 15:45:03 +0000
Commit:     Fernando Apesteguía <fernape@FreeBSD.org>
CommitDate: 2022-08-18 17:17:59 +0000

    www/wt: update to 4.8.0

    ChangeLog: https://www.webtoolkit.eu/wt/doc/reference/html/Releasenotes.html

    PR:             265904
    Reported by:    info@babaei.net (maintainer)

 www/wt/Makefile                   | 11 ++++++--
 www/wt/distinfo                   |  6 ++---
 www/wt/files/patch-CMakeLists.txt |  6 +++--
 www/wt/pkg-plist                  | 54 +++++++++++++++++++--------------------
 4 files changed, 43 insertions(+), 34 deletions(-)
Comment 14 Fernando Apesteguía freebsd_committer freebsd_triage 2022-08-18 17:22:55 UTC
Committed,

Thanks!