flipperdevices / flipperzero-firmware

Flipper Zero firmware source code
https://flipperzero.one
GNU General Public License v3.0
12.72k stars 2.7k forks source link

Windows toolchain is missing python Pillow package #3493

Closed Kingwad closed 7 months ago

Kingwad commented 7 months ago

Describe the bug.

The Windows toolchain is missing the python Pillow package required to build the updater_package target. The toolchain is supposed to include all python packages to alleviate the need to install packages system-wide.

Reproduction

On a Windows machine that does not have Pillow installed in the system level python pip packages:

Run ./fbt updater_package

See that it fails to build with

Traceback (most recent call last):
  File "C:\Users\adam\dev\flipperzero-firmware\applications_user\flipperzero-game-engine-example\engine\scripts\sprite_builder.py", line 8, in <module>
    from PIL import Image, ImageOps
ModuleNotFoundError: No module named 'PIL'

Target

No response

Logs

PS C:\Users\adam\dev\flipperzero-firmware> ./fbt COMPACT=0 DEBUG=1 VERBOSE=0 updater_package
        SDKCHK  targets\f7\api_symbols.csv
API version 58.0 is up to date
Linking build\f7-firmware-D as latest built dir (./build/latest/)
        HEX     build\f7-updater-D\updater.hex
        BIN     build\f7-updater-D\updater.bin
updater.bin:   29 flash pages (last page 64.77% full)
        EXTCMD  applications_user\flipperzero-game-engine-example\assets
        APPMETA build\f7-firmware-D\.extapps\microel_parser.fal
        FAP     build\f7-firmware-D\.extapps\microel_parser.fal
        APPMETA build\f7-firmware-D\.extapps\mizip_parser.fal
        FASTFAP build\f7-firmware-D\.extapps\microel_parser.fal
        FAP     build\f7-firmware-D\.extapps\mizip_parser.fal
        DFU     build\f7-updater-D\updater.dfu
        CDB     build\f7-firmware-D\compile_commands.json
        FASTFAP build\f7-firmware-D\.extapps\mizip_parser.fal
        APPMETA build\f7-firmware-D\.extapps\hi_parser.fal
        FAP     build\f7-firmware-D\.extapps\hi_parser.fal
Traceback (most recent call last):
  File "C:\Users\adam\dev\flipperzero-firmware\applications_user\flipperzero-game-engine-example\engine\scripts\sprite_builder.py", line 8, in <module>
    from PIL import Image, ImageOps
ModuleNotFoundError: No module named 'PIL'
        FASTFAP build\f7-firmware-D\.extapps\hi_parser.fal
        APPMETA build\f7-firmware-D\.extapps\opal_parser.fal
        FAP     build\f7-firmware-D\.extapps\opal_parser.fal
        FASTFAP build\f7-firmware-D\.extapps\opal_parser.fal
        APPMETA build\f7-firmware-D\.extapps\mykey_parser.fal
        FAP     build\f7-firmware-D\.extapps\mykey_parser.fal
        FASTFAP build\f7-firmware-D\.extapps\mykey_parser.fal
        APPMETA build\f7-firmware-D\.extapps\myki_parser.fal
        FAP     build\f7-firmware-D\.extapps\myki_parser.fal
        APPMETA build\f7-firmware-D\.extapps\troika_parser.fal
        FASTFAP build\f7-firmware-D\.extapps\myki_parser.fal
        FAP     build\f7-firmware-D\.extapps\troika_parser.fal
        APPMETA build\f7-firmware-D\.extapps\washcity_parser.fal
        FAP     build\f7-firmware-D\.extapps\washcity_parser.fal
        FASTFAP build\f7-firmware-D\.extapps\troika_parser.fal
        LINK    build\f7-firmware-D\.extapps\plantain_parser_d.elf
        FASTFAP build\f7-firmware-D\.extapps\washcity_parser.fal
        LINK    build\f7-firmware-D\.extapps\two_cities_parser_d.elf
        LINK    build\f7-firmware-D\.extapps\aime_parser_d.elf
        LINK    build\f7-firmware-D\.extapps\umarsh_parser_d.elf
scons: *** [applications_user\flipperzero-game-engine-example\assets] Error 1
        CC      applications\main\nfc\plugins\supported_cards\gallagher.c

********** FBT ERRORS **********
applications_user\flipperzero-game-engine-example\assets: Error 1

Anything else?

Tested on release 98.3 (toolchain 23) and dev (toolchain 33) and the result is the same

skotopes commented 7 months ago

@hedger @DrZlo13 FYI

Willy-JL commented 7 months ago

the issue is that this app uses compile command with python3 which is not part of toolchain on windows, so it uses the system python, which does not have pil.

solution is as per https://github.com/flipperdevices/flipperzero-good-faps/pull/155

skotopes commented 7 months ago

We'll update flipperzero-game-engine-example

DrZlo13 commented 7 months ago

Air Arkanoid and flipperzero-game-engine-example have been updated to use python from the toolchain.