From owner-freebsd-python@freebsd.org Mon Sep 24 10:24:31 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 7A73510A8876 for ; Mon, 24 Sep 2018 10:24:31 +0000 (UTC) (envelope-from koobs.freebsd@gmail.com) Received: from mail-io1-xd30.google.com (mail-io1-xd30.google.com [IPv6:2607:f8b0:4864:20::d30]) (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 0A65B785C1; Mon, 24 Sep 2018 10:24:31 +0000 (UTC) (envelope-from koobs.freebsd@gmail.com) Received: by mail-io1-xd30.google.com with SMTP id l25-v6so4051076ioj.0; Mon, 24 Sep 2018 03:24:31 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20161025; h=sender:reply-to:subject:to:references:from:openpgp:message-id:date :user-agent:mime-version:in-reply-to:content-language :content-transfer-encoding; bh=yAZxm/3AWVWYbtZXv7baKIzPs2E3NcMW/Ylu6u6ziNM=; b=eimiWBU4OUWHmcG5VAldJwVG4yMDzs+PfrP3SzDCYzbVW9nc7vcqxVK3omjWB0Plc8 y0iRFXh4a8N0iUr9jKYFtaAqoIYMezUcMmvZYUoUJKgQ7JntNR1P5f6eWbx84RsTwFAC 3CBc/wb9ClOoFwSWv3L+4lM+0f86QGOP5xyPssNLty51V7yDNBlvf0PY7SS6K9JZfjP8 3kCeSomFBDtcl/d5GROOgGVHbrFkicDXw1vcxIq5IimJfE8axILJFKqZVRQRVc18dCYu ZoYGxg3K54icwYRVrtER35k/IjBJchA9i6k2FWE8bpRKy/xAPVTUoJvHUAOXGK1Mv7oi kA/w== 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:from :openpgp:message-id:date:user-agent:mime-version:in-reply-to :content-language:content-transfer-encoding; bh=yAZxm/3AWVWYbtZXv7baKIzPs2E3NcMW/Ylu6u6ziNM=; b=meykTVD2e53OXwFdm3gVzKgjjNdfSKQOl23HbvkfJs2Eteb9ZQ64zusp0xfag+NhC5 97DUvHfc7yqlgDr9is+b5huvcJyC6cIZLxDq2qAYHGuHhQ9E+7AnMw3Thb/K8dFpB9/Q XP/DHtVVriX63EFZCMGw71FZY84E2ru3osF/FjotlUnQl6snk4LSV4yw6C5l3OAhz+xr Yhd7/TfX2PbbDLL5fark6NU4URnboljyPhmRVObjx0OfxG0dPCEAVbcAEvbRzWifiWOv 8grpLqno/0FnEHqnN2in5UGf9RhSXY6vnSJRtw+jBAsC8PjXpMBzoWUuv26dOUj3bcF7 FLjQ== X-Gm-Message-State: ABuFfojew+OEKq5Elgxzhd81FZ7PLedg9KtdXeOKIZADVSHMDD4HCb4f oNKyJwLAgpkoFaINDYrS2Xx3C8SA X-Google-Smtp-Source: ACcGV63oqZRr3qCGAfedIphL0mkEz7Q1nS7VEqb79p0REk5kQYO+QoD0LvW9u5KBVS70ax/88zUGkg== X-Received: by 2002:a5e:d803:: with SMTP id l3-v6mr6717772iok.236.1537784669876; Mon, 24 Sep 2018 03:24:29 -0700 (PDT) Received: from [192.168.1.100] ([103.103.242.159]) by smtp.gmail.com with ESMTPSA id q10-v6sm12278560ioh.64.2018.09.24.03.24.27 (version=TLS1_2 cipher=ECDHE-RSA-AES128-GCM-SHA256 bits=128/128); Mon, 24 Sep 2018 03:24:29 -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, Sunpoet Po-Chuan Hsieh References: <20180924080803.GK3589@straasha.imrryr.org> From: Kubilay Kocak Openpgp: preference=signencrypt Message-ID: <0dab868d-d1bf-12db-40cb-47136dd4c7e1@FreeBSD.org> Date: Mon, 24 Sep 2018 20:24:25 +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:24:31 -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. > I also note that there is an open bug report for the issue: https://bugs.freebsd.org/bugzilla/show_bug.cgi?id=229019