flatpak / freedesktop-sdk-images

Flatpak freedesktop 1.6 runtime. Note: New development is at https://gitlab.com/freedesktop-sdk/freedesktop-sdk
29 stars 33 forks source link

Python tests aren't removed from the Platform #92

Closed bochecha closed 5 years ago

bochecha commented 6 years ago

The manifest has this:

    "cleanup-platform": [
        ...
        "/lib/python*/test"
    ],

Yet:

$ ls -d1 /var/lib/flatpak/runtime/org.freedesktop.Platform/x86_64/1.6/active/files/lib/python*/test
/var/lib/flatpak/runtime/org.freedesktop.Platform/x86_64/1.6/active/files/lib/python2.7/test
/var/lib/flatpak/runtime/org.freedesktop.Platform/x86_64/1.6/active/files/lib/python3.5/test

The files aren't removed from the Platform as requested.

Could it be because they are in fact not installed as part of this build, but in the org.freedesktop.Base{Sdk,Platform} one?


There's quite a bit of space that could be saved removing Python tests:

$ find /var/lib/flatpak/runtime/org.freedesktop.Platform/x86_64/1.6/active/files/lib/python* -regex '.*\/tests?' -exec du -sh '{}' \; | sort -hr
21M /var/lib/flatpak/runtime/org.freedesktop.Platform/x86_64/1.6/active/files/lib/python2.7/test
19M /var/lib/flatpak/runtime/org.freedesktop.Platform/x86_64/1.6/active/files/lib/python3.5/test
808K    /var/lib/flatpak/runtime/org.freedesktop.Platform/x86_64/1.6/active/files/lib/python2.7/email/test
708K    /var/lib/flatpak/runtime/org.freedesktop.Platform/x86_64/1.6/active/files/lib/python2.7/lib2to3/tests
656K    /var/lib/flatpak/runtime/org.freedesktop.Platform/x86_64/1.6/active/files/lib/python2.7/ctypes/test
632K    /var/lib/flatpak/runtime/org.freedesktop.Platform/x86_64/1.6/active/files/lib/python2.7/distutils/tests
560K    /var/lib/flatpak/runtime/org.freedesktop.Platform/x86_64/1.6/active/files/lib/python2.7/lib-tk/test
560K    /var/lib/flatpak/runtime/org.freedesktop.Platform/x86_64/1.6/active/files/lib/python2.7/bsddb/test
528K    /var/lib/flatpak/runtime/org.freedesktop.Platform/x86_64/1.6/active/files/lib/python2.7/unittest/test
520K    /var/lib/flatpak/runtime/org.freedesktop.Platform/x86_64/1.6/active/files/lib/python3.5/unittest/test
340K    /var/lib/flatpak/runtime/org.freedesktop.Platform/x86_64/1.6/active/files/lib/python3.5/distutils/tests
316K    /var/lib/flatpak/runtime/org.freedesktop.Platform/x86_64/1.6/active/files/lib/python3.5/ctypes/test
272K    /var/lib/flatpak/runtime/org.freedesktop.Platform/x86_64/1.6/active/files/lib/python3.5/tkinter/test
268K    /var/lib/flatpak/runtime/org.freedesktop.Platform/x86_64/1.6/active/files/lib/python2.7/sqlite3/test
168K    /var/lib/flatpak/runtime/org.freedesktop.Platform/x86_64/1.6/active/files/lib/python2.7/json/tests
120K    /var/lib/flatpak/runtime/org.freedesktop.Platform/x86_64/1.6/active/files/lib/python3.5/sqlite3/test

The above folders can all be completely removed from the Platform (and even from the Sdk, honestly… who will run Python's own tests?)

That's about 46MB of installed size:

$ find /var/lib/flatpak/runtime/org.freedesktop.Platform/x86_64/1.6/active/files/lib/python* -regex '.*\/tests?' -exec du -s '{}' \; | awk '{ s+=$1 } END { print s}'
46768
TingPing commented 6 years ago

Also the c libs:


        "/lib/python*/lib-dynload/_*_test.*.so",
        "/lib/python*/lib-dynload/_test*.*.so",
nanonyme commented 5 years ago

For new runtime https://gitlab.com/freedesktop-sdk/freedesktop-sdk/blob/18.08/elements/base/python3.bst

nanonyme commented 5 years ago

Python 2 is no longer in platform with 18.08

bochecha commented 5 years ago

@nanonyme yeah, I know, that's how I started getting involved with FDO Sdk: I opened this issue here, and then just went and fixed it in 18.08. :laughing:

nanonyme commented 5 years ago

@bochecha was just going through this repo with intent on cleanup

TingPing commented 5 years ago

I guess we can close this, all improvements go into 18.08.