# Cannot compile textproc/iksemel



## nerozero (Mar 31, 2021)

Cannot update asterisk port, - error while chompiling textproc/iksemel  ver 1.5 (meduketto-iksemel-1.5-978b733_GH0):


```
--- libiksemel_la-md5.lo ---
mv -f .deps/libiksemel_la-md5.Tpo .deps/libiksemel_la-md5.Plo
--- libiksemel_la-tls-openssl.lo ---
tls-openssl.c:27:3: error: incomplete definition of type 'struct bio_st'
        b->init = 1;
        ~^
/usr/local/include/openssl/ossl_typ.h:79:16: note: forward declaration of 'struct bio_st'
typedef struct bio_st BIO;
               ^
tls-openssl.c:28:3: error: incomplete definition of type 'struct bio_st'
        b->num = 0;
        ~^
/usr/local/include/openssl/ossl_typ.h:79:16: note: forward declaration of 'struct bio_st'
typedef struct bio_st BIO;
               ^
tls-openssl.c:29:3: error: incomplete definition of type 'struct bio_st'
        b->ptr = NULL;
        ~^
/usr/local/include/openssl/ossl_typ.h:79:16: note: forward declaration of 'struct bio_st'
typedef struct bio_st BIO;
               ^
tls-openssl.c:30:3: error: incomplete definition of type 'struct bio_st'
        b->flags = 0 ;
        ~^
/usr/local/include/openssl/ossl_typ.h:79:16: note: forward declaration of 'struct bio_st'
typedef struct bio_st BIO;
               ^
tls-openssl.c:39:3: error: incomplete definition of type 'struct bio_st'
        b->ptr = NULL;
        ~^
/usr/local/include/openssl/ossl_typ.h:79:16: note: forward declaration of 'struct bio_st'
typedef struct bio_st BIO;
               ^
tls-openssl.c:40:3: error: incomplete definition of type 'struct bio_st'
        b->init = 0;
        ~^
/usr/local/include/openssl/ossl_typ.h:79:16: note: forward declaration of 'struct bio_st'
typedef struct bio_st BIO;
               ^
tls-openssl.c:41:3: error: incomplete definition of type 'struct bio_st'
        b->flags = 0;
        ~^
/usr/local/include/openssl/ossl_typ.h:79:16: note: forward declaration of 'struct bio_st'
typedef struct bio_st BIO;
               ^
tls-openssl.c:48:53: error: incomplete definition of type 'struct bio_st'
        struct ikstls_data *data = (struct ikstls_data *) b->ptr;
                                                          ~^
/usr/local/include/openssl/ossl_typ.h:79:16: note: forward declaration of 'struct bio_st'
typedef struct bio_st BIO;
               ^
tls-openssl.c:61:53: error: incomplete definition of type 'struct bio_st'
        struct ikstls_data *data = (struct ikstls_data *) b->ptr;
                                                          ~^
/usr/local/include/openssl/ossl_typ.h:79:16: note: forward declaration of 'struct bio_st'
typedef struct bio_st BIO;
               ^
tls-openssl.c:92:19: error: variable has incomplete type 'BIO_METHOD' (aka 'struct bio_method_st')
static BIO_METHOD my_bio_method = {
                  ^
/usr/local/include/openssl/bio.h:250:16: note: forward declaration of 'struct bio_method_st'
typedef struct bio_method_st BIO_METHOD;
               ^
tls-openssl.c:138:5: error: incomplete definition of type 'struct bio_st'
        bio->ptr = (void *) data;
        ~~~^
/usr/local/include/openssl/ossl_typ.h:79:16: note: forward declaration of 'struct bio_st'
typedef struct bio_st BIO;
               ^
11 errors generated.
*** [libiksemel_la-tls-openssl.lo] Error code 1

make[2]: stopped in /usr/ports/textproc/iksemel/work/iksemel-978b733/src
--- libiksemel_la-base64.lo ---
mv -f .deps/libiksemel_la-base64.Tpo .deps/libiksemel_la-base64.Plo
1 error

make[2]: stopped in /usr/ports/textproc/iksemel/work/iksemel-978b733/src
===> Compilation failed unexpectedly.
Try to set MAKE_JOBS_UNSAFE=yes and rebuild before reporting the failure to
the maintainer.
*** Error code 1

Stop.
make: stopped in /usr/ports/textproc/iksemel
```


----------



## zirias@ (Mar 31, 2021)

So, you have OpenSSL from ports and it's picking that up, while being incompatible with it; from the error messages, it seems to still expect the public data structures that were recently hidden by OpenSSL.

Solution is probably to update your ports tree.

This port should be built with GnuTLS instead, and a recent commit made sure it always picks GnuTLS:





						[ports] Diff of /head/textproc/iksemel/Makefile
					






					svnweb.freebsd.org


----------



## nerozero (Mar 31, 2021)

