Active Topics

 


Reply
Thread Tools
Posts: 1,548 | Thanked: 7,510 times | Joined on Apr 2010 @ Czech Republic
#11
Originally Posted by marmistrz View Post
Aapo, can you please optify it?
A big +1 from me for this. A properly optified Python 3.2 should make the modRana Qt 5 & Python 3 based GUI (once I finally get it working) much more accessible to users.
__________________
modRana: a flexible GPS navigation system
Mieru: a flexible manga and comic book reader
Universal Components - a solution for native looking yet component set independent QML appliactions (QtQuick Controls 2 & Silica supported as backends)
 

The Following 8 Users Say Thank You to MartinK For This Useful Post:
peterleinchen's Avatar
Posts: 4,117 | Thanked: 8,901 times | Joined on Aug 2010 @ Ruhrgebiet, Germany
#12
I would also like an optified version, as my rootfs is almost full (still may optify it a bit manually).

But another question here, if it is possible at all?
If yes would it be possible to optify python-2.5 (moving /usr/lib/python-2.5/ to opt), which is 'wasting' over 20MB on rootfs?
__________________
SIM-Switcher, automated SIM switching with a Double (Dual) SIM adapter
--
Thank you all for voting me into the Community Council 2014-2016!

Please consider your membership / supporting Maemo e.V. and help to spread this by following/copying this link to your TMO signature:
[MC eV] Maemo Community eV membership application, http://talk.maemo.org/showthread.php?t=94257

editsignature, http://talk.maemo.org/profile.php?do=editsignature
 
pichlo's Avatar
Posts: 6,445 | Thanked: 20,981 times | Joined on Sep 2012 @ UK
#13
Originally Posted by peterleinchen View Post
If yes would it be possible to optify python-2.5 (moving /usr/lib/python-2.5/ to opt), which is 'wasting' over 20MB on rootfs?
Does it? I thought Python 2.5 was the ultimate (horrible, IMO) example of optification on Maemo through mounting.

Code:
~ $ mount
rootfs on / type rootfs (rw)
ubi0:rootfs on / type ubifs (rw,bulk_read,no_chk_data_crc)
proc on /proc type proc (rw)
sysfs on /sys type sysfs (rw)
tmpfs on /tmp type tmpfs (rw,noatime,size=1024k)
tmpfs on /var/run type tmpfs (rw,nosuid,noatime,size=256k,mode=755)
none on /dev type tmpfs (rw,noatime,size=10240k,mode=755)
devpts on /dev/pts type devpts (rw,gid=5,mode=620)
tmpfs on /dev/shm type tmpfs (rw,nosuid,nodev,noatime,size=65536k)
/dev/mmcblk0p2 on /home type ext3 (noatime,nodiratime,errors=continue,commit=1,data=writeback)
/home/opt on /opt type none (bind,rbind)
nodev on /sys/kernel/debug type debugfs (0)
/opt/pymaemo/usr/lib/python2.5 on /usr/lib/python2.5 type bind (bind,rbind)
/opt/pymaemo/usr/share/pyshared on /usr/share/pyshared type bind (bind,rbind)
/opt/pymaemo/usr/lib/pyshared on /usr/lib/pyshared type bind (bind,rbind)
/opt/pymaemo/usr/share/python-support on /usr/share/python-support type bind (bind,rbind)
/opt/pymaemo/usr/lib/python-support on /usr/lib/python-support type bind (bind,rbind)
/dev/mmcblk0p1 on /home/user/MyDocs type vfat (rw,noauto,nodev,exec,nosuid,noatime,nodiratime,utf8,uid=29999,shortname=mixed,dmask=000,fmask=0000,rodir)
/dev/mmcblk1p1 on /media/mmc1 type vfat (rw,noauto,nodev,exec,nosuid,noatime,nodiratime,utf8,uid=29999,shortname=mixed,dmask=000,fmask=0000,rodir)
~ $
__________________
Русский военный корабль, иди нахуй!
 

The Following 5 Users Say Thank You to pichlo For This Useful Post:
peterleinchen's Avatar
Posts: 4,117 | Thanked: 8,901 times | Joined on Aug 2010 @ Ruhrgebiet, Germany
#14
Ups, sorry.

Yes, read that part of mount so often that it seems I do ignore it fully.
damn, thought I could free up some space... [down to 10MB]


--edit (OT)
Just checked once more (and it is actually 79.8 MB ).
But why I thought so is
du -xsh /usr/lib/
shows 79.8 for python2.5. And -x should not show space on other file system. Seems a mounted (different) file system is not recognized by 'du'?
__________________
SIM-Switcher, automated SIM switching with a Double (Dual) SIM adapter
--
Thank you all for voting me into the Community Council 2014-2016!

