Skip to content

Conversation

@tejlmand
Copy link
Contributor

Sysbuild improvements following the application sysbuild entry point support introduced in #72923

tejlmand added 2 commits June 13, 2024 09:25
If not defined by caller, then set APPLICATION_BINARY_DIR to
CMAKE_CURRENT_BINARY_DIR. This is normally be done by
`find_package(Zephyr)`, but due to the indirection introduced with
fc1884e to allow applications to
provide their own sysbuild entry point, then the APPLICATION_BINARY_DIR
is unexpectedly set to the bin dir of the entry point.

Restore the old behavior so that APPLICATION_BINARY_DIR per default
again points to top-level sysbuild binary dir.

Signed-off-by: Torsten Rasmussen <[email protected]>
The sysbuild part of sysbuild/application creates a sysbuild/application
folder under top-level build dir. However, having a sysbuild folder at
this level means that tab completion for sysbuild pre-fixed build
targets will stop after completing just `sysbuild` and then show several
subfolders, making it hard to see important build targets, such as:
`ninja sysbuild_menuconfig`.

As `sysbuild/application` is just a folder name, then move it to
`_sysbuild` instead to avoid impacting tab completion for  ninja and
make.

Also strip the `application` part in the process, as the extra folder
doesn't provide any extra benefit, but is just one more level to enter
when browsing the build folder structure.

Signed-off-by: Torsten Rasmussen <[email protected]>
project(sysbuild_toplevel LANGUAGES)

if(NOT DEFINED APPLICATION_BINARY_DIR)
set(APPLICATION_BINARY_DIR ${CMAKE_CURRENT_BINARY_DIR} CACHE PATH "Application Binary Directory")
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Seems alright, but I wonder if changing:

set(APPLICATION_BINARY_DIR ${CMAKE_CURRENT_BINARY_DIR} CACHE PATH

to CMAKE_BINARY_DIR would've been a more general fix.

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I did consider that, but simply decided to go with same pattern as:

if(NOT DEFINED APPLICATION_BINARY_DIR)
set(APPLICATION_BINARY_DIR ${CMAKE_CURRENT_BINARY_DIR} CACHE PATH
"Application Binary Directory"
)
endif()

In the sysbuild case, then CMAKE_CURRENT_BINARY_DIR == CMAKE_BINARY_DIR when sysbuild is invoked as documented / through west build.

tejlmand added a commit to tejlmand/fw-nrfconnect-zephyr-1 that referenced this pull request Jun 13, 2024
… folder

If not defined by caller, then set APPLICATION_BINARY_DIR to
CMAKE_CURRENT_BINARY_DIR. This is normally be done by
`find_package(Zephyr)`, but due to the indirection introduced with
fc1884e to allow applications to
provide their own sysbuild entry point, then the APPLICATION_BINARY_DIR
is unexpectedly set to the bin dir of the entry point.

Restore the old behavior so that APPLICATION_BINARY_DIR per default
again points to top-level sysbuild binary dir.

Upstream PR: zephyrproject-rtos/zephyr#74210

Signed-off-by: Torsten Rasmussen <[email protected]>
tejlmand added a commit to tejlmand/fw-nrfconnect-zephyr-1 that referenced this pull request Jun 13, 2024
The sysbuild part of sysbuild/application creates a sysbuild/application
folder under top-level build dir. However, having a sysbuild folder at
this level means that tab completion for sysbuild pre-fixed build
targets will stop after completing just `sysbuild` and then show several
subfolders, making it hard to see important build targets, such as:
`ninja sysbuild_menuconfig`.

As `sysbuild/application` is just a folder name, then move it to
`_sysbuild` instead to avoid impacting tab completion for  ninja and
make.

Also strip the `application` part in the process, as the extra folder
doesn't provide any extra benefit, but is just one more level to enter
when browsing the build folder structure.

Upstream PR: zephyrproject-rtos/zephyr#74210

Signed-off-by: Torsten Rasmussen <[email protected]>
tejlmand added a commit to nrfconnect/sdk-zephyr that referenced this pull request Jun 14, 2024
… folder

If not defined by caller, then set APPLICATION_BINARY_DIR to
CMAKE_CURRENT_BINARY_DIR. This is normally be done by
`find_package(Zephyr)`, but due to the indirection introduced with
fc1884e to allow applications to
provide their own sysbuild entry point, then the APPLICATION_BINARY_DIR
is unexpectedly set to the bin dir of the entry point.

Restore the old behavior so that APPLICATION_BINARY_DIR per default
again points to top-level sysbuild binary dir.

Upstream PR: zephyrproject-rtos/zephyr#74210

Signed-off-by: Torsten Rasmussen <[email protected]>
tejlmand added a commit to nrfconnect/sdk-zephyr that referenced this pull request Jun 14, 2024
The sysbuild part of sysbuild/application creates a sysbuild/application
folder under top-level build dir. However, having a sysbuild folder at
this level means that tab completion for sysbuild pre-fixed build
targets will stop after completing just `sysbuild` and then show several
subfolders, making it hard to see important build targets, such as:
`ninja sysbuild_menuconfig`.

As `sysbuild/application` is just a folder name, then move it to
`_sysbuild` instead to avoid impacting tab completion for  ninja and
make.

Also strip the `application` part in the process, as the extra folder
doesn't provide any extra benefit, but is just one more level to enter
when browsing the build folder structure.

Upstream PR: zephyrproject-rtos/zephyr#74210

Signed-off-by: Torsten Rasmussen <[email protected]>
@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 Sysbuild improvements Sysbuild: fix annoyance with tab completion Jun 17, 2024
@carlescufi carlescufi added this to the v3.7.0 milestone Jun 17, 2024
@nashif nashif merged commit be2993b into zephyrproject-rtos:main Jun 17, 2024
anangl pushed a commit to anangl/sdk-zephyr that referenced this pull request Jul 1, 2024
… folder

If not defined by caller, then set APPLICATION_BINARY_DIR to
CMAKE_CURRENT_BINARY_DIR. This is normally be done by
`find_package(Zephyr)`, but due to the indirection introduced with
fc1884e to allow applications to
provide their own sysbuild entry point, then the APPLICATION_BINARY_DIR
is unexpectedly set to the bin dir of the entry point.

Restore the old behavior so that APPLICATION_BINARY_DIR per default
again points to top-level sysbuild binary dir.

Upstream PR: zephyrproject-rtos/zephyr#74210

Signed-off-by: Torsten Rasmussen <[email protected]>
(cherry picked from commit c17f1bc)
anangl pushed a commit to anangl/sdk-zephyr that referenced this pull request Jul 1, 2024
The sysbuild part of sysbuild/application creates a sysbuild/application
folder under top-level build dir. However, having a sysbuild folder at
this level means that tab completion for sysbuild pre-fixed build
targets will stop after completing just `sysbuild` and then show several
subfolders, making it hard to see important build targets, such as:
`ninja sysbuild_menuconfig`.

As `sysbuild/application` is just a folder name, then move it to
`_sysbuild` instead to avoid impacting tab completion for  ninja and
make.

Also strip the `application` part in the process, as the extra folder
doesn't provide any extra benefit, but is just one more level to enter
when browsing the build folder structure.

Upstream PR: zephyrproject-rtos/zephyr#74210

Signed-off-by: Torsten Rasmussen <[email protected]>
(cherry picked from commit e4277b0)
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

area: Build System area: Sysbuild 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.

6 participants