Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

[RFC] build: namespace generated headers with zephyr/ #73114

Closed
ycsin opened this issue May 22, 2024 · 1 comment
Closed

[RFC] build: namespace generated headers with zephyr/ #73114

ycsin opened this issue May 22, 2024 · 1 comment
Labels
area: Build System area: Userspace Userspace RFC Request For Comments: want input from the community

Comments

@ycsin
Copy link
Member

ycsin commented May 22, 2024

Introduction

Related to #41543.
Multiple work has been done to move the in-tree header files into the zephyr/ folder, however, the generated header files are still not namespaced with zephyr/, 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

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

To avoid potential conflicts with other library or user application headers due to generic names, introduce a zephyr/ namespace for all Zephyr-generated and in-tree headers. This can be achieved by modifying the CMake files and scripts responsible for generating these headers to include the zephyr/ prefix in their file names and updating the include paths in source files accordingly.

Additionally, ensure that the legacy include paths remains compatible during this transition and update the migration and release notes with details about this change and any necessary mitigation steps for users.

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

Concerns and Unresolved Questions

N/A

Alternatives

N/A

@ycsin ycsin added the RFC Request For Comments: want input from the community label May 22, 2024
@ycsin
Copy link
Member Author

ycsin commented May 23, 2024

Duplicate of #68035, updated the old one and close this

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
area: Build System area: Userspace Userspace RFC Request For Comments: want input from the community
Projects
Status: Done
Development

No branches or pull requests

1 participant