delorie.com/archives/browse.cgi   search  
Mail Archives: cygwin/2021/01/31/04:16:48

X-Recipient: archive-cygwin AT delorie DOT com
X-Original-To: cygwin AT cygwin DOT com
Delivered-To: cygwin AT cygwin DOT com
DMARC-Filter: OpenDMARC Filter v1.3.2 sourceware.org E9AA6385803C
Authentication-Results: sourceware.org;
dmarc=none (p=none dis=none) header.from=trueroad.jp
Authentication-Results: sourceware.org;
spf=none smtp.mailfrom=trueroad AT trueroad DOT jp
Date: Sun, 31 Jan 2021 18:15:55 +0900 (JST)
Message-Id: <20210131.181555.1945002365058619809.trueroad@trueroad.jp>
To: cygwin AT cygwin DOT com
Subject: Re: python-cython C++ support patch
From: Masamichi Hosoda <trueroad AT trueroad DOT jp>
In-Reply-To: <20210131.125348.529339282301413911.trueroad@trueroad.jp>
References: <7edac602-ab79-7421-f5f8-929c7fa68428 AT gmail DOT com>
<20210130 DOT 222850 DOT 1144915727792964409 DOT trueroad AT trueroad DOT jp>
<20210131 DOT 125348 DOT 529339282301413911 DOT trueroad AT trueroad DOT jp>
X-Mailer: Mew version 6.8 on Emacs 27.1
Mime-Version: 1.0
X-VirusScan: Outbound; mvir-ac11; Sun, 31 Jan 2021 18:15:58 +0900
X-Spam-Status: No, score=-1.3 required=5.0 tests=BAYES_00, KAM_DMARC_STATUS,
KAM_LAZY_DOMAIN_SECURITY, RCVD_IN_DNSWL_NONE, SPF_HELO_NONE, SPF_NONE,
TXREP autolearn=no autolearn_force=no version=3.4.2
X-Spam-Checker-Version: SpamAssassin 3.4.2 (2018-09-13) on
server2.sourceware.org
X-BeenThere: cygwin AT cygwin DOT com
X-Mailman-Version: 2.1.29
List-Id: General Cygwin discussions and problem reports <cygwin.cygwin.com>
List-Unsubscribe: <https://cygwin.com/mailman/options/cygwin>,
<mailto:cygwin-request AT cygwin DOT com?subject=unsubscribe>
List-Archive: <https://cygwin.com/pipermail/cygwin/>
List-Post: <mailto:cygwin AT cygwin DOT com>
List-Help: <mailto:cygwin-request AT cygwin DOT com?subject=help>
List-Subscribe: <https://cygwin.com/mailman/listinfo/cygwin>,
<mailto:cygwin-request AT cygwin DOT com?subject=subscribe>
Cc: trueroad AT trueroad DOT jp
Errors-To: cygwin-bounces AT cygwin DOT com
Sender: "Cygwin" <cygwin-bounces AT cygwin DOT com>

>> python38-cython-0.29.21-3 works fine with following test code.
>> 
>> ```hello.pyx
>> print('Hello World!')
>> ```
>> 
>> ```setup.py
>> from distutils.core import setup
>> from Cython.Build import cythonize
>> 
>> setup(
>>      ext_modules=cythonize(
>>          "hello.pyx",
>>          language="c++",
>>      )
>> )
>> ```
>> 
>> ```test.py
>> import hello
>> ```
>> 
>> Here's the result by python38-cython-0.29.21-2 (failed).
>> 
>> ```
>> $ python setup.py build_ext --inplace
>> [...snip...]
>> $ python test.py
>> Traceback (most recent call last):
>>    File "test.py", line 1, in <module>
>>      import hello
>> ImportError: dynamic module does not define module export function (PyInit_hello)
>> ```
>> 
>> Here's the result by python38-cython-0.29.21-3 (succeeded).
>> 
>> ```
>> $ python setup.py build_ext --inplace
>> [...snip...]
>> $ python test.py
>> Hello World!
>> ```
>> 
>> Thanks.
>
> Thanks to you
>
> I still think that the change you proposed should go upstream.
>
> Have you tested your example on a NOT cygwin system ?
>
> Regards
> Marco

Here's the result by Ubuntu 20.04 with python-cython 0.29.21

```
$ lsb_release -d
Description:    Ubuntu 20.04.2 LTS
$ pip3 list | grep "Cython"
Cython                 0.29.21
$ python3 setup.py build_ext --inplace
[...snip...]
$ python3 test.py
Hello World!
```

The export name is different for the successful and unsuccessful cases.

Here's Cygwin python38-cython-0.29.21-2 (failed).

```
$ nm hello.cpython-38-x86_64-cygwin.dll | grep "PyInit"
000000040b8a22af T _Z12PyInit_hellov
```

Here's Cygwin python38-cython-0.29.21-3 (succeeded).

```
$ nm hello.cpython-38-x86_64-cygwin.dll | grep "PyInit"
000000040b8a22af T PyInit_hello
```

Here's Ubuntu python-cython 0.29.21 (succeeded).

```
$ nm hello.cpython-38-x86_64-linux-gnu.so | grep "PyInit"
00000000000030b7 T PyInit_hello
```

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

- Raw text -


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