Bug 245600 - net/qt5-network build fails with error: unknown type name 'OPENSSL_STACK'
Summary: net/qt5-network build fails with error: unknown type name 'OPENSSL_STACK'
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: kde
URL:
Keywords:
Depends on:
Blocks:
 
Reported: 2020-04-13 13:34 UTC by p5B2E9A8F
Modified: 2020-04-22 12:37 UTC (History)
3 users (show)

See Also:
tcberner: maintainer-feedback+


Attachments
Poudriere build log (123.87 KB, text/plain)
2020-04-13 13:34 UTC, p5B2E9A8F
no flags Details
libressl build fix (11.58 KB, patch)
2020-04-15 03:27 UTC, rozhuk.im
no flags Details | Diff
libressl build fix (11.56 KB, patch)
2020-04-16 05:05 UTC, rozhuk.im
no flags Details | Diff

Note You need to log in before you can comment on or make changes to this bug.
Description p5B2E9A8F 2020-04-13 13:34:59 UTC
Created attachment 213371 [details]
Poudriere build log

--- .obj/qsslcertificate.o ---
In file included from ssl/qsslcertificate.cpp:116:
In file included from ssl/qsslsocket_openssl_symbols_p.h:224:
ssl/qsslsocket_openssl11_symbols_p.h:88:40: error: unknown type name 'OPENSSL_STACK'
Q_AUTOTEST_EXPORT int q_OPENSSL_sk_num(OPENSSL_STACK *a);
                                       ^
ssl/qsslsocket_openssl11_symbols_p.h:89:46: error: unknown type name 'OPENSSL_STACK'
Q_AUTOTEST_EXPORT void q_OPENSSL_sk_pop_free(OPENSSL_STACK *a, void (*b)(void *));
                                             ^
ssl/qsslsocket_openssl11_symbols_p.h:90:19: error: unknown type name 'OPENSSL_STACK'; did you mean 'OPENSSL_BLOCK'?
Q_AUTOTEST_EXPORT OPENSSL_STACK *q_OPENSSL_sk_new_null();
                  ^~~~~~~~~~~~~
                  OPENSSL_BLOCK
/usr/local/include/openssl/safestack.h:132:15: note: 'OPENSSL_BLOCK' declared here
typedef void *OPENSSL_BLOCK;
              ^
In file included from ssl/qsslcertificate.cpp:116:
In file included from ssl/qsslsocket_openssl_symbols_p.h:224:
ssl/qsslsocket_openssl11_symbols_p.h:91:42: error: unknown type name 'OPENSSL_STACK'
Q_AUTOTEST_EXPORT void q_OPENSSL_sk_push(OPENSSL_STACK *st, void *data);
                                         ^
ssl/qsslsocket_openssl11_symbols_p.h:92:42: error: unknown type name 'OPENSSL_STACK'
Q_AUTOTEST_EXPORT void q_OPENSSL_sk_free(OPENSSL_STACK *a);
                                         ^
ssl/qsslsocket_openssl11_symbols_p.h:93:45: error: unknown type name 'OPENSSL_STACK'
Q_AUTOTEST_EXPORT void * q_OPENSSL_sk_value(OPENSSL_STACK *a, int b);
                                            ^
ssl/qsslsocket_openssl11_symbols_p.h:96:45: error: unknown type name 'OPENSSL_INIT_SETTINGS'
int q_OPENSSL_init_ssl(uint64_t opts, const OPENSSL_INIT_SETTINGS *settings);
                                            ^
ssl/qsslsocket_openssl11_symbols_p.h:109:50: error: unknown type name 'X509_STORE_CTX_verify_cb'
void q_X509_STORE_set_verify_cb(X509_STORE *ctx, X509_STORE_CTX_verify_cb verify_cb);
                                                 ^
ssl/qsslsocket_openssl11_symbols_p.h:128:48: error: unknown type name 'OPENSSL_INIT_SETTINGS'
int q_OPENSSL_init_crypto(uint64_t opts, const OPENSSL_INIT_SETTINGS *settings);
                                               ^
