espressif / esp-idf

Espressif IoT Development Framework. Official development framework for Espressif SoCs.
Apache License 2.0
13.65k stars 7.29k forks source link

cannot find file: esp-idf/components/lwip/port/esp32/netif/dhcp_state.c (IDFGH-9297) #10678

Closed xobs closed 1 year ago

xobs commented 1 year ago

Answers checklist.

IDF version.

v5.1-dev-3153-g2707c95a5f

Operating System used.

Windows

How did you build your project?

Command line with idf.py

If you are using Windows, please specify command line type.

PowerShell

What is the expected behavior?

Projects should continue to build

What is the actual behavior?

During a compile, the following error was emitted:

-- Resolving GIT Version
-- GIT hash: 853203a-dirty
-- Configuring done
CMake Error at C:/Users/Sean/esp/esp-idf/tools/cmake/component.cmake:479 (add_library):
  Cannot find source file:

    C:/Users/Sean/esp/esp-idf/components/lwip/port/esp32/netif/dhcp_state.c

  Tried extensions .c .C .c++ .cc .cpp .cxx .cu .mpp .m .M .mm .ixx .cppm .h
  .hh .h++ .hm .hpp .hxx .in .txx .f .F .for .f77 .f90 .f95 .f03 .hip .ispc
Call Stack (most recent call first):
  C:/Users/Sean/esp/esp-idf/components/lwip/CMakeLists.txt:162 (idf_component_register)

CMake Error at C:/Users/Sean/esp/esp-idf/tools/cmake/component.cmake:479 (add_library):
  No SOURCES given to target: __idf_lwip
Call Stack (most recent call first):
  C:/Users/Sean/esp/esp-idf/components/lwip/CMakeLists.txt:162 (idf_component_register)

CMake Generate step failed.  Build files cannot be regenerated correctly.
cmake failed with exit code 1, output of the command is in the E:\Code\Farpatch\farpatch\build\log\idf_py_stderr_output_35924 and E:\Code\Farpatch\farpatch\build\log\idf_py_stdout_output_35924

Steps to reproduce.

  1. Attempt to build with the attached sdkconfig file sdkconfig.zip

Build or installation Logs.

> idf.py menuconfig
Executing action: menuconfig
Running cmake in directory C:\Users\Sean\esp\esp-idf\examples\network\network_tests\build
Executing "cmake -G Ninja -DPYTHON_DEPS_CHECKED=1 -DPYTHON=C:\Users\Sean\.espressif\python_env\idf5.1_py3.10_env\Scripts\python.exe -DESP_PLATFORM=1 -DIDF_TARGET=esp32s3 -DCCACHE_ENABLE=1 C:\Users\Sean\esp\esp-idf\examples\network\network_tests"...
-- Found Git: C:/Program Files/Git/cmd/git.exe (found version "2.35.2.windows.1")
-- Component directory C:/Users/Sean/esp/esp-idf/components/tinyusb 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 11.2.0
-- The CXX compiler identification is GNU 11.2.0
-- The ASM compiler identification is GNU
-- Found assembler: C:/Users/Sean/.espressif/tools/xtensa-esp32s3-elf/esp-2022r1-11.2.0/xtensa-esp32s3-elf/bin/xtensa-esp32s3-elf-gcc.exe
-- Detecting C compiler ABI info
-- Detecting C compiler ABI info - done
-- Check for working C compiler: C:/Users/Sean/.espressif/tools/xtensa-esp32s3-elf/esp-2022r1-11.2.0/xtensa-esp32s3-elf/bin/xtensa-esp32s3-elf-gcc.exe - skipped
-- Detecting C compile features
-- Detecting C compile features - done
-- Detecting CXX compiler ABI info
-- Detecting CXX compiler ABI info - done
-- Check for working CXX compiler: C:/Users/Sean/.espressif/tools/xtensa-esp32s3-elf/esp-2022r1-11.2.0/xtensa-esp32s3-elf/bin/xtensa-esp32s3-elf-g++.exe - skipped
-- Detecting CXX compile features
-- Detecting CXX compile features - done
-- Building ESP-IDF components for target esp32s3
-- Project sdkconfig file C:/Users/Sean/esp/esp-idf/examples/network/network_tests/sdkconfig
Compiler supported targets: xtensa-esp32s3-elf

