Skip to content

Conversation

@tejlmand
Copy link
Contributor

west build can be invoked without specifying the source directory when being invoked from the source directory itself.
When using west build for incremental builds, then the build command will examine the CMake cache to determine the application dir by using the value of CMAKE_HOME_DIRECTORY.

With sysbuild, this leads to the wrong assumption that the sysbuild itself is the application to build.

Instead, have west build look for APP_DIR which points to the correct source dir when sysbuild is used. Use APPLICATION_SOURCE_DIR when APP_DIR is not set, as this indicates a no-sysbuild build.

Keep CMAKE_HOME_DIRECTORY behavior as last fallback mechanism.

`west build` can be invoked without specifying the source directory when
being invoked from the source directory itself.
When using `west build` for incremental builds, then the build command
will examine the CMake cache to determine the application dir by using
the value of CMAKE_HOME_DIRECTORY.

With sysbuild, this leads to the wrong assumption that the sysbuild
itself is the application to build.

Instead, have west build look for APP_DIR which points to the correct
source dir when sysbuild is used. Use APPLICATION_SOURCE_DIR when
APP_DIR is not set, as this indicates a no-sysbuild build.

Keep CMAKE_HOME_DIRECTORY behavior as last fallback mechanism.

Signed-off-by: Torsten Rasmussen <Torsten.Rasmussen@nordicsemi.no>
@tejlmand tejlmand requested review from 57300 and nordicjm June 13, 2024 11:20
@tejlmand
Copy link
Contributor Author

FYI @LuDuda

@zephyrbot zephyrbot added the area: West West utility label Jun 13, 2024
tejlmand added a commit to tejlmand/fw-nrfconnect-zephyr-1 that referenced this pull request Jun 13, 2024
`west build` can be invoked without specifying the source directory when
being invoked from the source directory itself.
When using `west build` for incremental builds, then the build command
will examine the CMake cache to determine the application dir by using
the value of CMAKE_HOME_DIRECTORY.

With sysbuild, this leads to the wrong assumption that the sysbuild
itself is the application to build.

Instead, have west build look for APP_DIR which points to the correct
source dir when sysbuild is used. Use APPLICATION_SOURCE_DIR when
APP_DIR is not set, as this indicates a no-sysbuild build.

Keep CMAKE_HOME_DIRECTORY behavior as last fallback mechanism.

Upstream PR: zephyrproject-rtos/zephyr#74230

Signed-off-by: Torsten Rasmussen <Torsten.Rasmussen@nordicsemi.no>
tejlmand added a commit to nrfconnect/sdk-zephyr that referenced this pull request Jun 13, 2024
`west build` can be invoked without specifying the source directory when
being invoked from the source directory itself.
When using `west build` for incremental builds, then the build command
will examine the CMake cache to determine the application dir by using
the value of CMAKE_HOME_DIRECTORY.

With sysbuild, this leads to the wrong assumption that the sysbuild
itself is the application to build.

Instead, have west build look for APP_DIR which points to the correct
source dir when sysbuild is used. Use APPLICATION_SOURCE_DIR when
APP_DIR is not set, as this indicates a no-sysbuild build.

Keep CMAKE_HOME_DIRECTORY behavior as last fallback mechanism.

Upstream PR: zephyrproject-rtos/zephyr#74230

Signed-off-by: Torsten Rasmussen <Torsten.Rasmussen@nordicsemi.no>
@carlescufi carlescufi added the bug The issue is a bug, or the PR is fixing a bug label Jun 17, 2024
@carlescufi carlescufi changed the title west: update build extension command to use APP_DIR west: Fix build extension command to use APP_DIR Jun 17, 2024
@carlescufi carlescufi added this to the v3.7.0 milestone Jun 17, 2024
@nashif nashif merged commit a9efb1d into zephyrproject-rtos:main Jun 17, 2024
anangl pushed a commit to anangl/sdk-zephyr that referenced this pull request Jul 1, 2024
`west build` can be invoked without specifying the source directory when
being invoked from the source directory itself.
When using `west build` for incremental builds, then the build command
will examine the CMake cache to determine the application dir by using
the value of CMAKE_HOME_DIRECTORY.

With sysbuild, this leads to the wrong assumption that the sysbuild
itself is the application to build.

Instead, have west build look for APP_DIR which points to the correct
source dir when sysbuild is used. Use APPLICATION_SOURCE_DIR when
APP_DIR is not set, as this indicates a no-sysbuild build.

Keep CMAKE_HOME_DIRECTORY behavior as last fallback mechanism.

Upstream PR: zephyrproject-rtos/zephyr#74230

Signed-off-by: Torsten Rasmussen <Torsten.Rasmussen@nordicsemi.no>
(cherry picked from commit 6439bfe)
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

area: West West utility bug The issue is a bug, or the PR is fixing a bug

Projects

None yet

Development

Successfully merging this pull request may close these issues.

7 participants