marcelotduarte / cx_Freeze

cx_Freeze creates standalone executables from Python scripts, with the same performance, is cross-platform and should work on any platform that Python itself works on.
https://marcelotduarte.github.io/cx_Freeze/
Other
1.32k stars 216 forks source link

PySide6.7.2 + cx_Freeze=7.1.1 + Ubuntu 20.04 very big size of build directory - not used qt plugins and *.so files duplicates many times #2531

Open break11 opened 1 month ago

break11 commented 1 month ago

Describe the bug

I attach simple Qt App like this:

import sys

from PySide6.QtCore import Qt
from PySide6.QtWidgets import QApplication, QLabel, QWidget

def main() -> int:
    app = QApplication(sys.argv)
    window = QWidget()
    window.setWindowTitle("Simple")
    window.setGeometry(300, 300, 300, 300)
    label = QLabel(window)
    label.setText("Hello World!")
    label.setGeometry(0, 0, 300, 300)
    label.setAlignment(Qt.AlignCenter)
    window.show()
    return app.exec()

if __name__ == "__main__":
    sys.exit(main())

After build with cx_Freeze the build folder size is 1Gb ! It is to big. 1) Inside build folder i found many folder that not necessary in this app - many qt plugins. After i delete it build folder size became smaller - about 230 Mb. This is quite acceptable. And after deleting - app in build folder still work. I wrote small script for this deletion - it in attachment.

2) Many *.so files in build folder has duplicate - like libicudata.so.73 - it size about 30 Mb - first location --- build/exe.linux-x86_64-3.12/lib/PySide6/Qt/lib/ second location --- build/exe.linux-x86_64-3.12/lib/PySide6/Qt/plugins/platforms/ third location --- build/exe.linux-x86_64-3.12/lib/PySide6/Qt/plugins/xcbglintegrations/

It is 3*30 Mb instead of 30 Mb And there are many such files - like libQt6Core.so.6 (7Mb), libQt6Gui.so.6 (10 MB) and other.

I replace duplicate of some of this files to sym link - and all still work.

If i use simple app with QWebEngine it's even worse. The size of build folder about 1.6 Gb before cleaning.

I try this simple project on Win10 and bug not present there. The size is approximately the same as after cleaning in Ubuntu.

To Reproduce cx_Freeze.zip.

Expected behavior Remove not used Qt plugins, create sym links in build process?

Desktop:

kristofmulier commented 1 month ago

We're using cx_Freeze for building Embeetle IDE (see https://embeetle.com). Recently, we noticed also a blow up in size of PyQt6 on our Linux builds.