Bug 269064 - editors/pico-alpine, mail/alpine: has stopped building with libressl
Summary: editors/pico-alpine, mail/alpine: has stopped building with libressl
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: Zsolt Udvari
URL:
Keywords:
Depends on:
Blocks:
 
Reported: 2023-01-19 23:23 UTC by Dave Hayes
Modified: 2024-10-28 06:33 UTC (History)
3 users (show)

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


Attachments
libressl fix for mail/alpine (574 bytes, patch)
2024-07-12 12:26 UTC, Zsolt Udvari
uzsolt: maintainer-approval? (mbeis)
Details | Diff

Note You need to log in before you can comment on or make changes to this bug.
Description Dave Hayes 2023-01-19 23:23:23 UTC
This is failing from a Q42022 build:

`cat CCTYPE` -c `cat CFLAGS` `cat OSCFLAGS` -c osdep.c
In file included from osdep.c:46:
In file included from ./env_unix.c:259:
./pmatch.c:41:43: warning: passing 'unsigned char *' to parameter of type 'const char *' converts between pointers to integer types where one is of the unique plain 'char' type and the other is not [-Wpointer-sign]
    if (!pat[1]) return (delim && strchr (s,delim)) ? NIL : T;
                                          ^
/usr/include/string.h:78:26: note: passing argument to parameter here
char    *strchr(const char *, int) __pure;
                            ^
There's many more. See https://www.jetcafe.org/dave/pico.log for the entire thing.
Comment 1 Dave Hayes 2023-02-13 04:48:07 UTC
osdep.c:766:11: error: incomplete definition of type 'struct x509_st'
  if (cert->name == NIL)
      ~~~~^
/usr/local/include/openssl/ossl_typ.h:147:16: note: forward declaration of 'struct x509_st'
typedef struct x509_st X509;
               ^
osdep.c:768:29: error: incomplete definition of type 'struct x509_st'
  else if ((s = strstr (cert->name,"/CN=")) != NIL) {


Those are the first errors. Any word on this?
Comment 2 Scuff 2023-03-25 14:05:42 UTC
I encountered this issue recently after updating LibreSSL. When using LibreSSL, the compile appears to be using blocks of code intended for versions of OpenSSL lower than 1.1.0, where some structs appear to be accessed directly.

This probably isn't the proper solution, but my workaround was to make the configure script treat LibreSSL the same as OpenSSL >= 1.1.0 as follows:

1) From the port directory, `make patch`
2) Make the following change to work/alpine-9726c09/configure:

--- configure.orig
+++ configure
@@ -19566,6 +19566,7 @@
    { $as_echo "$as_me:${as_lineno-$LINENO}: result: yes" >&5
 $as_echo "yes" >&6; }
          alpine_SSLPROVIDER="libressl"
+         CFLAGS="$CFLAGS -DOPENSSL_1_1_0 -DOPENSSL_API_COMPAT=0x10100000L"

 else
    { $as_echo "$as_me:${as_lineno-$LINENO}: result: no" >&5

3) Continue the build/install with `make`/`make install`/etc.

Hopefully this points someone towards a more proper solution. While it appears to work as it should (for the mail/alpine port as well), it would be good if verified as flaw-free by others more familiar.
Comment 3 Zsolt Udvari freebsd_committer freebsd_triage 2024-07-10 18:51:03 UTC
Is it still relevant?
Comment 4 Dave Hayes 2024-07-10 19:02:38 UTC
As far as 2024Q2 goes, yes. I am about to dive into Q3, but I'd imagine since nothing appears to have changed that the issue is still there.
Comment 5 Zsolt Udvari freebsd_committer freebsd_triage 2024-07-12 12:26:00 UTC
Created attachment 251991 [details]
libressl fix for mail/alpine

Add CFLAGS, based on Scuff's comment (https://bugs.freebsd.org/bugzilla/show_bug.cgi?id=269064#c2).
Comment 6 Zsolt Udvari freebsd_committer freebsd_triage 2024-07-12 12:26:29 UTC
Could you please test this patch? For me it's work.
Comment 7 Dave Hayes 2024-07-30 20:40:59 UTC
This builds as of 2023Q4. We will be testing execution within a couple weeks.
Comment 8 Zsolt Udvari freebsd_committer freebsd_triage 2024-08-06 18:46:02 UTC
Dave, works well?
Comment 9 Dave Hayes 2024-08-06 20:35:26 UTC
Yeah we are blocked from upgrading due to another port. I'll keep you posted. It builds! :D
Comment 10 Zsolt Udvari freebsd_committer freebsd_triage 2024-10-28 06:33:02 UTC
Committed, thanks!
Comment 11 commit-hook freebsd_committer freebsd_triage 2024-10-28 06:33:09 UTC
A commit in branch main references this bug:

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

commit 0f11f7ee593b45cf420f0d48246e14d979cb8452
Author:     Zsolt Udvari <uzsolt@FreeBSD.org>
AuthorDate: 2024-10-28 06:31:09 +0000
Commit:     Zsolt Udvari <uzsolt@FreeBSD.org>
CommitDate: 2024-10-28 06:31:09 +0000

    mail/alpine: fix build with libressl

    PR:             269064
    Reported by:    Dave Hayes <dave@jetcafe.org>
    Approved by:    maintainer timeout (3+ months)

 mail/alpine/Makefile | 3 ++-
 1 file changed, 2 insertions(+), 1 deletion(-)