Please consider your membership / supporting Maemo e.V. and help to spread this by following/copying this link to your TMO signature:
[MC eV] Maemo Community eV membership application, http://talk.maemo.org/showthread.php?t=94257

editsignature, http://talk.maemo.org/profile.php?do=editsignature

Last edited by peterleinchen; 2014-03-28 at 07:10.
 
Posts: 1,808 | Thanked: 4,272 times | Joined on Feb 2011 @ Germany
#15
@peterleinchen

If I do "du -h /usr/lib" I get 201.5M. If I do "du -xh /usr/lib" I get 141.4M.

Doing a diff on both outputs it is clear that "-xh" omits/ignores the 3 directories that are bind-mounted on /usr/lib, i.e. python2.5, pyshared and python-support.

You are probably doing "du -xsh /usr/lib/*" (note the "*") which is effectively overriding the "-x" by telling du explicitly to calculate the size of every directory under /usr/lib/, that is, including those [r]bind-mounted.
 

The Following 3 Users Say Thank You to reinob For This Useful Post:
peterleinchen's Avatar
Posts: 4,117 | Thanked: 8,901 times | Joined on Aug 2010 @ Ruhrgebiet, Germany
#16
Yes, exactly that is. (I expected a different behaviour, but from the view of directory hierarchy this makes sense.)

Muchos gracias.

-- end of OT
__________________
SIM-Switcher, automated SIM switching with a Double (Dual) SIM adapter
--
Thank you all for voting me into the Community Council 2014-2016!

Please consider your membership / supporting Maemo e.V. and help to spread this by following/copying this link to your TMO signature:
[MC eV] Maemo Community eV membership application, http://talk.maemo.org/showthread.php?t=94257

editsignature, http://talk.maemo.org/profile.php?do=editsignature
 

The Following 2 Users Say Thank You to peterleinchen For This Useful Post:
Posts: 838 | Thanked: 3,384 times | Joined on Mar 2009
#17
Optified python3.4.0 on extras-devel. Thanks for Your patience.

This time no Debian/Ubuntu-stuff, but I started with sources straight from the upstream [https://www.python.org/ftp/python/3....thon-3.4.0.tgz]. Everything is now in one big (22Mb) package, called python3.

Ok, this is loaned from Debian (but expat and libmpdec compiled-in)
Code:
./configure --prefix=/opt/python3/ \
                 --enable-ipv6 \
                 --enable-loadable-sqlite-extensions \
                 --with-dbmliborder=bdb:gdbm \
                 --with-computed-gotos \
                 --without-ensurepip \
                 --without-system-expat \
                 --without-system-libmpdec
(Request for comments about parameters)

And symlink /usr/bin/python3 -> /opt/python3/bin/python3.4
(This all looks so obvious now, but trust me this took some time to tinker)

Btw: It is compiled with default compiler on auto builder.
 

The Following 16 Users Say Thank You to AapoRantalainen For This Useful Post:
Posts: 838 | Thanked: 3,384 times | Joined on Mar 2009
#18
And of cource you should be interested in test-results (feel free to run on your device, tests are installed):
I dont yet understand everything, feel free to comment what are critical.

Code:
cd /opt/python3/lib/python3.4/test/
time python3 regrtest.py
(modified results:)
Code:
== CPython 3.4.0 (default, Apr 19 2014, 16:37:49) [GCC 4.2.1]
==   Linux-2.6.28.10-power52-armv7l-with-debian-testing-unstable little-endian
==   hash algorithm: siphash24 32bit
==   /var/tmp/test_python_22590
Testing with flags: sys.flags(debug=0, inspect=0, interactive=0, optimize=0, dont_write_bytecode=0, no_user_site=0, no_site=0, ignore_environment=0, verbose=0, bytes_warning=0, quiet=0, hash_randomization=1, isolated=0)
[  6/389] test_types
Warning -- locale was modified by test_types
[ 23/389] test_asyncio
test_asyncio skipped -- cannot import name '_base'
[ 40/389] test_calendar
Warning -- locale was modified by test_calendar
[ 60/389] test_codecmaps_cn
test_codecmaps_cn skipped -- Use of the 'urlfetch' resource not enabled
[ 61/389] test_codecmaps_hk
test_codecmaps_hk skipped -- Use of the 'urlfetch' resource not enabled
[ 62/389] test_codecmaps_jp
test_codecmaps_jp skipped -- Use of the 'urlfetch' resource not enabled
[ 63/389] test_codecmaps_kr
test_codecmaps_kr skipped -- Use of the 'urlfetch' resource not enabled
[ 64/389] test_codecmaps_tw
test_codecmaps_tw skipped -- Use of the 'urlfetch' resource not enabled
[ 71/389] test_compileall
test test_compileall failed -- Traceback (most recent call last):
  File "/opt/python3/lib/python3.4/test/test_compileall.py", line 194, in test_no_args_respects_force_flag
    self.assertRunOK('-f', PYTHONPATH=self.directory)
  File "/opt/python3/lib/python3.4/test/test_compileall.py", line 144, in assertRunOK
    *self._get_run_args(args), **env_vars)
  File "/opt/python3/lib/python3.4/test/script_helper.py", line 69, in assert_python_ok
    return _assert_python(True, *args, **env_vars)
  File "/opt/python3/lib/python3.4/test/script_helper.py", line 55, in _assert_python
    "stderr follows:\n%s" % (rc, err.decode('ascii', 'ignore')))
