espressif / idf-component-manager

Tool for installing ESP-IDF components
https://components.espressif.com/
Apache License 2.0
44 stars 16 forks source link

Compile Fails: Some components (espressif/fmt) in the "managed_components" directory were modified (PACMAN-553) #18

Closed sukesh-ak closed 1 year ago

sukesh-ak commented 1 year ago

Answers checklist.

IDF version.

v5.0-rc1

Operating System used.

Linux

How did you build your project?

Command line with idf.py

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

None

What is the expected behavior?

Compile and build without issues like it does on Windows.

What is the actual behavior?

Works on Windows. Fails on Linux/Mac.

Steps to reproduce.

# Clone recursive
git clone --recursive https://github.com/sukesh-ak/ESP32-TUX
cd ESP32-TUX

# Select the device through menuconfig
idf.py menuconfig

# Build and error shows up
idf.py build
Processing 2 dependencies:
CMake Error at /home/ubuntudev/esp/esp-idf/tools/cmake/build.cmake:519 (message):
  ERROR:

          Some components (espressif/fmt) in the "managed_components" directory were modified         on the disk since the last run of the CMake. Content of this directory is managed automatically.

          If you want to keep the changes, you can move the directory with the component to the "components"         directory of your project.

          I.E. for "espressif__fmt" run:
          mv /home/ubuntudev/github/ESP32-TUX/managed_components/espressif__fmt /home/ubuntudev/github/ESP32-TUX/components/espressif__fmt

          Or, if you want to discard the changes remove the ".component_hash" file from the component's directory.

          I.E. for "espressif__fmt" run:
          rm /home/ubuntudev/github/ESP32-TUX/managed_components/espressif__fmt/.component_hash

Call Stack (most recent call first):
  /home/ubuntudev/esp/esp-idf/tools/cmake/project.cmake:440 (idf_build_process)
  CMakeLists.txt:28 (project)

[2/2] idf (5.0.0)-- Configuring incomplete, errors occurred!

Though the error says, some changes were done but no changes were done. Also it works fine on Windows and looking at the error details, sounds like a known issue.

Build or installation Logs.

CMake Error at /home/ubuntudev/esp/esp-idf/tools/cmake/build.cmake:519 (message):
  ERROR:

          Some components (espressif/fmt) in the "managed_components" directory were modified         on the disk since the last run of the CMake. Content of this directory is managed automatically.

          If you want to keep the changes, you can move the directory with the component to the "components"         directory of your project.

          I.E. for "espressif__fmt" run:
          mv /home/ubuntudev/github/ESP32-TUX/managed_components/espressif__fmt /home/ubuntudev/github/ESP32-TUX/components/espressif__fmt

          Or, if you want to discard the changes remove the ".component_hash" file from the component's directory.

          I.E. for "espressif__fmt" run:
          rm /home/ubuntudev/github/ESP32-TUX/managed_components/espressif__fmt/.component_hash

Call Stack (most recent call first):
  /home/ubuntudev/esp/esp-idf/tools/cmake/project.cmake:440 (idf_build_process)
  CMakeLists.txt:28 (project)

ninja: error: rebuilding 'build.ninja': subcommand failed
cat: and: No such file or directory
[0/1] Re-running CMake...
-- Component directory /home/ubuntudev/github/ESP32-TUX/components/ConfigBase does not contain a CMakeLists.txt file. No component will be added
-- Building ESP-IDF components for target esp32
Processing 2 dependencies:
[1/2] espressif/fmt (9.1.0)
[2/2] idf (5.0.0)
-- Configuring incomplete, errors occurred!
See also "/home/ubuntudev/github/ESP32-TUX/build/CMakeFiles/CMakeOutput.log".
FAILED: build.ninja
/home/ubuntudev/.espressif/tools/cmake/3.24.0/bin/cmake --regenerate-during-build -S/home/ubuntudev/github/ESP32-TUX -B/home/ubuntudev/github/ESP32-TUX/buildCMake Error at /home/ubuntudev/esp/esp-idf/tools/cmake/build.cmake:519 (message):
  ERROR:

          Some components (espressif/fmt) in the "managed_components" directory were modified         on the disk since the last run of the CMake. Content of this directory is managed automatically.

          If you want to keep the changes, you can move the directory with the component to the "components"         directory of your project.

          I.E. for "espressif__fmt" run:
          mv /home/ubuntudev/github/ESP32-TUX/managed_components/espressif__fmt /home/ubuntudev/github/ESP32-TUX/components/espressif__fmt

          Or, if you want to discard the changes remove the ".component_hash" file from the component's directory.

          I.E. for "espressif__fmt" run:
          rm /home/ubuntudev/github/ESP32-TUX/managed_components/espressif__fmt/.component_hash

Call Stack (most recent call first):
  /home/ubuntudev/esp/esp-idf/tools/cmake/project.cmake:440 (idf_build_process)
  CMakeLists.txt:28 (project)

ninja: error: rebuilding 'build.ninja': subcommand failed
cat: and: No such file or directory
[0/1] Re-running CMake...
-- Component directory /home/ubuntudev/github/ESP32-TUX/components/ConfigBase does not contain a CMakeLists.txt file. No component will be added
-- Building ESP-IDF components for target esp32
Processing 2 dependencies:
[1/2] espressif/fmt (9.1.0)
[2/2] idf (5.0.0)
-- Configuring incomplete, errors occurred!
See also "/home/ubuntudev/github/ESP32-TUX/build/CMakeFiles/CMakeOutput.log".
FAILED: build.ninja
/home/ubuntudev/.espressif/tools/cmake/3.24.0/bin/cmake --regenerate-during-build -S/home/ubuntudev/github/ESP32-TUX -B/home/ubuntudev/github/ESP32-TUX/build

More Information.

Here is the working version with demo on windows. https://asciinema.org/a/549415

After idf.py menuconfig, if I manually delete the folder rm -rf managed_components it compiles again.

managed_components folder is already in .gitignore so I am guessing its created during idf.py menuconfig stage.

kumekay commented 1 year ago

Hello @sukesh-ak,

I noticed that your issue seems to be similar to the one discussed in issue !15. We are currently working on a solution.

As a temporary workaround for ESP-IDF 5.0, you may try downgrading idf-component-manager to version 1.1.4. To do this, please run the following command within your ESP-IDF environment (after running export.ps1):

pip install idf-component-manager==1.1.4

I hope this helps.

sukesh-ak commented 1 year ago

Thanks. I looked into issues on IDF repo so didn’t see this.

It compiles after deleting that folder rm -rf managed_components.

I am using Windows so for now its ok. Some of the people who are using my project reported this issue so reported it here.

This is the project repo https://github.com/sukesh-ak/ESP32-TUX

kumekay commented 1 year ago

@sukesh-ak A new bugfix release with the fix has been made available on PyPI. You can update to v1.2.2 either by running ./install.sh from the ESP-IDF directory or by running pip install -U idf-component-manager within the ESP-IDF environment (after sourcing export.sh).

If you need any help, please don't hesitate to reopen this issue.

sukesh-ak commented 1 year ago

@sukesh-ak A new bugfix release with the fix has been made available on PyPI. You can update to v1.2.2 either by running ./install.sh from the ESP-IDF directory or by running pip install -U idf-component-manager within the ESP-IDF environment (after sourcing export.sh).

If you need any help, please don't hesitate to reopen this issue.

Thank you for the update. Will test once I get a chance.