Issue303

Title Undefined references (PyUnicodeUCS2 related) in trivial linux build attempt
Priority bug Status chatting
Superseder Nosy List russ
Assigned To Keywords debian

Created on 2016-04-20.13:57:35 by russ, last changed by russ.

Messages
msg2261 (view) Author: russ Date: 2017-10-17.17:54:24
I've just retried my initial report (on Debian), and it now works!! See 
below:

$ python --version
Python 2.7.13 :: Continuum Analytics, Inc.
$ nuitka --version
0.5.28
$ echo "print 'foo'" > test.py                        
$ nuitka --portable test.py 
$ test.dist/test.exe 
foo
$ tree -A
.
├── test.build
│   ├── build_definitions.h
│   ├── CompiledCellType.cpp -> 
/home/russ/miniconda3/envs/edms/lib/python2.7/site-
packages/nuitka/build/static_src/CompiledCellType.c
│   ├── CompiledCellType.o
│   ├── CompiledCodeHelpers.cpp -> 
/home/russ/miniconda3/envs/edms/lib/python2.7/site-
packages/nuitka/build/static_src/CompiledCodeHelpers.c
│   ├── CompiledCodeHelpers.o
│   ├── CompiledFrameType.cpp -> 
/home/russ/miniconda3/envs/edms/lib/python2.7/site-
packages/nuitka/build/static_src/CompiledFrameType.c
│   ├── CompiledFrameType.o
│   ├── CompiledFunctionType.cpp -> 
/home/russ/miniconda3/envs/edms/lib/python2.7/site-
packages/nuitka/build/static_src/CompiledFunctionType.c
│   ├── CompiledFunctionType.o
│   ├── CompiledGeneratorType.cpp -> 
/home/russ/miniconda3/envs/edms/lib/python2.7/site-
packages/nuitka/build/static_src/CompiledGeneratorType.c
│   ├── CompiledGeneratorType.o
│   ├── CompiledMethodType.cpp -> 
/home/russ/miniconda3/envs/edms/lib/python2.7/site-
packages/nuitka/build/static_src/CompiledMethodType.c
│   ├── CompiledMethodType.o
│   ├── __constants.bin
│   ├── __constants.cpp
│   ├── __constants.o
│   ├── fibers_x64.cpp -> /home/russ/miniconda3/envs/edms/lib/python2.7/site-
packages/nuitka/build/static_src/x64_ucontext_src/fibers_x64.c
│   ├── fibers_x64.o
│   ├── __frozen.cpp
│   ├── __frozen.o
│   ├── __helpers.cpp
│   ├── __helpers.h
│   ├── __helpers.o
│   ├── InspectPatcher.cpp -> 
/home/russ/miniconda3/envs/edms/lib/python2.7/site-
packages/nuitka/build/static_src/InspectPatcher.c
│   ├── InspectPatcher.o
│   ├── MainProgram.cpp -> 
/home/russ/miniconda3/envs/edms/lib/python2.7/site-
packages/nuitka/build/static_src/MainProgram.c
│   ├── MainProgram.o
│   ├── MetaPathBasedLoader.cpp -> 
/home/russ/miniconda3/envs/edms/lib/python2.7/site-
packages/nuitka/build/static_src/MetaPathBasedLoader.c
│   ├── MetaPathBasedLoader.o
│   ├── module.__main__.cpp
│   ├── module.__main__.o
│   ├── swapfiber.o
│   └── swapfiber.S -> /home/russ/miniconda3/envs/edms/lib/python2.7/site-
packages/nuitka/build/static_src/x64_ucontext_src/swapfiber.S
├── test.dist
│   ├── array.so
│   ├── binascii.so
│   ├── _bisect.so
│   ├── bz2.so
│   ├── _codecs_cn.so
│   ├── _codecs_hk.so
│   ├── _codecs_iso2022.so
│   ├── _codecs_jp.so
│   ├── _codecs_kr.so
│   ├── _codecs_tw.so
│   ├── _collections.so
│   ├── cPickle.so
│   ├── cStringIO.so
│   ├── _csv.so
│   ├── _ctypes.so
│   ├── _curses_panel.so
│   ├── _curses.so
│   ├── datetime.so
│   ├── _elementtree.so
│   ├── fcntl.so
│   ├── _functools.so
│   ├── grp.so
│   ├── _hashlib.so
│   ├── _heapq.so
│   ├── _hotshot.so
│   ├── _io.so
│   ├── itertools.so
│   ├── _json.so
│   ├── libcrypto.so.1.0.0
│   ├── libgcc_s.so.1
│   ├── libncursesw.so.5
│   ├── libpanelw.so.5
│   ├── libpython2.7.so.1.0
│   ├── libreadline.so.6
│   ├── libsqlite3.so.0
│   ├── libssl.so.1.0.0
│   ├── libstdc++.so.6
│   ├── libtcl8.5.so
│   ├── libtinfo.so.5
│   ├── libtk8.5.so
│   ├── libutil.so.1
│   ├── libuuid.so.1
│   ├── libX11.so.6
│   ├── libXau.so.6
│   ├── libxcb.so.1
│   ├── libXdmcp.so.6
│   ├── libz.so.1
│   ├── _locale.so
│   ├── _lsprof.so
│   ├── math.so
│   ├── mmap.so
│   ├── _multibytecodec.so
│   ├── _multiprocessing.so
│   ├── operator.so
│   ├── parser.so
│   ├── pyexpat.so
│   ├── _random.so
│   ├── readline.so
│   ├── resource.so
│   ├── select.so
│   ├── _socket.so
│   ├── _sqlite3.so
│   ├── _ssl.so
│   ├── strop.so
│   ├── _struct.so
│   ├── termios.so
│   ├── test.exe
│   ├── time.so
│   ├── _tkinter.so
│   ├── unicodedata.so
│   └── zlib.so
└── test.py
msg2257 (view) Author: kayhayen Date: 2017-10-17.16:52:18
Those links unfortunately expired and I cannot gather any information from there.
msg1920 (view) Author: russ Date: 2016-04-20.20:09:54
sys.maxunicode is 65535.  Not debian's python. It is in a virtualenv.  I actually forget the origin, 
but it is pretty vanilla (although I may have compiled it).