Great thanks !
btw, the port tree is updated, but it doesn't effect that the port has no config options. Even on fresh ports site there is no config options. looks like I need to wait a bit


----------



## zirias@ (Mar 31, 2021)

How do you update the ports tree? This commit doesn't introduce an option, it just tells the port to _always_ use GnuTLS, even if OpenSSL is found in $prefix (which is the case when you have OpenSSL from ports installed). The commit is over 2 weeks old, so you should have it.

You can also check your build log whether `./configure` is indeed called with `--with-gnutls=yes`.


----------



## nerozero (Mar 31, 2021)

hm. 

i'm updating ports by using : `portsnap auto`

indeed, config logs shows that the option was passed: 

```
~~~ cat ./work/iksemel-978b733/config.log ~~~
----- 8< -----
  $ ./configure --with-gnutls=yes --disable-python --prefix=/usr/local --localstatedir=/var --mandir=/usr/local/man --disable-silent-rules --infodir=/usr/local/share/info/ --build=amd64-portbld-freebsd12.2
----- 8< -----
~~~ end cat ~~~
```
but still, can't compile port... 

i do have gnutls installed


----------



## zirias@ (Mar 31, 2021)

Ok, I had a look. Turns out it still has an "automagic" dependency on OpenSSL which even overrides GnuTLS (these are the kind of things you will never find testing with poudriere).

Please try this patch:

```
--- a/textproc/iksemel/Makefile
+++ b/textproc/iksemel/Makefile
@@ -20,6 +20,7 @@ GH_TAGNAME=   978b733
 USES=          autoreconf libtool makeinfo pathfix pkgconfig
 GNU_CONFIGURE= yes
 CONFIGURE_ARGS+=--with-gnutls=yes \
+               --without-openssl \
                --disable-python
 CPPFLAGS+=     ${CXXFLAGS} -I${LOCALBASE}/include
 LDFLAGS+=      -L${LOCALBASE}/lib
```


----------



## T-Daemon (Mar 31, 2021)

There is a bug report in progress to the build error:






						254296 – textproc/iksemel: fails to build in 12.2 amd64
					






					bugs.freebsd.org


----------



## zirias@ (Mar 31, 2021)

T-Daemon said:


> There is a bug report in progress to the build error:
> 
> PR 254296


Yes, that's exactly this problem. Added suggested patch there for testing…


----------



## T-Daemon (Mar 31, 2021)

Zirias said:


> Yes, that's exactly this problem. Added suggested patch there for testing…


Tested, build terminates successful.


----------



## zirias@ (Mar 31, 2021)

T-Daemon said:


> Tested, build terminates successful.


Are you the reporter, or did you have the same issue (with openssl installed from ports)? If so, please confirm in the PR


----------



## T-Daemon (Mar 31, 2021)

Zirias said:


> Are you the reporter, or did you have the same issue (with openssl installed from ports)?


I'm not the reporter, neither had I the same issue (I didn't heard of textproc/iksemel before), just read nerozero's problem, investigated it, found the PR, tested your patch.



Zirias said:


> please confirm in the PR


Done.


----------



## zirias@ (Mar 31, 2021)

T-Daemon said:


> I'm not the reporter, neither had I the same issue (I didn't heard of textproc/iksemel before), just read _*[FONT=monospace]nerozero[/FONT]*_'s problem, investigated it, found the PR, tested your patch.


Ah thanks! I was just asking because, to trigger the bug, OpenSSL headers (could probably be from LibreSSL as well) must be found in /usr/local/include, so a confirmation from someone who has them would be nice


----------



## T-Daemon (Apr 1, 2021)

Zirias said:


> to trigger the bug, OpenSSL headers (could probably be from LibreSSL as well) must be found in /usr/local/include



Tested setup (notice Test 6):

Test 1
security/openssl not installed, port builds fine

Test 2
security/openssl installed, headers in /usr/local/include/openssl 
 port build fails

Test 3
security/openssl installed, headers in /usr/local/include/openssl
 /etc/make.conf `DEFAULT_VERSIONS+=ssl=openssl` set, 
  port build fails

Test 4
  Test 2 with patch applied, port builds fine

Test 5
  Test 3 with patch applied, port builds fine

Test 6
  Port builds fine without patch, with security/libressl installed,
  headers in /usr/local/include/openssl


----------



## nerozero (Apr 1, 2021)

Thank you guys ! That was a very quick responses!


----------



## Bytor (Aug 18, 2021)

I just updated my poudriere ports trees and I am still running into this issue. When will this get integrated into the ports tree so that I can choose or disable SSL for textproc/iksemel? I use openssl for everything, rather than gnutls, whenever possible, and right now this bug is preventing me from building net/asterisk18.


----------



## SirDice (Aug 20, 2021)

Bytor said:


> When will this get integrated into the ports tree so that I can choose or disable SSL for textproc/iksemel?


The textproc/iksemel port doesn't have a maintainer. If nobody opens a PR and provides patches for the port then it won't get integrated.


----------

