zephyrproject-rtos/eclipse-plugin

Trying to resolve cmake build error=2, on build

pch-jp opened this issue · 3 comments

I can build from the command line via Cmake or west. I cannot build via "Build Project" in Eclipse.

Mac 10.15.7
Eclipse Version: 2020-09 (4.17.0) / Build id: 20200910-1200

Error Description:

Errors occurred during the build.
Errors running builder 'Zephyr Application Builder' on project 'cork-demo1'.
Error invoking CMake for project cork-demo1!
Cannot run program "cmake" (in directory "/Users/john.norair/repos/cork-demo1/build"): error=2, No such file or directory
Error invoking CMake for project cork-demo1!
Cannot run program "cmake" (in directory "/Users/john.norair/repos/cork-demo1/build"): error=2, No such file or directory

The directory is most certainly present and with permissions that allow operation from command line.

I saw a previous issue -- which was apparently resolved -- although the interim resolution was to use an older version of Eclipse CDT. I will attempt to install an older version, but I am reporting this issue nonetheless.

I observe the exact same behaviour. I can build from the command line using west, but cannot build in Eclipse.

MacOS 10.15.7
Eclipse Version: 2020-12 (4.18.0), Build id: 20201210-1552
Zephyr Project Development Support: 0.2.99.202009250453

Error description:

Errors occurred during the build.
Errors running builder 'Zephyr Application Builder' on project 'Test'.
Error invoking CMake for project Test!
Cannot run program "cmake" (in directory "/Users/username/eclipse-workspace/Test/build"): error=2, No such file or directory
Error invoking CMake for project Test!
Cannot run program "cmake" (in directory "/Users/username/eclipse-workspace/Test/build"): error=2, No such file or directory

One thing that might fix this issue (I don't remember exactly), is launching Eclipse from the command line. This will preserve environment variables from the shell into the Eclipse instance.

Try this from your shell that has the necessary Zephyr environment vars.
~> open [path-to-eclipse]

Indeed, starting eclipse from a shell that has sourced the Zephyr environment variables fixed the problem.