In file included from ssl/qsslcertificate.cpp:116:
ssl/qsslsocket_openssl_symbols_p.h:382:1: error: unknown type name 'SSL_CONF_CTX'; did you mean 'SSL_AEAD_CTX'?
SSL_CONF_CTX *q_SSL_CONF_CTX_new();
^~~~~~~~~~~~
SSL_AEAD_CTX
/usr/local/include/openssl/ssl.h:614:32: note: 'SSL_AEAD_CTX' declared here
typedef struct ssl_aead_ctx_st SSL_AEAD_CTX;
                               ^
In file included from ssl/qsslcertificate.cpp:116:
ssl/qsslsocket_openssl_symbols_p.h:383:26: error: unknown type name 'SSL_CONF_CTX'
void q_SSL_CONF_CTX_free(SSL_CONF_CTX *a);
                         ^
ssl/qsslsocket_openssl_symbols_p.h:384:33: error: unknown type name 'SSL_CONF_CTX'
void q_SSL_CONF_CTX_set_ssl_ctx(SSL_CONF_CTX *a, SSL_CTX *b);
                                ^
ssl/qsslsocket_openssl_symbols_p.h:385:39: error: unknown type name 'SSL_CONF_CTX'
unsigned int q_SSL_CONF_CTX_set_flags(SSL_CONF_CTX *a, unsigned int b);
                                      ^
ssl/qsslsocket_openssl_symbols_p.h:386:27: error: unknown type name 'SSL_CONF_CTX'
int q_SSL_CONF_CTX_finish(SSL_CONF_CTX *a);
                          ^
ssl/qsslsocket_openssl_symbols_p.h:387:20: error: unknown type name 'SSL_CONF_CTX'
int q_SSL_CONF_cmd(SSL_CONF_CTX *a, const char *b, const char *c);
                   ^
15 errors generated.
*** [.obj/qsslcertificate.o] Error code 1

make[1]: stopped in /wrkdirs/usr/ports/net/qt5-network/work/qtbase-everywhere-src-5.14.2/src/network
--- .obj/qsslkey_p.o ---
In file included from ssl/qsslkey_p.cpp:60:
In file included from ssl/qsslsocket_openssl_symbols_p.h:224:
ssl/qsslsocket_openssl11_symbols_p.h:88:40: error: unknown type name 'OPENSSL_STACK'
Q_AUTOTEST_EXPORT int q_OPENSSL_sk_num(OPENSSL_STACK *a);
                                       ^
ssl/qsslsocket_openssl11_symbols_p.h:89:46: error: unknown type name 'OPENSSL_STACK'
Q_AUTOTEST_EXPORT void q_OPENSSL_sk_pop_free(OPENSSL_STACK *a, void (*b)(void *));
                                             ^
ssl/qsslsocket_openssl11_symbols_p.h:90:19: error: unknown type name 'OPENSSL_STACK'; did you mean 'OPENSSL_BLOCK'?
Q_AUTOTEST_EXPORT OPENSSL_STACK *q_OPENSSL_sk_new_null();
                  ^~~~~~~~~~~~~
                  OPENSSL_BLOCK
/usr/local/include/openssl/safestack.h:132:15: note: 'OPENSSL_BLOCK' declared here
typedef void *OPENSSL_BLOCK;
              ^
In file included from ssl/qsslkey_p.cpp:60:
In file included from ssl/qsslsocket_openssl_symbols_p.h:224:
ssl/qsslsocket_openssl11_symbols_p.h:91:42: error: unknown type name 'OPENSSL_STACK'
Q_AUTOTEST_EXPORT void q_OPENSSL_sk_push(OPENSSL_STACK *st, void *data);
                                         ^
ssl/qsslsocket_openssl11_symbols_p.h:92:42: error: unknown type name 'OPENSSL_STACK'
Q_AUTOTEST_EXPORT void q_OPENSSL_sk_free(OPENSSL_STACK *a);
                                         ^
ssl/qsslsocket_openssl11_symbols_p.h:93:45: error: unknown type name 'OPENSSL_STACK'
Q_AUTOTEST_EXPORT void * q_OPENSSL_sk_value(OPENSSL_STACK *a, int b);
                                            ^
ssl/qsslsocket_openssl11_symbols_p.h:96:45: error: unknown type name 'OPENSSL_INIT_SETTINGS'
int q_OPENSSL_init_ssl(uint64_t opts, const OPENSSL_INIT_SETTINGS *settings);
                                            ^
