delorie.com/archives/browse.cgi   search  
Mail Archives: cygwin/2016/11/22/22:25:21

X-Recipient: archive-cygwin AT delorie DOT com
DomainKey-Signature: a=rsa-sha1; c=nofws; d=sourceware.org; h=list-id
:list-unsubscribe:list-subscribe:list-archive:list-post
:list-help:sender:mime-version:from:date:message-id:subject:to
:content-type:content-transfer-encoding; q=dns; s=default; b=Uu5
aAneYiFEdaYMDQ/mnbHYtMs673ymxf30HdtQ7a36K/ySwrcLdWPduyRtytDNXGKQ
61H5f+rMMQIhUcH7O1Wcj4G+bt94lbqafFQ25ziv9OKVbEMWzn6RwSr0D0qXGxgo
kKe1JBM/QfZdqy0r9Bw7RkEVoofCa+EFg/RO5b0M=
DKIM-Signature: v=1; a=rsa-sha1; c=relaxed; d=sourceware.org; h=list-id
:list-unsubscribe:list-subscribe:list-archive:list-post
:list-help:sender:mime-version:from:date:message-id:subject:to
:content-type:content-transfer-encoding; s=default; bh=P6QcC8BZ8
9Kb/a6IV3R/Pb/72a4=; b=CZ+3WBZoOu63A4oygvpFpRENbFg4I+zTTcfLg91j0
VwgaZj0nsFOnk/dVYaC7I664Wk/ywJkz4D59LCgArpha+1EBPnTQdb+hHCNx3G/v
1m3uIeiUAZirOiNCa1wAmzSePm0ig5DvxmxvSRfsDVF6TnTzEe0+0ULvgGmhqbKK
W0=
Mailing-List: contact cygwin-help AT cygwin DOT com; run by ezmlm
List-Id: <cygwin.cygwin.com>
List-Subscribe: <mailto:cygwin-subscribe AT cygwin DOT com>
List-Archive: <http://sourceware.org/ml/cygwin/>
List-Post: <mailto:cygwin AT cygwin DOT com>
List-Help: <mailto:cygwin-help AT cygwin DOT com>, <http://sourceware.org/ml/#faqs>
Sender: cygwin-owner AT cygwin DOT com
Mail-Followup-To: cygwin AT cygwin DOT com
Delivered-To: mailing list cygwin AT cygwin DOT com
Authentication-Results: sourceware.org; auth=none
X-Virus-Found: No
X-Spam-SWARE-Status: No, score=-1.5 required=5.0 tests=AWL,BAYES_00,FREEMAIL_ENVFROM_END_DIGIT,FREEMAIL_FROM,RCVD_IN_DNSWL_LOW,SPF_PASS autolearn=ham version=3.3.2 spammy=consequences, UD:config.h
X-HELO: mail-oi0-f41.google.com
X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20130820; h=x-gm-message-state:mime-version:from:date:message-id:subject:to :content-transfer-encoding; bh=QKi+H9jNT3bLsQlxmALI+etabwCHlmYcCOlHEy8KvS8=; b=Gkzz7hC8zEbEAqXfrqHlxwO/9M/+SBkSCd3HJE4wQ45KDGaqswwP/uqgHybPxpVLVv WaKbschC4/8BzvFH4rGB5/2FGqJRrhgPIE7bNGTBsnLHIgHhHMBW4kql1Zj1UCh3+Ka2 UnRz2m0/Uxl5OkR72HXIkQcS3dtpI+bHXUnhtd926NA5VYwe23wMn47PZFCBpMLdwBEq kyKTuAEoVstwUEGZ3Yom8K6EYhz8bTmAyvJiFuSvaBMJIJmSbuys3pzzkvy7HspGpJMJ r4RZfmmkOe02feO60mSuKs661q92/wOiy0VXd3+d9PkfLbPAceOOFlRgjo1EJ2JkMzlQ 5PbQ==
X-Gm-Message-State: AKaTC03s3TIEsVmzD1KDpCEJoAqHhENcKlrrlIN+srRVxkWbSqB5Kvs/GpubCCZMSXgjf+cFmk4UZiJGYZS5mQ==
X-Received: by 10.157.16.120 with SMTP id o53mr525914oto.11.1479871451903; Tue, 22 Nov 2016 19:24:11 -0800 (PST)
MIME-Version: 1.0
From: Jason Bell <jbell9999 AT gmail DOT com>
Date: Tue, 22 Nov 2016 22:24:11 -0500
Message-ID: <CADUpaR3C4F3icCdztVKZQ9GxpMc=AM6KaujNuedmYDbjMeK6vA@mail.gmail.com>
Subject: python 2.7.12 pip install with extensions fails with warning: "__BSD_VISIBLE" redefined
To: cygwin AT cygwin DOT com
X-MIME-Autoconverted: from quoted-printable to 8bit by delorie.com id uAN3PJ3D030844

