apple / swift-matter-examples

An Embedded Swift Matter application running on ESP32-C6
https://apple.github.io/swift-matter-examples/tutorials/tutorial-table-of-contents/
Apache License 2.0
212 stars 16 forks source link

Error building Swift Matter smart light example for ESP32-C6 #6

Closed yaJannik closed 3 weeks ago

yaJannik commented 4 weeks ago

Hi there,

I'm facing issues while trying to build the smart light matter project. See details below:

System Information

Swift Version

Software Installed

Environment Setup

Problem Description

When attempting to build the project using idf.py build, I encounter the following error:

Executing action: all (aliases: build)
Running ninja in directory /Users/<usr>/Code/swift-matter-examples/smart-light/build
Executing "ninja all"...
ninja: error: 'esp-idf/main/CMakeFiles/__idf_main.dir/Main.swift.obj', needed by 'esp-idf/main/libmain.a', missing and no known rule to make it
ninja failed with exit code 1, output of the command is in the [...]smart-light/build/log/idf_py_stderr_output_22173 and [...]/smart-light/build/log/idf_py_stdout_output_22173

The logs do not provide further information.

Additional Information

Request

Any guidance or suggestions to resolve this build issue would be greatly appreciated.

Best regards, Jannik

yaJannik commented 3 weeks ago

I could identify the problem. My terminal targeted the wrong CMake version. I checked it with the which cmake command wich targeted the right version, but something was messed up on my side.

Anyways one thing bothers me: The CMakeLists.txt in the smart light example requires CMake version 3.5. The newest version is 3.30. It seems as if this check is never performed.

Can anybody verify this?

kubamracek commented 3 weeks ago

Ah, that's exactly where the problem is, thanks! The minimum CMake requires is 3.29, the "empty-template" and "led-blink" examples have that right, but it seems like the "smart-light" example needs to be updated.

kubamracek commented 3 weeks ago

@yaJannik does this resolve it? I think now you should get a clear error if you accidentally use an old CMake.

yaJannik commented 3 weeks ago

Yes, it solved the problem or more specific: It helps identifying the problem a lot.

Currently I'm stuck on another problem, but I'll open another issue later. The issue is closed. Thank you for the pull request.

kubamracek commented 3 weeks ago

Issues can be re-openened (it's GitHub's behavior to auto-close any issue that's mentioned in a merged PR). But yes, if it's a separate issue, best to open a new one.