ssl/qsslsocket_openssl11_symbols_p.h:109:50: error: unknown type name 'X509_STORE_CTX_verify_cb'
void q_X509_STORE_set_verify_cb(X509_STORE *ctx, X509_STORE_CTX_verify_cb verify_cb);
                                                 ^
ssl/qsslsocket_openssl11_symbols_p.h:128:48: error: unknown type name 'OPENSSL_INIT_SETTINGS'
int q_OPENSSL_init_crypto(uint64_t opts, const OPENSSL_INIT_SETTINGS *settings);
                                               ^
In file included from ssl/qsslkey_p.cpp:60:
ssl/qsslsocket_openssl_symbols_p.h:382:1: error: unknown type name 'SSL_CONF_CTX'; did you mean 'SSL_AEAD_CTX'?
SSL_CONF_CTX *q_SSL_CONF_CTX_new();
^~~~~~~~~~~~
SSL_AEAD_CTX
/usr/local/include/openssl/ssl.h:614:32: note: 'SSL_AEAD_CTX' declared here
typedef struct ssl_aead_ctx_st SSL_AEAD_CTX;
                               ^
In file included from ssl/qsslkey_p.cpp:60:
ssl/qsslsocket_openssl_symbols_p.h:383:26: error: unknown type name 'SSL_CONF_CTX'
void q_SSL_CONF_CTX_free(SSL_CONF_CTX *a);
                         ^
ssl/qsslsocket_openssl_symbols_p.h:384:33: error: unknown type name 'SSL_CONF_CTX'
void q_SSL_CONF_CTX_set_ssl_ctx(SSL_CONF_CTX *a, SSL_CTX *b);
                                ^
ssl/qsslsocket_openssl_symbols_p.h:385:39: error: unknown type name 'SSL_CONF_CTX'
unsigned int q_SSL_CONF_CTX_set_flags(SSL_CONF_CTX *a, unsigned int b);
                                      ^
ssl/qsslsocket_openssl_symbols_p.h:386:27: error: unknown type name 'SSL_CONF_CTX'
int q_SSL_CONF_CTX_finish(SSL_CONF_CTX *a);
                          ^
ssl/qsslsocket_openssl_symbols_p.h:387:20: error: unknown type name 'SSL_CONF_CTX'
int q_SSL_CONF_cmd(SSL_CONF_CTX *a, const char *b, const char *c);
                   ^
15 errors generated.
*** [.obj/qsslkey_p.o] Error code 1

make[1]: stopped in /wrkdirs/usr/ports/net/qt5-network/work/qtbase-everywhere-src-5.14.2/src/network
2 errors

make[1]: stopped in /wrkdirs/usr/ports/net/qt5-network/work/qtbase-everywhere-src-5.14.2/src/network
===> 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/net/qt5-network
Comment 1 Tobias C. Berner freebsd_committer 2020-04-13 17:14:27 UTC
Moin moin 


I assume you are using libressl?


