sle118 / squeezelite-esp32

ESP32 Music streaming based on Squeezelite, with support for multi-room sync, AirPlay, Bluetooth, Hardware buttons, display and more
1.22k stars 110 forks source link

Failing to build docker image in Linux/Ubuntu -- cspot/nanopb_pb2.py #262

Closed jochen-rath closed 1 year ago

jochen-rath commented 1 year ago

Hello

I can not build the docker image in Linux. I get the same errors as described in this issue: https://github.com/sle118/squeezelite-esp32/issues/246 But I am not building in Windows, but Ubuntu 22.04.2 LTS. I tried the solution mentioned in the issue, but it didn't work. I also tried the solution mentioned in this issue: https://github.com/sle118/squeezelite-esp32/issues/256

git clone --recursive https://github.com/sle118/squeezelite-esp32.git docker pull sle118/squeezelite-esp32-idfv435 cd squeezelite-esp32 find components/spotify/cspot -type f -print0 | xargs -0 dos2unix -- c docker run -it -v $(pwd):/workspace/squeezelite-esp32 sle118/squeezelite-esp32-idfv435

I tried also git clone --recursive -b master-v4.3 https://github.com/sle118/squeezelite-esp32.git and I tried to clone the git repository in docker.

I also tried both docker version: root@7e2d6f8ffc3b:/workspace/squeezelite-esp32# idf.py --version ESP-IDF v4.3.2-dirty and root@7553d85b37ea:/# idf.py --version ESP-IDF v4.3.5-dirty

I have also tried without a docker image. But every build fails with the same error: -- Configuring done -- Generating done -- Build files have been written to: /workspace/inDocker/squeezelite-esp32/build [3/1545] cd /workspace/inDocker/squeezelite-esp32/build && /opt/esp/tools/cmake/.../bin/cmake -P /workspace/inDocker/squeezelite-esp32/generate_debug_scripts.cmake Generating debug script files [5/1545] Generating nanopb/generator/proto/nanopb_pb2.py FAILED: esp-idf/spotify/cspot/nanopb/generator/proto/nanopb_pb2.py

I do not need spotify. Can I build the program without it?

wizmo2 commented 1 year ago

I had the same issue #246 . For me it was a windows lf/cr return issue. try changing your your git setting for linux format when cloning.

sle118 commented 1 year ago

Hello

I can not build the docker image in Linux. I get the same errors as described in this issue: #246 But I am not building in Windows, but Ubuntu 22.04.2 LTS. I tried the solution mentioned in the issue, but it didn't work. I also tried the solution mentioned in this issue: #256

git clone --recursive https://github.com/sle118/squeezelite-esp32.git docker pull sle118/squeezelite-esp32-idfv435 cd squeezelite-esp32 find components/spotify/cspot -type f -print0 | xargs -0 dos2unix -- c docker run -it -v $(pwd):/workspace/squeezelite-esp32 sle118/squeezelite-esp32-idfv435

I tried also git clone --recursive -b master-v4.3 https://github.com/sle118/squeezelite-esp32.git and I tried to clone the git repository in docker.

I also tried both docker version: root@7e2d6f8ffc3b:/workspace/squeezelite-esp32# idf.py --version ESP-IDF v4.3.2-dirty and root@7553d85b37ea:/# idf.py --version ESP-IDF v4.3.5-dirty

I have also tried without a docker image. But every build fails with the same error: -- Configuring done -- Generating done -- Build files have been written to: /workspace/inDocker/squeezelite-esp32/build [3/1545] cd /workspace/inDocker/squeezelite-esp32/build && /opt/esp/tools/cmake/.../bin/cmake -P /workspace/inDocker/squeezelite-esp32/generate_debug_scripts.cmake Generating debug script files [5/1545] Generating nanopb/generator/proto/nanopb_pb2.py FAILED: esp-idf/spotify/cspot/nanopb/generator/proto/nanopb_pb2.py

I do not need spotify. Can I build the program without it?

Can you please share more context (lines before and after) in your build log?

