-
Notifications
You must be signed in to change notification settings - Fork 8.3k
Description
Introduction
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.hcmake_intdef.hcore-isa-dM.hdevicetree_generated.hdriver-validation.hkobj-types-enum.hlinker-kobject-prebuilt-data.hmcuboot_version.hoffsets.hotype-to-size.hotype-to-str.hstrerror_table.hstrsignal_table.hsyscall_list.hversion.hzsr.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.:
Line 10 in 114548e
| #include <version.h> |
will be changed to
#include <zephyr/version.h>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)
- 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.
Concerns 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.
Metadata
Metadata
Assignees
Labels
Type
Projects
Status
Status