Full python compilation options are here:

https://www.pastery.net/mhwpvq/raw

Obtained via:

```
$ which python
/home/russ/.virtualenvs/edms/bin/python
$ which nuitka
/home/russ/.virtualenvs/edms/bin/nuitka
$ python
Python 2.7.9 (default, Apr 28 2015, 12:08:07) 
[GCC 4.7.2] on linux2
Type "help", "copyright", "credits" or "license" for more information.
>>> import sys, sysconfig, pprint, bakeit
>>> sys.maxunicode
65535
>>> opts = pprint.pformat(sysconfig.get_config_vars())
>>> paster = bakeit.PasteryUploader(open("/home/russ/pastery_api").read().strip())
>>> paster.upload(opts, duration = 60*24*30) + "raw"
u'https://www.pastery.net/mhwpvq/raw'
```
msg1919 (view) Author: kayhayen Date: 2016-04-20.19:04:22
Can you give the output of python -c "import sys; print sys.maxunicode" please.

Is this a self compiled Python, or the one in Debian Wheezy.

Yours,
Kay
msg1918 (view) Author: russ Date: 2016-04-20.13:59:20
Also note that this same problem exists with the stable binaries in the 0.5.20 tar 
release.  This is/was seen/reported in issue 301 but I have separated it into this 
issue.
msg1917 (view) Author: russ Date: 2016-04-20.13:57:35
I am trying to use Nuitka to compile the following python file:

    print "foo"

Nuitka throws errors when I try.  This is one of a few out-of-the-box issues I'm 
having when tryign 
to evaluate Nuitka with a trivial example (on Debian with a non-distro python 
2.7.9).  Other issues 
have been issues 301 and 302 (so far).

Log of the issue is below.  Note the use of the factory version that was made for 
issue 301.

```
$ pip install -U 'http://nuitka.net/gitweb/?
p=Nuitka.git;a=snapshot;h=refs/heads/factory;sf=tgz'
Collecting http://nuitka.net/gitweb/?
p=Nuitka.git;a=snapshot;h=refs/heads/factory;sf=tgz
  Downloading http://nuitka.net/gitweb/?
p=Nuitka.git;a=snapshot;h=refs/heads/factory;sf=tgz
     \ 2.3MB 1.8MB/s
Installing collected packages: Nuitka
  Running setup.py install for Nuitka ... done
Successfully installed Nuitka-0.5.21rc4
$ cat test.py 
print "foo"
$ python test.py 
foo
$ nuitka --portable test.py 
test.build/static/CompiledCodeHelpers.o: In function `PRINT_ITEM_TO(_object*, 
_object*)':
CompiledCodeHelpers.cpp:(.text+0x2e79): undefined reference to 
`_PyUnicodeUCS2_IsWhitespace'
test.build/static/CompiledCodeHelpers.o: In function `BUILTIN_GETATTR(_object*, 
_object*, 
_object*)':
CompiledCodeHelpers.cpp:(.text+0x3ade): undefined reference to 
`_PyUnicodeUCS2_AsDefaultEncodedString'
test.build/static/CompiledCodeHelpers.o: In function `UNSTREAM_UNICODE(unsigned 
char const*, 
long)':
CompiledCodeHelpers.cpp:(.text+0x3531): undefined reference to 
`PyUnicodeUCS2_FromStringAndSize'
test.build/static/MainProgram.o: In function `main':
MainProgram.cpp:(.text.startup+0x1d8): undefined reference to 
`PyUnicodeUCS2_FromString'
collect2: error: ld returned 1 exit status
scons: *** [test.dist/test.exe] Error 1
$
$ python --version
Python 2.7.9
$ nuitka --version
0.5.21rc4
$ lsb_release -a
LSB Version:    core-2.0-amd64:core-2.0-noarch:core-3.0-amd64:core-3.0-
noarch:core-3.1-amd64:core-
3.1-noarch:core-3.2-amd64:core-3.2-noarch:core-4.0-amd64:core-4.0-noarch:core-
4.1-amd64:core-4.1-
noarch:security-4.0-amd64:security-4.0-noarch:security-4.1-amd64:security-4.1-
noarch
Distributor ID: Debian
Description:    Debian GNU/Linux 7.10 (wheezy)
Release:        7.10
Codename:       wheezy

```
History
Date User Action Args
2017-10-17 17:54:24russsetmessages: + msg2261
2017-10-17 16:52:18kayhayensetmessages: + msg2257
2016-04-20 20:09:54russsetmessages: + msg1920
2016-04-20 19:04:22kayhayensetmessages: + msg1919
2016-04-20 13:59:20russsetstatus: unread -> chatting
messages: + msg1918
2016-04-20 13:57:35russcreate