Bug 272371 - devel/poco: fail to build with openssl 3.0+
Summary: devel/poco: fail to build with openssl 3.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: Felix Palmen
URL:
Keywords:
Depends on:
Blocks:
 
Reported: 2023-07-04 20:04 UTC by Henry Hu
Modified: 2023-07-30 05:44 UTC (History)
1 user (show)

See Also:


Attachments
Update devel/poco to 1.12.4 (v1) (32.36 KB, patch)
2023-07-04 22:40 UTC, Henry Hu
no flags Details | Diff

Note You need to log in before you can comment on or make changes to this bug.
Description Henry Hu 2023-07-04 20:04:54 UTC
The port is failing to be built with OpenSSL 3, because RSA_SSLV23_PADDING is removed. This should be easy to fix, but we can just upgrade this port to a newer version. The latest version is 1.12.4.

This version fails to build with FreeBSD because of an issue related to its POSIX get thread ID implementation. There's a fix merged (https://github.com/pocoproject/poco/pull/3989/commits/5ff8cc080350351e3b10d742f5245df2625a207c?diff=split&w=0), but that'll only be available in a later version.

The plan is to update the port to 1.12.4 and backport the fix to this version. Currently the draft port builds, but options still need to be updated.
Comment 1 Henry Hu 2023-07-04 22:40:17 UTC
Created attachment 243252 [details]
Update devel/poco to 1.12.4 (v1)

Update poco to 1.12.4. Refactored the options:
* added many options to disable components
* Added Prometheus

Now it depends on PCRE2, instead of PCRE.
Cleaned up post-patch section of Makefile.

Patches:

1. Back-ported patch https://github.com/pocoproject/poco/commit/4cc956483d19efe65f883371fe275fdd563783e0 to make it compile. This can be removed in the next release.
2. Don't throw an exception if the legacy openssl module can't be loaded. As FreeBSD base / port OpenSSL 3+ don't have legacy module built by default, this causes the SSL related functionality of POCO to be unavailable. Since it only loads the provider, and the pointer is not used, it only affects the code which really needs the legacy functionalities.
Comment 2 Henry Hu 2023-07-04 22:46:59 UTC
poudriere log on 13.1-amd64: https://github.com/HenryHu/ports/blob/master/.logs/13.1-amd64/poco-1.12.4.log
Comment 3 Felix Palmen freebsd_committer freebsd_triage 2023-07-15 12:11:15 UTC
Hi Henry, there were two build issues, I will now just fix them in your patch:

- The IODBC option was broken, cmake now expects ODBC_INCLUDE_DIR (instead of ODBC_INCLUDE_DIRECTORIES).
- Building without any data backend was broken, you forgot to add %%DATA%% to several new files in plist.

Also, as I have to touch plist anyways, it wasn't properly sorted, it SHOULD just be sorted by (expanded) pathname, disregarding the option subs.

To avoid such issues, please always also test with all options set/unset and combine radio-options with that.

The port could also need some modernization now (without functional changes), I'll add another commit for that. Note I'll have to check whether all consumers still work (and bump them for the changed shlib version) before I can commit that.
Comment 4 Felix Palmen freebsd_committer freebsd_triage 2023-07-16 10:44:14 UTC
FYI: found yet more issues with the new ACTIVERECORD option...

* It automatically enables the abstract DATA layer. Solution: must be added to the condition handling %%DATA%% in PLIST_SUB
* It fails to build without XML support. Solution: add an _IMPLIES for XML
* The "Active Record Compiler" (arc) conflicts on installation with archivers/arc. security/clamfs depends on both, so this would break it. Solution: rename the compiler to "arc-poco".

These are all pretty small fixes, so I'll also just add them to your patch, I hope that's fine for you!
Comment 5 commit-hook freebsd_committer freebsd_triage 2023-07-16 15:05:35 UTC
A commit in branch main references this bug:

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

commit bcfeb2406519c3330a57ffb88adfa8b358ca1b45
Author:     Henry Hu <henry.hu.sh@gmail.com>
AuthorDate: 2023-07-04 22:40:17 +0000
Commit:     Felix Palmen <zirias@FreeBSD.org>
CommitDate: 2023-07-16 15:00:04 +0000

    devel/poco: Update to 1.12.4

    Full Changelog:
    https://github.com/pocoproject/poco/blob/poco-1.12.4/CHANGELOG

    PR:             272371

 devel/poco/Makefile                                |  82 ++-
 devel/poco/distinfo                                |   6 +-
 .../patch-Crypto_src_OpenSSLInitializer.cpp (new)  |  10 +
 .../patch-Foundation_src_Thread__POSIX.cpp (new)   |  49 ++
 devel/poco/pkg-plist                               | 590 ++++++++++++---------
 5 files changed, 449 insertions(+), 288 deletions(-)
Comment 6 Felix Palmen freebsd_committer freebsd_triage 2023-07-16 15:06:23 UTC
Committed (including the minor fixes mentioned above), thanks!
Comment 7 Henry Hu 2023-07-30 01:39:08 UTC
Thanks, Felix!
I wonder if you have a more systematic way to test the port. I've tested it with poudriere - and I think I've tested with all options selected & deselected, maybe I missed something.
Comment 8 Felix Palmen freebsd_committer freebsd_triage 2023-07-30 05:44:15 UTC
(In reply to Henry Hu from comment #7)
Hi Henry, that is indeed the way to do it, no worries. poudriere testport will identify issues with the plist. Of course, with a port having that many options, you can't sensibly test every single possible combination. With a somewhat complex options logic like here, a good rule of thumb for a good chance to identify issues is to test these configurations:

- default options
- all options off
- all options on
- every single option on with all other options off

This doesn't cover radio groups, I just made sure to combine any possible ODBC setting with one of the above configurations.

Cheers, Felix