Hi -

The newest version of cygwin with python 2.7.12-1 fails when pip
installing packages that require compilation.  For example, pycrypto
fails:

$ pip install pycrypto
Collecting pycrypto
.......
  building 'Crypto.PublicKey._fastmath' extension
  creating build/temp.cygwin-2.6.0-x86_64-2.7
  creating build/temp.cygwin-2.6.0-x86_64-2.7/src
  gcc -fno-strict-aliasing -ggdb -pipe -Wimplicit-function-declaration
-fdebug-prefix-map=/usr/src/ports/python/python-2.7.12-1.x86_64/build=/usr/src/debug/python-2.7.12-1
-fdebug-prefix-map=/usr/src/ports/python/python-2.7.12-1.x86_64/src/Python-2.7.12=/usr/src/debug/python-2.7.12-1
-fwrapv -Wall -Wstrict-prototypes -std=c99 -O3 -fomit-frame-pointer
-Isrc/ -I/usr/include/ -I/usr/include/python2.7 -c src/_fastmath.c -o
build/temp.cygwin-2.6.0-x86_64-2.7/src/_fastmath.o
  In file included from /usr/include/python2.7/Python.h:8:0,
                   from src/_fastmath.c:31:
  /usr/include/python2.7/pyconfig.h:1221:0: warning: "__BSD_VISIBLE" redefined
   #define __BSD_VISIBLE 1
   ^
  In file included from /usr/include/sys/config.h:5:0,
                   from /usr/include/_ansi.h:16,
                   from /usr/include/stdio.h:29,
                   from src/_fastmath.c:29:
  /usr/include/sys/features.h:250:0: note: this is the location of the
previous definition
   #define __BSD_VISIBLE  0
   ^
  In file included from /usr/include/python2.7/pyport.h:332:0,
                   from /usr/include/python2.7/Python.h:58,
                   from src/_fastmath.c:31:
  /usr/include/sys/time.h:104:34: error: unknown type name ‘u_int’
   bintime_mul(struct bintime *_bt, u_int _x)
                                    ^
  error: command 'gcc' failed with exit status 1

  ----------------------------------------

I can fix these errors by changing __BSD_VISIBLE from 1 to 0 in
/usr/include/python2.7/pyconfig.h.  Here's a patch:

--- pyconfig.h 2016-11-20 09:38:22.434174700 -0500
+++ pyconfig-bsd-not-visible.h 2016-11-20 09:38:05.391993200 -0500
@@ -1218,7 +1218,7 @@
 #define _XOPEN_SOURCE_EXTENDED 1

 /* Define on FreeBSD to activate all library features */
-#define __BSD_VISIBLE 1
+#define __BSD_VISIBLE 0

 /* Define to 1 if type `char' is unsigned and you are not using gcc.  */
 #ifndef __CHAR_UNSIGNED__

And here's a link to a script that changes the value in one shot:
https://gist.githubusercontent.com/thorrr/271058eeb5f1903213938f89fcbc3a73/raw/15026396047b61102826a8dd92ea591155573f1d/pyconfig-fix.sh

I can confirm this makes several packages I use often work correctly
but I don't know what the other consequences of changing this variable
are.

J

--
Problem reports:       http://cygwin.com/problems.html
FAQ:                   http://cygwin.com/faq/
Documentation:         http://cygwin.com/docs.html
Unsubscribe info:      http://cygwin.com/ml/#unsubscribe-simple


- Raw text -


  webmaster     delorie software   privacy  
  Copyright © 2019   by DJ Delorie     Updated Jul 2019