Pyrlang / Pyrlang

Erlang node implemented in Python 3.5+ (Asyncio-based)
https://pyrlang.github.io/Pyrlang/
Apache License 2.0
602 stars 59 forks source link

ETF native codec doesn't work with pypy #62

Open YievCkim opened 4 years ago

YievCkim commented 4 years ago

Hello,

I am trying to run Pyrlang with the native term ETF library.

I have installed setuptools-rust and I see the output from Rust compiler:

(test_pypy) mik@lt-1:~/dev_python/Term$ LD_LIBRARY_PATH=/home/mik/dev_python/Term/target/release python setup.py develop
running develop
Checking .pth file support in /home/mik/dev_python/envs/test_pypy/site-packages/
/home/mik/dev_python/envs/test_pypy/bin/python -E -c pass
TEST PASSED: /home/mik/dev_python/envs/test_pypy/site-packages/ appears to support .pth files
running egg_info
writing pyrlang_term.egg-info/PKG-INFO
writing dependency_links to pyrlang_term.egg-info/dependency_links.txt
writing top-level names to pyrlang_term.egg-info/top_level.txt
reading manifest file 'pyrlang_term.egg-info/SOURCES.txt'
reading manifest template 'MANIFEST.in'
writing manifest file 'pyrlang_term.egg-info/SOURCES.txt'
running build_ext
running build_rust
cargo rustc --lib --manifest-path Cargo.toml --features cpython/python3-sys cpython/extension-module --verbose -- --crate-type cdylib
       Fresh version_check v0.1.4
       Fresh unicode-xid v0.1.0
       Fresh ucd-util v0.1.1
       Fresh cc v1.0.25
       Fresh libc v0.2.43
       Fresh utf8-ranges v1.0.1
       Fresh rustc-serialize v0.3.24
       Fresh cfg-if v0.1.5
       Fresh rustc-demangle v0.1.9
       Fresh byteorder v0.4.2
       Fresh void v1.0.2
       Fresh byteorder v1.2.6
       Fresh byte v0.2.3
       Fresh regex-syntax v0.6.6
       Fresh rand v0.4.3
       Fresh log v0.4.5
       Fresh empty v0.0.4
       Fresh memchr v2.2.0
       Fresh num-traits v0.2.5
       Fresh proc-macro2 v0.4.19
       Fresh rand v0.3.22
       Fresh lazy_static v1.1.0
       Fresh log v0.3.9
       Fresh aho-corasick v0.7.3
       Fresh num-integer v0.1.39
       Fresh quote v0.6.8
       Fresh backtrace-sys v0.1.24
       Fresh num-complex v0.1.43
       Fresh thread_local v0.3.6
       Fresh syn v0.14.9
       Fresh num-bigint v0.1.44
       Fresh num-iter v0.1.37
       Fresh backtrace v0.3.9
       Fresh regex v1.1.6
       Fresh num-rational v0.1.42
       Fresh synstructure v0.9.0
       Fresh failure_derive v0.1.2
       Fresh num v0.1.42
       Fresh python3-sys v0.2.1
       Fresh failure v0.1.2
       Fresh compress v0.1.2
       Fresh cpython v0.2.1
       Fresh native_codec_impl v0.1.0 (/home/mik/dev_python/Term)
    Finished dev [unoptimized + debuginfo] target(s) in 0.05s
Creating /home/mik/dev_python/envs/test_pypy/site-packages/pyrlang-term.egg-link (link to .)
Adding pyrlang-term 1.2 to easy-install.pth file

Installed /home/mik/dev_python/Term
Processing dependencies for pyrlang-term==1.2
Finished processing dependencies for pyrlang-term==1.2
(test_pypy) mik@lt-1:~/dev_python/Term$ 

After that I tried to install Pyrlang but I get the same warning about ETF:

(test_pypy) mik@lt-1:~/dev_python/Pyrlang$ LD_LIBRARY_PATH=/home/mik/dev_python/Term/target/release python setup.py develop
running develop
Checking .pth file support in /home/mik/dev_python/envs/test_pypy/site-packages/
/home/mik/dev_python/envs/test_pypy/bin/python -E -c pass
TEST PASSED: /home/mik/dev_python/envs/test_pypy/site-packages/ appears to support .pth files
running egg_info
writing pyrlang.egg-info/PKG-INFO
writing dependency_links to pyrlang.egg-info/dependency_links.txt
writing top-level names to pyrlang.egg-info/top_level.txt
reading manifest file 'pyrlang.egg-info/SOURCES.txt'
writing manifest file 'pyrlang.egg-info/SOURCES.txt'
running build_ext
Creating /home/mik/dev_python/envs/test_pypy/site-packages/pyrlang.egg-link (link to .)
Adding pyrlang 0.9 to easy-install.pth file

Installed /home/mik/dev_python/Pyrlang
Processing dependencies for pyrlang==0.9
Finished processing dependencies for pyrlang==0.9
(test_pypy) mik@lt-1:~/dev_python/Pyrlang$ cd ../pyrlang_pypy/
(test_pypy) mik@lt-1:~/dev_python/pyrlang_pypy$ python start_node.py
Native term ETF codec library import failed, falling back to slower Python impl
^C
KeyboardInterrupt
(test_pypy) mik@lt-1:~/dev_python/pyrlang_pypy$ 

What must I do to get the native codec ?

kvakvs commented 4 years ago

If you successfully built the .so file of the native library, make sure your Python interpreter can find it somewhere in search path, maybe symlink or copy it where it can be found, and try again.

YievCkim commented 4 years ago

Ok I'll try this. I am under virtualenv with pypy3. I will try with cpython3 too. Thx

YievCkim commented 4 years ago

Hello,

I tried with cpython and ETF native lib works in this enviornment.

For pypy it doesn't work. Perhaps it's normal I don't know.

Thx anyway

s2hc-johan commented 4 years ago

a quick google shown something about the install procedure needed to be pypy. Maybe we haven't written setup.py well enough to work natively with pypy.

Don't run pypy so I have a hard time testing it.

YievCkim commented 4 years ago

Ok. I can look for this I think.