AssertionError: Process return code is 1, stderr follows:

[ 73/389/1] test_concurrent_futures
test_concurrent_futures skipped -- No module named '_multiprocessing'
[ 83/389/1] test_ctypes
test test_ctypes failed -- multiple errors occurred; run in verbose mode for details
[ 84/389/2] test_curses
test_curses skipped -- Use of the 'curses' resource not enabled
[ 96/389/2] test_devpoll
test_devpoll skipped -- select.devpoll not defined
[101/389/2] test_distutils
unable to execute gcc: No such file or directory
unable to execute gcc: No such file or directory
unable to execute gcc: No such file or directory
unable to execute gcc: No such file or directory
test test_distutils failed -- multiple errors occurred; run in verbose mode for details
[124/389/3] test_float
Warning -- locale was modified by test_float
[139/389/3] test_gdb
test_gdb skipped -- test_gdb only works on source builds at the moment.
[181/389/3] test_kqueue
test_kqueue skipped -- test works only on BSD
[187/389/3] test_locale
Warning -- locale was modified by test_locale
[206/389/3] test_msilib
test_msilib skipped -- No module named 'msilib'
[208/389/3] test_multiprocessing_fork
test_multiprocessing_fork skipped -- No module named '_multiprocessing'
[209/389/3] test_multiprocessing_forkserver
test_multiprocessing_forkserver skipped -- No module named '_multiprocessing'
[210/389/3] test_multiprocessing_main_handling
test_multiprocessing_main_handling skipped -- No module named '_multiprocessing'
[211/389/3] test_multiprocessing_spawn
test_multiprocessing_spawn skipped -- No module named '_multiprocessing'
[223/389/3] test_ossaudiodev
test_ossaudiodev skipped -- Use of the 'audio' resource not enabled
[292/389/3] test_smtpnet
test_smtpnet skipped -- Use of the 'network' resource not enabled
[295/389/3] test_socketserver
test_socketserver skipped -- Use of the 'network' resource not enabled
[300/389/3] test_startfile
test_startfile skipped -- object <module 'os' from '/opt/python3/lib/python3.4/os.py'> has no attribute 'startfile'
[307/389/3] test_strptime
Warning -- locale was modified by test_strptime
[312/389/3] test_subprocess
Could not find platform independent libraries <prefix>
Could not find platform dependent libraries <exec_prefix>
Consider setting $PYTHONHOME to <prefix>[:<exec_prefix>]
Fatal Python error: Py_Initialize: Unable to get the locale encoding
ImportError: No module named 'encodings'
Could not find platform independent libraries <prefix>
Could not find platform dependent libraries <exec_prefix>
Consider setting $PYTHONHOME to <prefix>[:<exec_prefix>]
Fatal Python error: Py_Initialize: Unable to get the locale encoding
ImportError: No module named 'encodings'
test test_subprocess failed -- multiple errors occurred; run in verbose mode for details
[318/389/4] test_sys
test test_sys failed -- Traceback (most recent call last):
  File "/opt/python3/lib/python3.4/test/test_sys.py", line 605, in test_executable
    self.assertEqual(os.path.abspath(sys.executable), sys.executable)
AssertionError: '/opt/python3/bin/python3' != '/opt/python3/lib/python3.4/test/../../../bin/python3'
- /opt/python3/bin/python3
+ /opt/python3/lib/python3.4/test/../../../bin/python3

[336/389/5] test_timeout
test_timeout skipped -- Use of the 'network' resource not enabled
[337/389/5] test_tk
test_tk skipped -- Use of the 'gui' resource not enabled
[338/389/5] test_tokenize
[339/389/5] test_tools
test_tools skipped -- test irrelevant for an installed Python
[343/389/5] test_ttk_guionly
test_ttk_guionly skipped -- Use of the 'gui' resource not enabled
[358/389/5] test_urllib2net
test_urllib2net skipped -- Use of the 'network' resource not enabled
[360/389/5] test_urllibnet
test_urllibnet skipped -- Use of the 'network' resource not enabled
[367/389/5] test_venv
test test_venv failed -- multiple errors occurred; run in verbose mode for details
[375/389/6] test_winreg
test_winreg skipped -- No module named 'winreg'
[376/389/6] test_winsound
test_winsound skipped -- Use of the 'audio' resource not enabled
[384/389/6] test_xmlrpc_net
test_xmlrpc_net skipped -- Use of the 'network' resource not enabled
[386/389/6] test_zipfile64
test_zipfile64 skipped -- test requires loads of disk-space bytes and a long time to run
348 tests OK.
6 tests failed:
    test_compileall test_ctypes test_distutils test_subprocess
    test_sys test_venv