-- Looking for sys/types.h
-- Looking for sys/types.h - found
-- Looking for stdint.h
-- Looking for stdint.h - found
-- Looking for stddef.h
-- Looking for stddef.h - found
-- Check size of time_t
-- Check size of time_t - done
-- Found Python3: C:/Users/Sean/.espressif/python_env/idf5.1_py3.10_env/Scripts/python.exe (found version "3.10.9") found components: Interpreter
-- Performing Test C_COMPILER_SUPPORTS_WFORMAT_SIGNEDNESS
-- Performing Test C_COMPILER_SUPPORTS_WFORMAT_SIGNEDNESS - Success
-- App "net_suite" version: v5.1-dev-3153-g2707c95a5f
-- Adding linker script C:/Users/Sean/esp/esp-idf/examples/network/network_tests/build/esp-idf/esp_system/ld/memory.ld
-- Adding linker script C:/Users/Sean/esp/esp-idf/components/esp_system/ld/esp32s3/sections.ld.in
-- Adding linker script C:/Users/Sean/esp/esp-idf/components/esp_rom/esp32s3/ld/esp32s3.rom.ld
-- Adding linker script C:/Users/Sean/esp/esp-idf/components/esp_rom/esp32s3/ld/esp32s3.rom.api.ld
-- Adding linker script C:/Users/Sean/esp/esp-idf/components/esp_rom/esp32s3/ld/esp32s3.rom.libgcc.ld
-- Adding linker script C:/Users/Sean/esp/esp-idf/components/esp_rom/esp32s3/ld/esp32s3.rom.newlib.ld
-- Adding linker script C:/Users/Sean/esp/esp-idf/components/esp_rom/esp32s3/ld/esp32s3.rom.version.ld
-- Adding linker script C:/Users/Sean/esp/esp-idf/components/soc/esp32s3/ld/esp32s3.peripherals.ld
-- Components: app_trace app_update bootloader bootloader_support bt cmock console cxx driver efuse esp-tls esp_adc esp_app_format 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_lcd esp_local_ctrl esp_netif esp_netif_stack esp_partition esp_phy esp_pm esp_psram esp_ringbuf esp_rom esp_system esp_timer esp_wifi espcoredump esptool_py fatfs freertos hal heap http_parser idf_test ieee802154 json log lwip main mbedtls mqtt newlib nvs_flash openthread partition_table perfmon protobuf-c protocomm pthread sdmmc soc spi_flash spiffs tcp_transport touch_element ulp unity usb vfs wear_levelling wifi_provisioning wpa_supplicant xtensa
-- Component paths: C:/Users/Sean/esp/esp-idf/components/app_trace C:/Users/Sean/esp/esp-idf/components/app_update C:/Users/Sean/esp/esp-idf/components/bootloader C:/Users/Sean/esp/esp-idf/components/bootloader_support C:/Users/Sean/esp/esp-idf/components/bt C:/Users/Sean/esp/esp-idf/components/cmock C:/Users/Sean/esp/esp-idf/components/console C:/Users/Sean/esp/esp-idf/components/cxx C:/Users/Sean/esp/esp-idf/components/driver C:/Users/Sean/esp/esp-idf/components/efuse C:/Users/Sean/esp/esp-idf/components/esp-tls C:/Users/Sean/esp/esp-idf/components/esp_adc C:/Users/Sean/esp/esp-idf/components/esp_app_format C:/Users/Sean/esp/esp-idf/components/esp_common C:/Users/Sean/esp/esp-idf/components/esp_eth C:/Users/Sean/esp/esp-idf/components/esp_event C:/Users/Sean/esp/esp-idf/components/esp_gdbstub C:/Users/Sean/esp/esp-idf/components/esp_hid C:/Users/Sean/esp/esp-idf/components/esp_http_client C:/Users/Sean/esp/esp-idf/components/esp_http_server C:/Users/Sean/esp/esp-idf/components/esp_https_ota C:/Users/Sean/esp/esp-idf/components/esp_https_server C:/Users/Sean/esp/esp-idf/components/esp_hw_support C:/Users/Sean/esp/esp-idf/components/esp_lcd C:/Users/Sean/esp/esp-idf/components/esp_local_ctrl C:/Users/Sean/esp/esp-idf/components/esp_netif C:/Users/Sean/esp/esp-idf/components/esp_netif_stack C:/Users/Sean/esp/esp-idf/components/esp_partition C:/Users/Sean/esp/esp-idf/components/esp_phy C:/Users/Sean/esp/esp-idf/components/esp_pm C:/Users/Sean/esp/esp-idf/components/esp_psram C:/Users/Sean/esp/esp-idf/components/esp_ringbuf C:/Users/Sean/esp/esp-idf/components/esp_rom C:/Users/Sean/esp/esp-idf/components/esp_system C:/Users/Sean/esp/esp-idf/components/esp_timer C:/Users/Sean/esp/esp-idf/components/esp_wifi C:/Users/Sean/esp/esp-idf/components/espcoredump C:/Users/Sean/esp/esp-idf/components/esptool_py C:/Users/Sean/esp/esp-idf/components/fatfs C:/Users/Sean/esp/esp-idf/components/freertos C:/Users/Sean/esp/esp-idf/components/hal C:/Users/Sean/esp/esp-idf/components/heap C:/Users/Sean/esp/esp-idf/components/http_parser C:/Users/Sean/esp/esp-idf/components/idf_test C:/Users/Sean/esp/esp-idf/components/ieee802154 C:/Users/Sean/esp/esp-idf/components/json C:/Users/Sean/esp/esp-idf/components/log C:/Users/Sean/esp/esp-idf/components/lwip C:/Users/Sean/esp/esp-idf/examples/network/network_tests/main C:/Users/Sean/esp/esp-idf/components/mbedtls C:/Users/Sean/esp/esp-idf/components/mqtt C:/Users/Sean/esp/esp-idf/components/newlib C:/Users/Sean/esp/esp-idf/components/nvs_flash C:/Users/Sean/esp/esp-idf/components/openthread C:/Users/Sean/esp/esp-idf/components/partition_table C:/Users/Sean/esp/esp-idf/components/perfmon C:/Users/Sean/esp/esp-idf/components/protobuf-c C:/Users/Sean/esp/esp-idf/components/protocomm C:/Users/Sean/esp/esp-idf/components/pthread C:/Users/Sean/esp/esp-idf/components/sdmmc C:/Users/Sean/esp/esp-idf/components/soc C:/Users/Sean/esp/esp-idf/components/spi_flash C:/Users/Sean/esp/esp-idf/components/spiffs C:/Users/Sean/esp/esp-idf/components/tcp_transport C:/Users/Sean/esp/esp-idf/components/touch_element C:/Users/Sean/esp/esp-idf/components/ulp C:/Users/Sean/esp/esp-idf/components/unity C:/Users/Sean/esp/esp-idf/components/usb C:/Users/Sean/esp/esp-idf/components/vfs C:/Users/Sean/esp/esp-idf/components/wear_levelling C:/Users/Sean/esp/esp-idf/components/wifi_provisioning C:/Users/Sean/esp/esp-idf/components/wpa_supplicant C:/Users/Sean/esp/esp-idf/components/xtensa
-- Configuring done
CMake Error at C:/Users/Sean/esp/esp-idf/tools/cmake/component.cmake:479 (add_library):
  Cannot find source file:

    C:/Users/Sean/esp/esp-idf/components/lwip/port/esp32/netif/dhcp_state.c

  Tried extensions .c .C .c++ .cc .cpp .cxx .cu .mpp .m .M .mm .ixx .cppm .h
  .hh .h++ .hm .hpp .hxx .in .txx .f .F .for .f77 .f90 .f95 .f03 .hip .ispc
