Bug 230698

Summary: databases/mongodb34: Fails to build with OpenSSL 1.1.x
Product: Ports & Packages Reporter: Bernard Spil <brnrd>
Component: Individual Port(s)Assignee: Kurt Jaeger <pi>
Status: Closed FIXED    
Severity: Affects Some People CC: eric, joneum, koobs, pi, ronald-lists, tobik
Priority: --- Flags: eric: maintainer-feedback+
koobs: merge-quarterly?
Version: Latest   
Hardware: Any   
OS: Any   
Bug Depends on:    
Bug Blocks: 228865, 231931    
Attachments:
Description Flags
WIP/INCOMPLETE Fixes: "error: no member named 'SSLv2_method' in the global namespace"
none
WIP/experimental: fixes more errors
none
fix: depend on and use security/openssl
none
mongodb34-openssl111.diff none

Description Bernard Spil freebsd_committer freebsd_triage 2018-08-17 13:16:19 UTC
"no member named 'SSLv2_method'"

SSLv2 is no longer supported. (Use #ifndef OPENSSL_NO_SSL2)

During BSDCan 2018 the intention to update OpenSSL in base to 1.1.x branch was documented.

Intention is to update OpenSSL in 12-STABLE to 1.1.1 when that is released. 

Poudriere log:
Comment 2 Eric Camachat 2018-10-25 17:48:42 UTC
Is it possible someone can take the maintainer? I don't have enough free time now.
Comment 3 Ronald Klop 2018-11-19 00:43:06 UTC
Created attachment 199330 [details]
WIP/INCOMPLETE Fixes: "error: no member named 'SSLv2_method' in the global namespace"

With this patch there is still the "error: member access into incomplete type 'SSL_CTX' (aka 'ssl_ctx_st')".
I'm currently trying an upgrade of the port to 3.4.18. Will see in the morning if the build succeeded.
In the meantime maybe somebody else knows what to do with this error.
Comment 4 Kubilay Kocak freebsd_committer freebsd_triage 2018-11-19 07:42:45 UTC
(In reply to Eric Camachat from comment #2)

May I reset MAINTAINER so that someone else can assign themselves without approval?
Comment 5 Ronald Klop 2018-11-22 19:36:24 UTC
Created attachment 199456 [details]
WIP/experimental: fixes more errors

More errors fixed. I'm not into openssl and what changed in 1.1.x.
I wonder if this is the way to go. Would it be easy to declare a dependency on port security/openssl and use that?
Comment 6 Jochen Neumeister freebsd_committer freebsd_triage 2018-11-22 19:53:53 UTC
(In reply to Ronald Klop from comment #5)

Thank you Ronald for the patch.

I want to wait 2 weeks for the maintainer and approval to your patch, and when not, as @koobs suggested, reset a maintainer. Are you interested to the port?
Comment 7 Ronald Klop 2018-11-22 21:10:03 UTC
(In reply to Jochen Neumeister from comment #6)
As stated the patch is WIP/experimental. It does not even compile yet.

But I have a simpler approach which does work. I'll add it here in a minute.
Comment 8 Ronald Klop 2018-11-22 21:13:45 UTC
Created attachment 199458 [details]
fix: depend on and use security/openssl

Depend on the openssl-1.0.x port. This fixes the build and creates a working executable.
Fixes the only dependencies (net-mgmt/unifi*) of this port.

Inspired by: https://svnweb.freebsd.org/ports/head/devel/monodevelop/Makefile?r1=485604&r2=485603&pathrev=485604
Comment 9 Ronald Klop 2018-11-22 21:29:53 UTC
(In reply to Jochen Neumeister from comment #6)

Yes, I'm ok becoming maintainer of this port.
Comment 10 Jochen Neumeister freebsd_committer freebsd_triage 2018-11-22 22:05:06 UTC
(In reply to Ronald Klop from comment #9)
Please add yourself in the line MAINTAINER =. Then we wait 2 weeks. After that I can commit it
Comment 11 Kurt Jaeger freebsd_committer freebsd_triage 2018-11-24 09:03:18 UTC
testbuild patch, builds fine on 11.2a.
Comment 12 commit-hook freebsd_committer freebsd_triage 2018-11-24 11:20:16 UTC
A commit references this bug:

Author: pi
Date: Sat Nov 24 11:19:40 UTC 2018
New revision: 485756
URL: https://svnweb.freebsd.org/changeset/ports/485756

Log:
  databases/mongodb34: fix build with openssl 1.1.x in base

  - depend on security/openssl
  - submitter becomes maintainer

  PR:		230698
  Submitted by:	Ronald Klop <ronald-lists@klop.ws>
  Reported by:	brnrd
  Approved by:	Eric Camachat <eric@camachat.org> (maintainer)

Changes:
  head/databases/mongodb34/Makefile
Comment 13 Kurt Jaeger freebsd_committer freebsd_triage 2018-11-24 19:55:32 UTC
commit was reverted by antoine, because:

you can't depend on an openssl version different from SSL_DEFAULT, this will break users' installation.

TODO: find another solution.

One suggestion: depend on mongodb36 instead ? Or update 34 to 3.4.17 ?
Comment 14 Tobias Kortkamp freebsd_committer freebsd_triage 2018-11-25 13:33:31 UTC
Created attachment 199541 [details]
mongodb34-openssl111.diff

Here's a patch from [1] found via repology.org adapted to apply
to the port.  It's a couple of upstream [2] commits for the
bundled asio lib squashed together.  I do not see anything obviously
wrong with it and it appears to fix the build with OpenSSL 1.1.1.
I cannot speak for runtime behavior though.  Maybe someone with more
MongoDB knowledge can test it.

> Or update 34 to 3.4.17 ?

The AUR package is at 3.4.17 and still requires this patch, so
that's probably not enough.

[1] https://aur.archlinux.org/packages/mongodb-3.4
[2] https://github.com/boostorg/asio
Comment 15 Ronald Klop 2018-11-26 09:23:44 UTC
(In reply to Tobias Kortkamp from comment #14)

Your patch works for me on my RPI3 12.0-RC2/arm64.
I have unifi5 working again.
(Next step for me is porting mongodb36 to arm64.)
Comment 16 Kurt Jaeger freebsd_committer freebsd_triage 2018-12-23 13:37:07 UTC
Committed, thanks!
Comment 17 commit-hook freebsd_committer freebsd_triage 2018-12-23 13:37:48 UTC
A commit references this bug:

Author: pi
Date: Sun Dec 23 13:36:55 UTC 2018
New revision: 488220
URL: https://svnweb.freebsd.org/changeset/ports/488220

Log:
  databases/mongodb34: fix build with OpenSSL 1.1.x

  - ronald-lists@klop.ws becomes maintainer

  PR:		230698
  Submitted by:	tobik
  Reported by:	brnrd
  Approved by:	eric@camachat.org (maintainer)
  Obtained from:	https://aur.archlinux.org/packages/mongodb-3.4

Changes:
  head/databases/mongodb34/Makefile
  head/databases/mongodb34/files/patch-asio-openssl-1.1.0
Comment 18 Ronald Klop 2018-12-26 13:13:12 UTC
(In reply to commit-hook from comment #17)
The part of the commit message about changing the maintainer did not go into the committed diff.
Comment 19 commit-hook freebsd_committer freebsd_triage 2018-12-26 13:17:18 UTC
A commit references this bug:

Author: tobik
Date: Wed Dec 26 13:16:54 UTC 2018
New revision: 488384
URL: https://svnweb.freebsd.org/changeset/ports/488384

Log:
  databases/mongodb34: Update maintainer (forgotten in the last commit)

  PR:		230698

Changes:
  head/databases/mongodb34/Makefile