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

Generate and merge compile_commands.json fo ULP subprojects in the build system (IDFGH-10664) #11894

Closed
andylinpersonal opened this issue Jul 17, 2023 · 4 comments
Assignees
Labels
Resolution: NA Issue resolution is unavailable Status: Done Issue is done internally Type: Feature Request Feature request for IDF

Comments

@andylinpersonal
Copy link
Contributor

andylinpersonal commented Jul 17, 2023

Is your feature request related to a problem?

I would like to generate compile_commands.json for all ULP-RISC-V binaries to use auto-completion and code navigation (with clang or vscode intellisense LSPs).

Describe the solution you'd like.

esp-idf version: release/v5.1

  1. Add -DCMAKE_EXPORT_COMPILE_COMMANDS to the subproject created in the ${IDF_PATH}/components/ulp/project_include.cmake.
  2. Merge all generated compile_commands.json into a single file to the topmost level of cmake's workspace.

Currently, I've only done step.1 and merge all compile_commands.jsons to build/compile_commands.json in a launch.json task.

Describe alternatives you've considered.

No response

Additional context.

No response

@andylinpersonal andylinpersonal added the Type: Feature Request Feature request for IDF label Jul 17, 2023
@espressif-bot espressif-bot added the Status: Opened Issue is new label Jul 17, 2023
@github-actions github-actions bot changed the title Generate compile_commands.json for all ULP subprojects Generate compile_commands.json for all ULP subprojects (IDFGH-10664) Jul 17, 2023
@andylinpersonal andylinpersonal changed the title Generate compile_commands.json for all ULP subprojects (IDFGH-10664) Generate and merge compile_commands.json fo ULP subprojects in the build system (IDFGH-10664) Jul 18, 2023
@espressif-bot espressif-bot added Status: Done Issue is done internally Resolution: NA Issue resolution is unavailable and removed Status: Opened Issue is new labels Jun 12, 2024
@SoucheSouche
Copy link
Collaborator

0494dc4

@KaeLL
Copy link
Contributor

KaeLL commented Sep 4, 2024

It didn't address the merging part.
I run a jq oneliner to merge the bootloader and app compile_commands when I'm fiddling with the bootloader, but I'm sure it can be done in python and added to idf.py somewhere, optionally or otherwise, so that it can merge all compile_commands.json files.
@sudeep-mohanty thoughts?

@sudeep-mohanty
Copy link
Collaborator

@KaeLL Thanks for the suggestion. Indeed, there can several ways of merging the various compile_commands.json but if it's done as part of the build then it would be most seamless. In that regard, I will consult the tools team and check how best this can be done.

@andylinpersonal
Copy link
Contributor Author

By migrating to the newer version of clangd, which supports multiple compile_commands.json, can solve this problem and have better hinting and completion experience.

image

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Resolution: NA Issue resolution is unavailable Status: Done Issue is done internally Type: Feature Request Feature request for IDF
Projects
None yet
Development

No branches or pull requests

5 participants