Skip to content

Docker: global build directory doesn't match CMake convention #122

@chopikus

Description

@chopikus

CMake expects 1-to-1 mapping of a source directory to the build directory. Since our build directory is constant, some errors are possible:

-- west build: generating a build system
CMake Error: The source "/zephyr/samples/basic/blinky/CMakeLists.txt" does not match the source "/workspace/CMakeLists.txt" used to generate cache.  Re-run cmake with a different source directory.
FATAL ERROR: command exited with status 1: /usr/bin/cmake -DWEST_PYTHON=//.venv/bin/python3 -B/build -GNinja -DBOARD=reel_board -S/zephyr/samples/basic/blinky

Command:

west build -p always -b nucleo_h753zi apps/pay

Right now, a user has to do rm -rf /build before building a different app to fix the issue.

Here are a few options to proceed with this:

  1. Keep everything as is
  2. Use per-app build directory, like /build/pay, /build/blinky. But then the flash and debug scripts have to know what path is zephyr.elf under.
  3. Add steps to west build to remove the build directory (not sure if that's possible)

Metadata

Metadata

Assignees

Labels

Type

No type

Projects

No projects

Milestone

No milestone

Relationships

None yet

Development

No branches or pull requests

Issue actions