One of the things that the build script does is setting up the permissions for a few protoc related objects:

  chmod +x ./components/spotify/cspot/bell/external/nanopb/generator/protoc-gen-nanopb
  chmod +x ./components/spotify/cspot/bell/external/nanopb/generator/*.py
  chmod +x ./components/spotify/cspot/bell/external/nanopb/generator/*.py2
  chmod +x ./components/spotify/cspot/bell/external/nanopb/generator/proto/*.py
jochen-rath commented 1 year ago

Thanks for your replies. @wizmo2: I will try it, when I have understood, how to change the settings.

@sle118 This is my full output: jochen@lenovo:~/esp/squeezelite-esp32$ docker run -it -vpwd:/workspace/squeezelite-esp32 sle118/squeezelite-esp32-idfv43 Detecting the Python interpreter Checking "python" ... Python 3.8.10 "python" has been detected Adding ESP-IDF tools to PATH... Using Python interpreter in /opt/esp/python_env/idf4.3_py3.8_env/bin/python Checking if Python packages are up to date... Python requirements from /opt/esp/idf/requirements.txt are satisfied. Added the following directories to PATH: /opt/esp/idf/components/esptool_py/esptool /opt/esp/idf/components/espcoredump /opt/esp/idf/components/partition_table /opt/esp/idf/components/app_update Done! You can now compile ESP-IDF projects. Go to the project directory and run: ` idf.py build` npm version is 9.6.4 node version is v16.19.1 To build the web application, run: pushd components/wifi-manager/webapp/ && npm rebuild node-sass && npm run-script build && popd `To run size statistics, run:` `puncover/runner.py --gcc_tools_base /opt/esp/tools/xtensa-esp32-elf/esp-2021r2-8.4.0/xtensa-esp32-elf/bin/xtensa-esp32-elf- --elf ./build/recovery.elf --build_dir build --src_root .` root@2587c3f5afd2:/# cd workspace/squeezelite-esp32/ root@2587c3f5afd2:/workspace/squeezelite-esp32# idf.py build Executing action: all (aliases: build) Running cmake in directory /workspace/squeezelite-esp32/build Executing "cmake -G Ninja -DPYTHON_DEPS_CHECKED=1 -DESP_PLATFORM=1 -DIDF_TARGET=esp32 -DCCACHE_ENABLE=1 /workspace/squeezelite-esp32"... -- Found Git: /usr/bin/git (found version "2.25.1") -- Component directory /opt/esp/idf/components/esp_phy does not contain a CMakeLists.txt file. No component will be added -- Component directory /opt/esp/idf/components/ieee802154 does not contain a CMakeLists.txt file. No component will be added -- Component directory /opt/esp/idf/components/openthread does not contain a CMakeLists.txt file. No component will be added -- ccache will be used for faster recompilation -- The C compiler identification is GNU 8.4.0 -- The CXX compiler identification is GNU 8.4.0 -- The ASM compiler identification is GNU -- Found assembler: /opt/esp/tools/xtensa-esp32-elf/esp-2021r2-8.4.0/xtensa-esp32-elf/bin/xtensa-esp32-elf-gcc -- Check for working C compiler: /opt/esp/tools/xtensa-esp32-elf/esp-2021r2-8.4.0/xtensa-esp32-elf/bin/xtensa-esp32-elf-gcc -- Check for working C compiler: /opt/esp/tools/xtensa-esp32-elf/esp-2021r2-8.4.0/xtensa-esp32-elf/bin/xtensa-esp32-elf-gcc -- works -- Detecting C compiler ABI info -- Detecting C compiler ABI info - done -- Detecting C compile features -- Detecting C compile features - done -- Check for working CXX compiler: /opt/esp/tools/xtensa-esp32-elf/esp-2021r2-8.4.0/xtensa-esp32-elf/bin/xtensa-esp32-elf-g++ -- Check for working CXX compiler: /opt/esp/tools/xtensa-esp32-elf/esp-2021r2-8.4.0/xtensa-esp32-elf/bin/xtensa-esp32-elf-g++ -- works -- Detecting CXX compiler ABI info -- Detecting CXX compiler ABI info - done -- Detecting CXX compile features -- Detecting CXX compile features - done -- Building ESP-IDF components for target esp32 -- Project sdkconfig file /workspace/squeezelite-esp32/sdkconfig Loading defaults file /workspace/squeezelite-esp32/sdkconfig.defaults... -- Found PythonInterp: /opt/esp/python_env/idf4.3_py3.8_env/bin/python (found version "3.8.10") -- Found Perl: /usr/bin/perl (found version "5.30.0") -- App "recovery" version: local.500.cmake-master -- Adding linker script /opt/esp/idf/components/esp_rom/esp32/ld/esp32.rom.ld -- Adding linker script /opt/esp/idf/components/esp_rom/esp32/ld/esp32.rom.api.ld -- Adding linker script /opt/esp/idf/components/esp_rom/esp32/ld/esp32.rom.libgcc.ld -- Adding linker script /opt/esp/idf/components/esp_rom/esp32/ld/esp32.rom.newlib-data.ld -- Adding linker script /opt/esp/idf/components/esp_rom/esp32/ld/esp32.rom.syscalls.ld -- Adding linker script /workspace/squeezelite-esp32/build/esp-idf/esp32/esp32_out.ld -- Adding linker script /opt/esp/idf/components/esp32/ld/esp32.project.ld.in -- Adding linker script /opt/esp/idf/components/esp32/ld/esp32.peripherals.ld -- Websocket transport is disabled so the esp_websocket_client component will not be built ******************* local.500.cmake-master -- Bell options: -- Disable all codecs: ON -- Disable built-in audio sinks: ON -- Use Vorbis float version: OFF -- Use cJSON only: ON -- Disable Fmt: ON -- Disable Mqtt: ON -- Disable Regex: ON -- Disable Web server: ON -- Found Nanopb: /workspace/squeezelite-esp32/components/spotify/cspot/bell/external/nanopb /workspace/squeezelite-esp32/components/spotify/cspot/bell/external/nanopb -- Using external Vorbis codec idf::codecs -- !! overriding esp32/i2s.cesp32/i2s_hal.c !! -- CAREFUL, LIBRARIES STRIPPING FROM DUPLICATED COMPONENTS DEPENDS ON THIS BEING REBUILD ******************* local.500.cmake-master -- Components: _override app_recovery app_squeezelite app_trace app_update asio audio bootloader bootloader_support bt cbor cmock coap codecs console cxx display driver driver_bt efuse esp-dsp esp-tls esp32 esp_adc_cal esp_common esp_eth esp_event esp_gdbstub esp_hid esp_http_client esp_http_server esp_https_ota esp_https_server esp_hw_support esp_ipc esp_local_ctrl esp_netif esp_pm esp_ringbuf esp_rom esp_serial_slave_link esp_system esp_timer esp_websocket_client esp_wifi espcoredump esptool_py expat fatfs freemodbus freertos hal heap idf_test jsmn json libsodium log lwip main mbedtls mdns mqtt newlib nghttp nvs_flash openssl partition_table perfmon platform_config platform_console protobuf-c protocomm pthread raop sdmmc services soc spi_flash spiffs spotify squeezelite squeezelite-ota targets tcp_transport tcpip_adapter telnet tinyusb tjpgd tools ulp unity vfs wear_levelling wifi-manager wifi_provisioning wpa_supplicant xtensa -- Component paths: /workspace/squeezelite-esp32/components/_override /workspace/squeezelite-esp32/components/platform_console/app_recovery /workspace/squeezelite-esp32/components/platform_console/app_squeezelite /opt/esp/idf/components/app_trace /opt/esp/idf/components/app_update /opt/esp/idf/components/asio /workspace/squeezelite-esp32/components/audio /opt/esp/idf/components/bootloader /opt/esp/idf/components/bootloader_support /opt/esp/idf/components/bt /opt/esp/idf/components/cbor /opt/esp/idf/components/cmock /opt/esp/idf/components/coap /workspace/squeezelite-esp32/components/codecs /opt/esp/idf/components/console /opt/esp/idf/components/cxx /workspace/squeezelite-esp32/components/display /opt/esp/idf/components/driver /workspace/squeezelite-esp32/components/driver_bt /opt/esp/idf/components/efuse /workspace/squeezelite-esp32/components/esp-dsp /opt/esp/idf/components/esp-tls /opt/esp/idf/components/esp32 /opt/esp/idf/components/esp_adc_cal /opt/esp/idf/components/esp_common /opt/esp/idf/components/esp_eth /opt/esp/idf/components/esp_event /opt/esp/idf/components/esp_gdbstub /opt/esp/idf/components/esp_hid /opt/esp/idf/components/esp_http_client /workspace/squeezelite-esp32/components/esp_http_server /opt/esp/idf/components/esp_https_ota /opt/esp/idf/components/esp_https_server /opt/esp/idf/components/esp_hw_support /opt/esp/idf/components/esp_ipc /opt/esp/idf/components/esp_local_ctrl /opt/esp/idf/components/esp_netif /opt/esp/idf/components/esp_pm /opt/esp/idf/components/esp_ringbuf /opt/esp/idf/components/esp_rom /opt/esp/idf/components/esp_serial_slave_link /opt/esp/idf/components/esp_system /opt/esp/idf/components/esp_timer /opt/esp/idf/components/esp_websocket_client /opt/esp/idf/components/esp_wifi /opt/esp/idf/components/espcoredump /opt/esp/idf/components/esptool_py /opt/esp/idf/components/expat /opt/esp/idf/components/fatfs /opt/esp/idf/components/freemodbus /opt/esp/idf/components/freertos /opt/esp/idf/components/hal /opt/esp/idf/components/heap /opt/esp/idf/components/idf_test /opt/esp/idf/components/jsmn /opt/esp/idf/components/json /opt/esp/idf/components/libsodium /opt/esp/idf/components/log /opt/esp/idf/components/lwip /workspace/squeezelite-esp32/main /opt/esp/idf/components/mbedtls /opt/esp/idf/components/mdns /opt/esp/idf/components/mqtt /opt/esp/idf/components/newlib /opt/esp/idf/components/nghttp /opt/esp/idf/components/nvs_flash /opt/esp/idf/components/openssl /opt/esp/idf/components/partition_table /opt/esp/idf/components/perfmon /workspace/squeezelite-esp32/components/platform_config /workspace/squeezelite-esp32/components/platform_console /opt/esp/idf/components/protobuf-c /opt/esp/idf/components/protocomm /opt/esp/idf/components/pthread /workspace/squeezelite-esp32/components/raop /opt/esp/idf/components/sdmmc /workspace/squeezelite-esp32/components/services /opt/esp/idf/components/soc /opt/esp/idf/components/spi_flash /opt/esp/idf/components/spiffs /workspace/squeezelite-esp32/components/spotify /workspace/squeezelite-esp32/components/squeezelite /workspace/squeezelite-esp32/components/squeezelite-ota /workspace/squeezelite-esp32/components/targets /opt/esp/idf/components/tcp_transport /opt/esp/idf/components/tcpip_adapter /workspace/squeezelite-esp32/components/telnet /opt/esp/idf/components/tinyusb /workspace/squeezelite-esp32/components/tjpgd /workspace/squeezelite-esp32/components/tools /opt/esp/idf/components/ulp /opt/esp/idf/components/unity /opt/esp/idf/components/vfs /opt/esp/idf/components/wear_levelling /workspace/squeezelite-esp32/components/wifi-manager /opt/esp/idf/components/wifi_provisioning /opt/esp/idf/components/wpa_supplicant /opt/esp/idf/components/xtensa -- Configuring done -- Generating done -- Build files have been written to: /workspace/squeezelite-esp32/build Running ninja in directory /workspace/squeezelite-esp32/build Executing "ninja all"... [3/1515] Generating nanopb/generator/proto/nanopb_pb2.py FAILED: esp-idf/spotify/cspot/nanopb/generator/proto/nanopb_pb2.py cd /workspace/squeezelite-esp32/build/esp-idf/spotify/cspot && /workspace/squeezelite-esp32/components/spotify/cspot/bell/external/nanopb/generator/protoc -I/workspace/squeezelite-esp32/build/esp-idf/spotify/cspot/nanopb/generator/proto --python_out=/workspace/squeezelite-esp32/build/esp-idf/spotify/cspot/nanopb/generator/proto /workspace/squeezelite-esp32/build/esp-idf/spotify/cspot/nanopb/generator/proto/nanopb.proto /bin/sh: 1: /workspace/squeezelite-esp32/components/spotify/cspot/bell/external/nanopb/generator/protoc: Permission denied [4/1515] cd /workspace/squeezelite-esp32/build && /opt/esp/tools/cmake/3.16.4/bin/cmake -P /workspace/squeezelite-esp32/generate_debug_scripts.cmake Generating debug script files [7/1515] Generating ../../partition_table/partition-table.bin Partition table binary generated. Contents: ******************************************************************************* # ESP-IDF Partition Table # Name, Type, SubType, Offset, Size, Flags nvs,data,nvs,0x9000,16K, otadata,data,ota,0xd000,8K, phy_init,data,phy,0xf000,4K, recovery,app,factory,0x10000,1280K, ota_0,app,ota_0,0x150000,2688K, settings,data,nvs,0x3f0000,64K, ******************************************************************************* ninja: build stopped: subcommand failed. ninja failed with exit code 1 root@2587c3f5afd2:/workspace/squeezelite-esp32#

sle118 commented 1 year ago

Here's your problem: /workspace/squeezelite-esp32/components/spotify/cspot/bell/external/nanopb/generator/protoc: Permission denied

you have to chmod the protoc executables inside of the interactive docker container, before calling idf.py build:

  chmod +x ./components/spotify/cspot/bell/external/nanopb/generator/protoc-gen-nanopb
  chmod +x ./components/spotify/cspot/bell/external/nanopb/generator/*.py
  chmod +x ./components/spotify/cspot/bell/external/nanopb/generator/*.py2
  chmod +x ./components/spotify/cspot/bell/external/nanopb/generator/proto/*.py

I'll see if we can automatically do this within the make file, but for now the make process doesn't properly address this.

jochen-rath commented 1 year ago

Thank you very much. Now it is working. Additionally I needed to do: chmod +x ./components/spotify/cspot/bell/external/nanopb/generator/protoc

sle118 commented 1 year ago

The following change will take care of resolving the issue going forward: https://github.com/sle118/squeezelite-esp32/commit/ed53fa21a73b7c3d8c8685101cbfad3374b5a3e0