You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Two years ago there was a header migration in #45410 to namespace all the headers in the include directory to include/zephyr, however the build-time generated headers are (still) not namespaced, i.e.:
app_version.h
cmake_intdef.h
core-isa-dM.h
devicetree_generated.h
driver-validation.h
kobj-types-enum.h
linker-kobject-prebuilt-data.h
mcuboot_version.h
offsets.h
otype-to-size.h
otype-to-str.h
strerror_table.h
strsignal_table.h
syscall_list.h
version.h
zsr.h
Kconfig headers (autoconf.h)
and all the syscalls headers
Generated headers, especially version.h, can easily conflict with other libraries & user applications. This RFC is proposing to namespace the generated headers into the zephyr/ directory as well.
Problem description
Some of the generated headers have pretty generic names, i.e.: version.h, and can potentially conflict with other library / user applications. Ideally, all Zephyr's headers, in-tree or generated, should be namespaced with zephyr/.
Proposed change
The generated headers previously in build/zephyr/include/generated/ will now be placed in build/zephyr/include/generated/zephyr/, Zephyr sources that are including these headers will be updated accordingly, i.e.:
The task involves modifying CMake files and scripts to output generated headers in the include/generated/zephyr/ directory, updating dependencies on these headers accordingly, changing include paths for in-tree sources, creating a compatibility Kconfig for uninterrupted user application builds, and updating migration and release notes with details on this change and its mitigation steps.
Proposed change (Detailed)
Modify CMake files and scripts to output headers to the include/generated/zephyr/ directory
Update CMake files and scripts to depend on headers in the include/generated/zephyr/ directory
Update in-tree sources' include paths to zephyr/<header.h>
Create a compatibility Kconfig so that user applications will still continue to build
Update the migration/release notes about the change, and steps to mitigate
Dependencies
External libraries and user applications can be affected, in that case they may use the migration script.
Introduction
Two years ago there was a header migration in #45410 to namespace all the headers in the
include
directory toinclude/zephyr
, however the build-time generated headers are (still) not namespaced, i.e.:app_version.h
cmake_intdef.h
core-isa-dM.h
devicetree_generated.h
driver-validation.h
kobj-types-enum.h
linker-kobject-prebuilt-data.h
mcuboot_version.h
offsets.h
otype-to-size.h
otype-to-str.h
strerror_table.h
strsignal_table.h
syscall_list.h
version.h
zsr.h
autoconf.h
)Generated headers, especially
version.h
, can easily conflict with other libraries & user applications. This RFC is proposing to namespace the generated headers into thezephyr/
directory as well.Problem description
Some of the generated headers have pretty generic names, i.e.:
version.h
, and can potentially conflict with other library / user applications. Ideally, all Zephyr's headers, in-tree or generated, should be namespaced withzephyr/
.Proposed change
The generated headers previously in
build/zephyr/include/generated/
will now be placed inbuild/zephyr/include/generated/zephyr/
, Zephyr sources that are including these headers will be updated accordingly, i.e.:zephyr/kernel/banner.c
Line 10 in 114548e
will be changed to
Detailed RFC
The task involves modifying CMake files and scripts to output generated headers in the
include/generated/zephyr/
directory, updating dependencies on these headers accordingly, changing include paths for in-tree sources, creating a compatibility Kconfig for uninterrupted user application builds, and updating migration and release notes with details on this change and its mitigation steps.Proposed change (Detailed)
include/generated/zephyr/
directoryinclude/generated/zephyr/
directoryzephyr/<header.h>
Dependencies
External libraries and user applications can be affected, in that case they may use the migration script.
version.h
- take 1 thesofproject/sof#8459version.h
percepio/percepio#5version.h
percepio/percepio#6version.h
percepio#10Concerns and Unresolved Questions
Can't think of any
Alternatives
Rely on all external libaries & user applications to namespace their header so that no conflicts can occur.
The text was updated successfully, but these errors were encountered: