Как заставить Nuitka генерировать тот же бинар на Github Actions, что и локально?Linux

Ответить
Anonymous
 Как заставить Nuitka генерировать тот же бинар на Github Actions, что и локально?

Сообщение Anonymous »

Я пытался собрать свою программу Python с самым маленьким исполняемым файлом, и я был доволен этим < /p>

Код: Выделить всё

nuitka --python-flag=-OO --onefile updater.py
< /code>
, как это произвело это на моей машине < /p>
-rwxrwxrwx 1 filip filip 6.4M Oct  6 21:00 updater.bin*
ldd updater.bin
linux-vdso.so.1 (0x00007ffeb13af000)
libc.so.6 => /lib/x86_64-linux-gnu/libc.so.6 (0x0000749f3d000000)
/lib64/ld-linux-x86-64.so.2 (0x0000749f3d334000)
< /code>
Но я не могу воспроизвести результат на действиях GitHub, одна и та же команда генерирует файл более чем в два раза больше, но с одинаковыми ссылками < /p>
-rwxr-xr-x 1 runner runner  16M Oct  6 21:06 updater.bin
С некоторыми флагами, такими как--noinclude-dlls = 'libpython3.*' Я могу его снизить до 8 МБ, но что-то все еще сильно отличается в среде, вот мои журналы компиляции локально

Код: Выделить всё

Nuitka: Starting Python compilation with:
Nuitka:   Version '2.7.16' on Python 3.13 (flavor 'Debian Python') commercial grade 'not installed'.
Nuitka: Completed Python level compilation and optimization.
Nuitka: Generating source code for C backend compiler.
Nuitka: Running data composer tool for optimal constant value handling.
Nuitka: Running C compilation via Scons.
Nuitka-Scons: Backend C compiler: gcc (gcc 13).
Nuitka-Scons:WARNING: The gcc compiler for LTO mode requires 'make' to be installed for parallel linking to be used,
Nuitka-Scons:WARNING: compilation might be a lot slower without it.
Nuitka-Scons: Backend C linking with 6 files (no progress information available for this stage).
lto-wrapper: warning: using serial compilation of 6 LTRANS jobs
lto-wrapper: note: see the '-flto' option documentation for more information
Nuitka-Scons: Compiled 6 C files using ccache.
Nuitka-Scons: Cached C files (using ccache) with result 'cache hit': 6
Nuitka-Postprocessing: Creating single file from dist folder, this may take a while.
Nuitka-Onefile: Running bootstrap binary compilation via Scons.
Nuitka-Scons: Onefile C compiler: gcc (gcc 13).
Nuitka-Scons: Onefile C linking.
Nuitka-Scons: Compiled 1 C files using ccache.
Nuitka-Scons: Cached C files (using ccache) with result 'cache hit': 1
Nuitka-Onefile: Using compression for onefile payload.
Nuitka-Onefile: Onefile payload compression ratio (28.07%) size 22975384 to 6450154.
Nuitka-Onefile: Keeping onefile build directory 'updater.onefile-build'.
Nuitka: Keeping dist folder 'updater.dist' for inspection, no need to use it.
Nuitka: Keeping build directory 'updater.build'.
Nuitka: Successfully created 'updater.bin'.
Nuitka-Reports: Compilation report written to file 'report-local.xml'.
< /code>
и на github actions < /p>
Nuitka-Options: Detected static libpython to exist, consider '--static-libpython=yes' for better performance, but errors may happen.
Nuitka: Starting Python compilation with:
Nuitka:   Version '2.7.16' on Python 3.13 (flavor 'GitHub Actions Python') commercial grade 'not installed'.
Nuitka-Plugins:anti-bloat: Not including '_json' automatically in order to avoid bloat, but this may cause: may slow down by using fallback implementation.
Nuitka-Plugins:anti-bloat: Not including '_bisect' automatically in order to avoid bloat, but this may cause: may slow down by using fallback implementation.
Nuitka: Completed Python level compilation and optimization.
Nuitka: Generating source code for C backend compiler.
Nuitka: Running data composer tool for optimal constant value handling.
Nuitka: Running C compilation via Scons.
Nuitka-Scons: Backend C compiler: gcc (gcc 13).
Nuitka-Scons: Backend C linking with 7 files (no progress information available for this stage).
Nuitka-Scons:WARNING: You are not using ccache, re-compilation of identical code will be slower than necessary. Use your OS package manager to install it.
Nuitka-Postprocessing: Creating single file from dist folder, this may take a while.
Nuitka-Onefile: Running bootstrap binary compilation via Scons.
Nuitka-Scons: Onefile C compiler: gcc (gcc 13).
Nuitka-Scons: Onefile C linking.
Nuitka-Scons:WARNING: You are not using ccache, re-compilation of identical code will be slower than necessary.  Use your OS package manager to install it.
Nuitka-Onefile: Using compression for onefile payload.
Nuitka-Onefile: Onefile payload compression ratio (29.18%) size 55222876 to 16111988.
Nuitka-Onefile: Keeping onefile build directory 'updater.onefile-build'.
Nuitka: Keeping dist folder 'updater.dist' for inspection, no need to use it.
Nuitka: Keeping build directory 'updater.build'.
Nuitka: Successfully created 'updater.bin'.
Отчеты об этом компиляции можно найти по адресу:
https://pastebin.com/hfyvctka - local
https://pastebin.com/epqffve - github
my offflow может быть основан на Br/p> pull workflow. />https://github.com/fistodul/mf-updater/ ... 20app.yaml

Подробнее здесь: https://stackoverflow.com/questions/797 ... as-locally
Ответить

Быстрый ответ

Изменение регистра текста: 
Смайлики
:) :( :oops: :roll: :wink: :muza: :clever: :sorry: :angel: :read: *x)
Ещё смайлики…
   
К этому ответу прикреплено по крайней мере одно вложение.

Если вы не хотите добавлять вложения, оставьте поля пустыми.

Максимально разрешённый размер вложения: 15 МБ.

Вернуться в «Linux»