5 tests altered the execution environment:
    test_calendar test_float test_locale test_strptime test_types
30 tests skipped:
    test_asyncio test_codecmaps_cn test_codecmaps_hk test_codecmaps_jp
    test_codecmaps_kr test_codecmaps_tw test_concurrent_futures
    test_curses test_devpoll test_gdb test_kqueue test_msilib
    test_multiprocessing_fork test_multiprocessing_forkserver
    test_multiprocessing_main_handling test_multiprocessing_spawn
    test_ossaudiodev test_smtpnet test_socketserver test_startfile
    test_timeout test_tk test_tools test_ttk_guionly test_urllib2net
    test_urllibnet test_winreg test_winsound test_xmlrpc_net
    test_zipfile64

real    85m24.808s
user    71m53.664s
sys     5m36.367s

You can run simple test with (e.g)
Code:
root
python3 regrtest.py test_zipfile64

[EDIT]
Tests 60,61,62,63,64
You need write access to the directory:
Code:
chown -R user /opt/python3/lib/python3.4/test
And 'resource urlfetch'
Code:
python3 regrtest.py -uurlfetch test_codecmaps_cn test_codecmaps_hk  test_codecmaps_jp test_codecmaps_kr test_codecmaps_tw
[/EDIT]

Last edited by AapoRantalainen; 2014-04-20 at 08:39.
 

The Following 3 Users Say Thank You to AapoRantalainen For This Useful Post:
Sohil876's Avatar
Posts: 130 | Thanked: 132 times | Joined on Jan 2013 @ India
#19
Originally Posted by AapoRantalainen View Post
Optified python3.4.0 on extras-devel. Thanks for Your patience.

This time no Debian/Ubuntu-stuff, but I started with sources straight from the upstream [https://www.python.org/ftp/python/3....thon-3.4.0.tgz]. Everything is now in one big (22Mb) package, called python3.

Ok, this is loaned from Debian (but expat and libmpdec compiled-in)
Code:
./configure --prefix=/opt/python3/ \
                 --enable-ipv6 \
                 --enable-loadable-sqlite-extensions \
                 --with-dbmliborder=bdb:gdbm \
                 --with-computed-gotos \
                 --without-ensurepip \
                 --without-system-expat \
                 --without-system-libmpdec
(Request for comments about parameters)

And symlink /usr/bin/python3 -> /opt/python3/bin/python3.4
(This all looks so obvious now, but trust me this took some time to tinker)

Btw: It is compiled with default compiler on auto builder.
Thanks. A little ot request i know but if you have spare time can you also upload pygame for this python version?
 
Posts: 1,548 | Thanked: 7,510 times | Joined on Apr 2010 @ Czech Republic
#20
Originally Posted by AapoRantalainen View Post
Optified python3.4.0 on extras-devel. Thanks for Your patience.

This time no Debian/Ubuntu-stuff, but I started with sources straight from the upstream [https://www.python.org/ftp/python/3....thon-3.4.0.tgz]. Everything is now in one big (22Mb) package, called python3.

Ok, this is loaned from Debian (but expat and libmpdec compiled-in)
Code:
./configure --prefix=/opt/python3/ \
                 --enable-ipv6 \
                 --enable-loadable-sqlite-extensions \
                 --with-dbmliborder=bdb:gdbm \
                 --with-computed-gotos \
                 --without-ensurepip \
                 --without-system-expat \
                 --without-system-libmpdec
(Request for comments about parameters)

And symlink /usr/bin/python3 -> /opt/python3/bin/python3.4
(This all looks so obvious now, but trust me this took some time to tinker)

Btw: It is compiled with default compiler on auto builder.
Thanks a lot ! With this & the Qt 5 port only PyOtherSide is needed to enable the modRana Qt 5 GUI & other Python 3 & Qt 5 apps to run on the N900.

BTW, we now have the same version of Python Sailfish has (3.4), which is even newer than the Python version in the latest Fedora (3.3).
__________________
modRana: a flexible GPS navigation system
Mieru: a flexible manga and comic book reader
Universal Components - a solution for native looking yet component set independent QML appliactions (QtQuick Controls 2 & Silica supported as backends)

Last edited by MartinK; 2014-04-20 at 10:49.
 

The Following 6 Users Say Thank You to MartinK For This Useful Post:
Reply


 
Forum Jump


All times are GMT. The time now is 21:13.