Call Stack (most recent call first):
  C:/Users/Sean/esp/esp-idf/components/lwip/CMakeLists.txt:162 (idf_component_register)

CMake Error at C:/Users/Sean/esp/esp-idf/tools/cmake/component.cmake:479 (add_library):
  No SOURCES given to target: __idf_lwip
Call Stack (most recent call first):
  C:/Users/Sean/esp/esp-idf/components/lwip/CMakeLists.txt:162 (idf_component_register)

CMake Generate step failed.  Build files cannot be regenerated correctly.
cmake failed with exit code 1
>


### More Information.

This just started in last night's nightly build, which means it was caused by a merge yesterday.
xobs commented 1 year ago

To add: The sdkconfig is from an existing project -- specifically, from https://github.com/farpatch/farpatch/blob/main/sdkconfig.defaults

For testing, I copied this sdkconfig to examples/network/network_tests and ran idf.py build

xobs commented 1 year ago

This appears to be caused when CONFIG_LWIP_DHCP_RESTORE_LAST_IP is enabled.

The following patch works around the issue:

diff --git a/components/lwip/CMakeLists.txt b/components/lwip/CMakeLists.txt
index 22ceb1de84..671da81e20 100644
--- a/components/lwip/CMakeLists.txt
+++ b/components/lwip/CMakeLists.txt
@@ -156,7 +156,7 @@ if(CONFIG_LWIP_DHCPS)
 endif()

 if(CONFIG_LWIP_DHCP_RESTORE_LAST_IP)
-    list(APPEND srcs "port/esp32/netif/dhcp_state.c")
+    list(APPEND srcs "port/esp32xx/netif/dhcp_state.c")
 endif()

 idf_component_register(SRCS "${srcs}"
david-cermak commented 1 year ago

@xobs Thanks for your report and finding the rootcase -- Please feel free to post your fix in https://github.com/espressif/esp-idf/pulls

An action point from our side is to extend our test configuration to cover this config CONFIG_LWIP_DHCP_RESTORE_LAST_IP as well

xobs commented 1 year ago

Thanks @david-cermak -- I opened #10690