check_smtp fails on compilation without ssl at the current HEAD branch
During my current open PR i discovered an issue, that i can't compile the suite without openssl or gnutls library installed, i assume this should also be possible. This caused currently by check_smtp see below:
check_smtp.c: In function ‘my_recv’:
check_smtp.c:68:45: error: ‘len’ undeclared (first use in this function)
68 | return read(socket_descriptor, buf, len)
| ^~~
check_smtp.c:68:45: note: each undeclared identifier is reported only once for each function it appears in
check_smtp.c:68:49: error: expected ‘;’ before ‘}’ token
68 | return read(socket_descriptor, buf, len)
| ^
| ;
69 | #endif
70 | }
| ~
check_smtp.c: In function ‘my_send’:
check_smtp.c:80:45: error: ‘len’ undeclared (first use in this function)
80 | return send(socket_descriptor, buf, len, 0);
| ^~~
check_smtp.c: In function ‘main’:
check_smtp.c:215:27: error: ‘check_smtp_config’ has no member named ‘use_starttls’
215 | if (config.use_starttls && !supports_tls) {
| ^
check_smtp.c: In function ‘process_arguments’:
check_smtp.c:650:38: error: ‘check_smtp_config’ has no member named ‘use_ssl’
650 | result.config.use_ssl = true;
| ^
check_smtp.c:655:38: error: ‘check_smtp_config’ has no member named ‘use_starttls’
655 | result.config.use_starttls = true;
| ^
check_smtp.c:706:26: error: ‘check_smtp_config’ has no member named ‘use_starttls’
706 | if (result.config.use_starttls && result.config.use_ssl) {
| ^
check_smtp.c:706:56: error: ‘check_smtp_config’ has no member named ‘use_ssl’
706 | if (result.config.use_starttls && result.config.use_ssl) {
| ^
check_smtp.c:708:38: error: ‘check_smtp_config’ has no member named ‘use_ssl’
708 | result.config.use_ssl = false;
| ^
My assumption is, after refactoring the module the non ssl code was forgotten to update. After installing libssl-dev the compilation works.
Hi @bkuebler, thanks for reporting that. I completely missed it, since neither my dev setup nor the CI tries this without TLS. I guess that should be added (@waja ?). On the other hand, is it realistic/useful to have TLS optional at all? Is there a real world setup without any TLS?
Hi @bkuebler, thanks for reporting that. I completely missed it, since neither my dev setup nor the CI tries this without TLS. I guess that should be added (@waja ?).
@RincewindsHat you are talking about an extra CI pipeline compiling without TLS?
@waja yes, that would be the idea.
But when abstracting a bit more, we have a lot of (optional) dependencies. For which of them do we need that and which dependency should be combined with which (or even not)?
Good question (I don't know the answer). TLS is the obvious candidate, but we have a quite a lot of context which determines what is build and how. I would have to think some time about what matters and what not. A build matrix would be nice though.
Additional note: Test build with different TLS implementations. I think GnuTLS is currently broken too (#2033)
Good question (I don't know the answer). TLS is the obvious candidate, but we have a quite a lot of context which determines what is build and how. I would have to think some time about what matters and what not. A build matrix would be nice though.
We should open another issue about the CI problem. It's independent from the compiling issue.