Bug 199050

Summary: lang/python*: Fix build with LibreSSL without NLS
Product: Ports & Packages Reporter: Kevin Zheng <kevinz5000>
Component: Individual Port(s)Assignee: Bernard Spil <brnrd>
Status: Closed FIXED    
Severity: Affects Only Me CC: brnrd, miwi, xmj
Priority: --- Keywords: needs-qa
Version: LatestFlags: koobs: maintainer-feedback+
Hardware: Any   
OS: Any   
Bug Depends on: 205960    
Bug Blocks:    
Attachments:
Description Flags
Patch to fix build
none
Poudriere build log WITHOUT NLS
none
Poudriere build log WITH NLS none

Description Kevin Zheng 2015-03-30 21:32:46 UTC
Created attachment 155029 [details]
Patch to fix build

The update to 3.4.3 fixed the build with LibreSSL by adding 'configure' tests for RAND_egd. However, when building without NLS, 'configure' detects RAND_egd from base OpenSSL and enables RAND_EGD support, but then results in a linker failure.

The attached patch resolves this issue by unconditionally adding "-L${LOCALBASE}/lib" to the build.
Comment 1 Johannes Jost Meixner freebsd_committer freebsd_triage 2015-05-12 18:41:46 UTC
I'll take it.
Comment 2 Kevin Zheng 2015-05-12 18:46:14 UTC
Created attachment 156724 [details]
Poudriere build log WITHOUT NLS
Comment 3 Kevin Zheng 2015-05-12 18:53:57 UTC
Created attachment 156725 [details]
Poudriere build log WITH NLS
Comment 4 Johannes Jost Meixner freebsd_committer freebsd_triage 2015-05-25 02:57:52 UTC
Back to pool.
Comment 5 Kubilay Kocak freebsd_committer freebsd_triage 2015-11-04 10:19:54 UTC
Unconditionally setting this in LIBS is too widely scoped, and likely to pollute the build by detecting, building against and link other (unwanted) libraries implicitly. This is one of the reason why its currently only scoped to the NLS option.

Either the fix needs to be scoped to SSL detection only, either in ./configure or otherwise, and needs to support and be compatible with all of the following the following three cases:

For all lang/python* ports (since this is presumably reproducible in all of them)

- OpenSSL in base
- OpenSSL from ports
- LibreSSL from ports

My gut feeling tells me that the best way to address this is with openssl specific include/library arguments in ./configure, which are then passed to setup.py (for extensions), OR

Playing with ssl_incs and ssl_libs variables (and contents) might also be an avenue, similar to what setup.py does for readline and dbm (dbmliborder):
Comment 6 Bernard Spil freebsd_committer freebsd_triage 2016-07-07 09:32:29 UTC
This is fixed by #205960
Comment 7 commit-hook freebsd_committer freebsd_triage 2016-07-08 19:08:14 UTC
A commit references this bug:

Author: brnrd
Date: Fri Jul  8 19:07:42 UTC 2016
New revision: 418240
URL: https://svnweb.freebsd.org/changeset/ports/418240

Log:
  lang/python3*: Backport upstream issue 24557

    - Add backport of patch for EGD issue [1]
    - Change USE_OPENSSL to USES= ssl
    - Don't set CPE_VERSION to the default PORTVERSION

  PR:		205960 [1], 199050 [1]
  Reviewed by:	koobs (python)
  Approved by:	python (koobs)
  Obtained from:	https://hg.python.org/cpython/rev/7c0432cf1f2e [1]
  MFH:		2016Q3

Changes:
  head/lang/python33/Makefile
  head/lang/python34/Makefile
  head/lang/python34/files/patch-issue24557
  head/lang/python35/Makefile
  head/lang/python35/files/patch-issue24557
Comment 8 commit-hook freebsd_committer freebsd_triage 2016-07-08 20:09:25 UTC
A commit references this bug:

Author: brnrd
Date: Fri Jul  8 20:08:48 UTC 2016
New revision: 418241
URL: https://svnweb.freebsd.org/changeset/ports/418241

Log:
  MFH: r418240

  lang/python3*: Backport upstream issue 24557

    - Add backport of patch for EGD issue [1]
    - Change USE_OPENSSL to USES= ssl
    - Don't set CPE_VERSION to the default PORTVERSION

  PR:		205960 [1], 199050 [1]
  Reviewed by:	koobs (python)
  Approved by:	python (koobs)
  Obtained from:	https://hg.python.org/cpython/rev/7c0432cf1f2e [1]

  Approved by:	ports-secteam (feld)

Changes:
_U  branches/2016Q3/
  branches/2016Q3/lang/python33/Makefile
  branches/2016Q3/lang/python34/Makefile
  branches/2016Q3/lang/python34/files/patch-issue24557
  branches/2016Q3/lang/python35/Makefile
  branches/2016Q3/lang/python35/files/patch-issue24557
Comment 9 Martin Wilke freebsd_committer freebsd_triage 2017-03-03 07:27:22 UTC
Committed in r418240,
Comment 10 Kubilay Kocak freebsd_committer freebsd_triage 2017-04-01 07:03:01 UTC
Assign to committer that resolved