From owner-freebsd-python@freebsd.org Mon Sep 24 10:21:20 2018 Return-Path: Delivered-To: freebsd-python@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id 0BCE710A85E7 for ; Mon, 24 Sep 2018 10:21:20 +0000 (UTC) (envelope-from koobs.freebsd@gmail.com) Received: from mail-it1-x12a.google.com (mail-it1-x12a.google.com [IPv6:2607:f8b0:4864:20::12a]) (using TLSv1.2 with cipher ECDHE-RSA-AES128-GCM-SHA256 (128/128 bits)) (Client CN "smtp.gmail.com", Issuer "Google Internet Authority G3" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 9073B7829C; Mon, 24 Sep 2018 10:21:19 +0000 (UTC) (envelope-from koobs.freebsd@gmail.com) Received: by mail-it1-x12a.google.com with SMTP id w200-v6so1558472itc.4; Mon, 24 Sep 2018 03:21:19 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20161025; h=sender:reply-to:subject:to:references:cc:from:openpgp:message-id :date:user-agent:mime-version:in-reply-to:content-language :content-transfer-encoding; bh=JcH7G66Qz34YJlBUhMjDkJvWd8NSleE0yfsmr40izFw=; b=nUoq7as7XJp3KGQoXop3frZIHwK6LmdZYNMjZ1oGik5m1XK/YsVIiYiJKkutgPFQRs 5gIXHf3j3N95om8nPqfo3o0dUjWdc65rtwPm9AKKjjhZCU/3WV1fg3OdLtrS1M+EqAQ/ wGrMnTd8LXOf7s78Z7fV6lsmZGU2gQKAJWoLqr86JbrzvpW5MbUIZU/yWcdAcroyRn/5 9whNjhyDTNQfWRUaZZP7jybwUBj3ERdU7woDRF62dBCZp80G4X+B5oVUP9j4+8aahzyR bKpSxkLtvm6afEJI3rQonb7AfLIgWpLam5Iy3ACqjyIL7mpMtRqVyRzsJdy2Q0gxC2Qf 9rxA== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20161025; h=x-gm-message-state:sender:reply-to:subject:to:references:cc:from :openpgp:message-id:date:user-agent:mime-version:in-reply-to :content-language:content-transfer-encoding; bh=JcH7G66Qz34YJlBUhMjDkJvWd8NSleE0yfsmr40izFw=; b=f3E9auBDGXCk3wO7rjtJ7Pb+rMUb3fniZ4oeVD5j6zxnPKnn6Dk4L+q+k31HCqDmPF p2K7V2aSEtngVd83BH1gjwNQjs+BFi7rkrhHR7uKpkxhq5J/gxKmo59Klx8RE242IzzW F/a0+HM0gy9ahGW9FbODV9pIVgFy1f+JE6zdfs+aYwdnMikf5Wb5mVNOXuNnl9crb3RQ GqlNFZTifcetY2JWDOdVBZQne4hr650A50VmPHkSbmWBg6TG3dZf3vKwPHFxzpgqu1Gx zXJUmgnlrq+FMf9dN3o+KYtQ70vWhJmVvmIP8yfypdvv6/X2JdjVR6HGfWsS0VrnmXii hIiQ== X-Gm-Message-State: ABuFfohaVA6aCr/wgmGZmVEelqv0e0xzhmPjJ2EPgjz43+bjEXgkDX0j 3jsrTXaTEDxfdNNeRdwe1aPxWwVa X-Google-Smtp-Source: ANB0VdbSF5B1JJcCk0cQ2eL5Tb+KkgJypiqmLecpjpxRcsBs1jpgLQ54IMiauSVaE8dVCn/+cXGItA== X-Received: by 2002:a24:6e96:: with SMTP id w144-v6mr7417755itc.111.1537784478519; Mon, 24 Sep 2018 03:21:18 -0700 (PDT) Received: from [192.168.1.100] ([103.103.242.159]) by smtp.gmail.com with ESMTPSA id 7-v6sm5180923iog.66.2018.09.24.03.21.16 (version=TLS1_2 cipher=ECDHE-RSA-AES128-GCM-SHA256 bits=128/128); Mon, 24 Sep 2018 03:21:18 -0700 (PDT) Sender: Kubilay Kocak Reply-To: koobs@FreeBSD.org Subject: Re: py-m2crypto conflict with openssl-devel (really swig vs. system headers) resolved To: ietf-dane@dukhovni.org, freebsd-python@freebsd.org References: <20180924080803.GK3589@straasha.imrryr.org> Cc: Sunpoet Po-Chuan Hsieh From: Kubilay Kocak Openpgp: preference=signencrypt Message-ID: <09268fc4-84d0-5f6c-9fe1-55b12c26624e@FreeBSD.org> Date: Mon, 24 Sep 2018 20:21:13 +1000 User-Agent: Mozilla/5.0 (Windows NT 10.0; WOW64; rv:60.0) Gecko/20100101 Thunderbird/60.0 MIME-Version: 1.0 In-Reply-To: <20180924080803.GK3589@straasha.imrryr.org> Content-Type: text/plain; charset=utf-8 Content-Language: en-US Content-Transfer-Encoding: 7bit X-BeenThere: freebsd-python@freebsd.org X-Mailman-Version: 2.1.27 Precedence: list List-Id: FreeBSD-specific Python issues List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Mon, 24 Sep 2018 10:21:20 -0000 On 24/09/2018 6:08 pm, Viktor Dukhovni wrote: > In /etc/make.conf I have: > > DEFAULT_VERSIONS=python=2.7 python2=2.7 python3=3.3 ssl=openssl-devel > > since I want OpenSSL 1.1.0 for most of the ports I build. However, this > disables the py2-m2crypto port, whose Makefile contains: > > BROKEN_SSL= openssl-devel > BROKEN_SSL_REASON_openssl-devel= Error: Syntax error in input(1). > > I commented those out, and tried to build, and indeed the build > fails with an error from swig3.0: > > /usr/local/bin/swig3.0 -python -I/usr/local/include -I/usr/local/include/python2.7 \ > -I/usr/local/include -I/usr/local/include/openssl -I/usr/bin/../lib/clang/4.0.0/include \ > -I/usr/include -includeall -modern -builtin \ > -outdir /usr/ports/security/py-m2crypto/work-py27/M2Crypto-0.30.1/M2Crypto \ > -o SWIG/_m2crypto_wrap.c SWIG/_m2crypto.i > /usr/include/x86/_types.h:67: Error: Syntax error in input(1). > > I got curious as to what if anything OpenSSL 1.1.0 has to do with > this, and it turns out that its only sin is to "#include " > in , which should cause no problems. But it turns > out that this runs into: > > https://github.com/freebsd/freebsd/blob/master/sys/x86/include/_types.h#L65 > > __extension__ > typedef long long __int64_t; > __extension__ > > with the unexpected "__extension__" giving "swig3.0" indigestion. > > The unrecognized syntax in is the real problem, and > either FreeBSD needs a "swig" that can deal with this, or the headers > need to be more compatible with the existing "swig". > > Testing with the "__extension__" lines removed, however runs into > another problem: > > /usr/include/sys/_types.h:104: Error: Syntax error - possibly a missing semicolon. > error: command '/usr/local/bin/swig3.0' failed with exit status 1 > > This time "swig" chokes on: > > typedef struct { > long long __max_align1 __aligned(_Alignof(long long)); > long double __max_align2 __aligned(_Alignof(long double)); > } __max_align_t; > > where I assume it does not understand the "__aligned" macro. Bottom > line, the internal system C-header files are much too exotic for > swig, and OpenSSL 1.1.x is rather a bystander, with previous releases > working with m2crypto somewhat by accident. > > I managed to find a solution that does not modify , > but rather comments out the switch "-includeall" option from > M2crypto's setup.py: > > self.swig_opts.extend(['-I%s' % i for i in _get_additional_includes()]) > # self.swig_opts.append('-includeall') > self.swig_opts.append('-modern') > self.swig_opts.append('-builtin') > > and adds a couple of additional explicit include files to SWIG/_m2crypto.i: > > %include > %include > > above: > > %include > > With this, py-m2crypto builds with OpenSSL 1.1.x and the system > header files unmolested. If the maintainer of the py-m2crypto port > is not on this list, please forward to the right person. It would > be good to remove this roadblock to using "openssl-devel" (since > actually OpenSSL 1.1.1 is now an LTS release, and 1.0.x will be EOL > at the end of 2019, so "devel" is not really the best label anymore). > > Perhaps the changes could also go to the upstream maintainer of > m2crypto. > Hi Viktor, Thanks for all of the context and detail. Reporting the issue upstream (to swig [1]) would be great in the first instance, if it hasn't already been. I've CC'd the m2crypto/swig ports maintainer here so they're notified as well. Both of us would be happy to commit the reported workaround if upstream is confident that that is the best solution in the meantime (until a new release). It would be great to get their input in any case. [1] https://github.com/swig/swig/issues ./koobs