mfg Tobias
Comment 2 p5B2E9A8F 2020-04-13 22:34:02 UTC
(In reply to Tobias C. Berner from comment #1)
True. Any doubts? See attached build log:

> grep libressl tmp/qt5-network-5.14.2.log 
DEFAULT_VERSIONS+=ssl=libressl
===>   Installing existing package /packages/All/libressl-3.0.2.txz
[12i386-default-builder-job-04] Installing libressl-3.0.2...
[12i386-default-builder-job-04] Extracting libressl-3.0.2: .......... done
Comment 3 Tobias C. Berner freebsd_committer 2020-04-14 04:44:53 UTC
(In reply to p5B2E9A8F from comment #2)

Moin moin 


Unfortunately, libressl is not supported by Qt upstream, so it tends to break, when it gets upgraded, until a libressl user provides the necessary patches.


mfg Tobias
Comment 4 p5B2E9A8F 2020-04-14 10:17:15 UTC
(In reply to Tobias C. Berner from comment #3)

> Unfortunately, libressl is not supported by Qt upstream, ...

Thank you for this hint. If this is true this is a good reason for avoiding Qt and strictly avoiding qt5-network. 

So this is a kiss good bye.
Comment 5 Tobias C. Berner freebsd_committer 2020-04-14 10:26:06 UTC
(In reply to p5B2E9A8F from comment #4)
There's unfortunately not much we can do here, yes.
Comment 6 p5B2E9A8F 2020-04-14 15:02:42 UTC
> There's unfortunately not much we can do here, yes.

Hmm. That does not mean nothing could be done.
Having had a look at the history I see the valuable contributions from Walter Schwarzenfeld. Maybe it needs some friendly communication to "upstream".
If it can be patched here it might be possible to make it an option at upstream.

I got grilled here because it broke security related ports depending on qt5-network because the local repo was left with mixed qt5-ports on version 5.14.2 while the broken ones still have 5.13.2. Can this be done better?
Comment 7 Tobias C. Berner freebsd_committer 2020-04-14 15:43:12 UTC
(In reply to p5B2E9A8F from comment #6)
We will readd support for it as soon as it is provided by some one using and understanding libressl (none of kde@ do either). 

Upstream seemed to be on the brink of adding support for libressl a "long" time ago, but that seems to have stopped. Feel free to poke them. I would not hold my breath though :). 

Sure, this could be done a lot better... Many things could. Libressl users should start actively contribute to kde@ -- I can also poke certain users before I plan to update a Qt to a new version, to have it work out of the box. 
kde@ very seldom rejects patches. We even accept pull-requests on [1]. 



mfg Tobias 


[1] https://github.com/freebsd/freebsd-ports-kde
Comment 8 rozhuk.im 2020-04-15 02:39:55 UTC
https://bugs.freebsd.org/bugzilla/show_bug.cgi?id=228344
looks like these patches missed after update.
Comment 9 rozhuk.im 2020-04-15 03:27:57 UTC
Created attachment 213401 [details]
libressl build fix

This backported patch from prev port revision with few changes:

1. patch-src_network_kernel_qnetworkinterface__unix.cpp renamed to: patch-src_network_kernel_qnetworkinterface__unix.cpp_ to avoid name collizion

2. patch-qsslsocket_openssl11_symbols_p.h - rebased to apply again

3. In patch-src_network_ssl_qsslsocket_openssl_symbols_p.h added:
+# define DTLS1_2_VERSION                 0xFEFD
+# define DTLS_MAX_VERSION                DTLS1_2_VERSION


Tobias, thanks for qt update, but please in next time don't forget about users with non default port options and env.
Comment 10 Charlie Li 2020-04-16 01:35:12 UTC
Comment on attachment 213401 [details]
libressl build fix

patch-src_network_kernel_qnetworkinterface__unix.cpp_ should be patch-src_network_ssl_qsslcontext__openssl.cpp, but otherwise this successfully compiles with libressl-devel (3.1.0) as well.
Comment 11 rozhuk.im 2020-04-16 05:05:54 UTC
Created attachment 213448 [details]
libressl build fix

rename file
Comment 12 commit-hook freebsd_committer 2020-04-16 16:11:40 UTC
A commit references this bug:

Author: tcberner
Date: Thu Apr 16 16:11:02 UTC 2020
New revision: 531857
URL: https://svnweb.freebsd.org/changeset/ports/531857

Log:
  net/qt5-network: readd support for LibreSSL

  - as with every Qt5 upgrade, we dropped LibreSSL support
  - this readds it

  PR:		245600
  Submitted by:	rozhuk.im@gmail.com
  Reported by:	p5B2E9A8F@t-online.de

Changes:
  head/net/qt5-network/files/patch-qsslsocket_openssl11_symbols_p.h
  head/net/qt5-network/files/patch-src_network_ssl_qsslcontext_openssl.cpp
  head/net/qt5-network/files/patch-src_network_ssl_qsslsocket_openssl.cpp
  head/net/qt5-network/files/patch-src_network_ssl_qsslsocket_openssl_symbols.cpp
  head/net/qt5-network/files/patch-src_network_ssl_qsslsocket_openssl_symbols_p.h
Comment 13 Tobias C. Berner freebsd_committer 2020-04-16 16:12:07 UTC
(In reply to rozhuk.im from comment #11)
Moin moin 

Thank you very much for the patches.

Committed, with repo-copied patches. Let me know, if it works now. 


mfg Tobias
Comment 14 p5B2E9A8F 2020-04-22 12:37:14 UTC
(In reply to Tobias C. Berner from comment #13)
Works. Thank you all.