-
Notifications
You must be signed in to change notification settings - Fork 304
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
[VSC-1409] Add check for missing compile_commands.json in IDF projects #1271
base: master
Are you sure you want to change the base?
[VSC-1409] Add check for missing compile_commands.json in IDF projects #1271
Conversation
Download the artifacts for this pull request: |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Few changes I consider would improve this PR
Hi @brianignacio5, thank you for the review! |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
LGTM
Hi @AndriiFilippov, PTAL |
Pull request has been marked as |
Hi @Fabricio-ESP, PTAL |
Pull request has been marked as |
5de3252
to
f96d071
Compare
The extension is properly detecting the missing file in the builds folder and running the reconfigure command. Tested on Windows and Linux. Side effect is that when opening a new project (from a example) the build folder does not exist yet, and the error notification will be triggered. Running the reconfigure command will generate the build for the ESP32 default target. If the user wants to change the target the build folder will need to recreated. If the user has set multiple configuration profiles and the build folder have other names than "build" the extension is showing the error that the compile_commands.json is missing, but they are properly saved on each build folder, so there is something there to detect the file on this scenario. |
a85d68b
to
c8a4e82
Compare
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
LGTM
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Tested on Windows, WSL and Linux.
Reconfigure command working as expected.
bf43756
to
0fa8e6c
Compare
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Rebase issues.
@@ -129,12 +127,6 @@ export class BuildTask { | |||
"-DPYTHON_DEPS_CHECKED=1", | |||
"-DESP_PLATFORM=1", | |||
]; | |||
} else if (useEqualSign) { |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
The rebase is removing changes from #1266 which are implemented in master.
Please update.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
These changes were intentional and are part of the commit Remove unnecessary validation - c8f9ec8
After some testing, I found out the implementation with "=" was unnecessary. After the changes we've made with the configuration settings. These commands are being run in the python env, so the behaviour is the same for all shells the "=" was added for some specific case Andrii found in the past with consecutive white spaces in the name.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I can't see the commit since it is lost maybe due to squash commits.
These commands are being run in the python env
? How ? where?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Hi @brianignacio5,
After spending quite some time on debugging the matter I can give a proper explanation:
I can't see the commit since it is lost maybe due to squash commits.
Unfortunately, yes. But the changes are the same as in this one 00c0620
These commands are being run in the python env ? How ? where?
Disregard this comment, I've made some bad assumptions. Here are my reason for removing the "=" from the commands:
-
The "=" was introduced in the following PR Fix compiler args for white spaces #1220
I've tested this part of functionality (with the code from this PR) and I was not able to reproduce the error Andrii found with multiple spaces in dev containers anymore. It seems adding the "=" was not the solution for it. Since this was the only reason we've added it in the first place, I think we can safely remove it. -
To summary the changes in the PR you've mentioned Fix CMake args for esp-idf lower than 4.4 #1266 related to supporting v4.4:
For version 4.4 I was removing the "=" in the commands, but kept it for any version bigger than that, but again this implementation was not necessary as I've explained in the bullet point above. So removing this implementation won't affect the users with version 4.4 of esp-idf.
As a conclusion, I think adding the "=" was a mistake on my part and there is no reason to use it. I don't fully understand how this implementation solved Andrii's problem, since I've retested it without the "=" and I was not able to reproduce the issue even though I've followed the same steps described by Andrii in his Jira task https://jira.espressif.com:8443/browse/VSC-1381
Create project with whitespaces in name "project-n am e" -> re-open in devcontainer -> try to build -> failed.
I think before merging this task @Fabricio-ESP should test the following scenarios once again just to make sure we are not missing anything:
- fix support for multiple sdkconfig files #1252
- [VSC-1409] Add check for missing compile_commands.json in IDF projects #1271
- Fix compiler args for white spaces #1220
What do you think?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I understand your logic but I think is better in the future to separate this into 2 PRs: 1) compile_commands.json work and 2) The removal of =
. When I see the changes I just thought of it as a regression because it changes code unrelated to the PR.
We can proceed testing it in this PR but then is better to add how is fixed in the PR description and steps to test.
I think the issue was an old CMake version (Please test with esp-idf v4.3.6) didn't support -S only -S= and it was reported by a customer, hence my remark to make sure this does work.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Hi @brianignacio5,
I agree with your vision of splitting PRs, but in this particular case there is one thing that I forgot to mention: which is that I've removed the "=" because there was an issue on this PR that Fabricio found and it was caused by the compiler argument "-B=".
Executing task: /home/fabricio/.espressif/python_env/idf5.3_py3.12_env/bin/python /home/fabricio/esp/v5.3.1/esp-idf/tools/idf.py -B=/home/fabricio/Workspace/WSL-Local/blink/build -DSDKCONFIG=/home/fabricio/Workspace/WSL-Local/blink/sdkconfig reconfigure
I will be updating the testing steps in the description.
- Removed helper function from logger/utils - Moved code in already existing event listener - Wrapped event listener with context.subscriptions.push() - Localized messages displayed to user
We don't need to use "=" in the commands anymore
0fa8e6c
to
00c0620
Compare
There is no situation in which we need "-G=Ninja"
Test building blink on Windows with blink using v5.3.1 and esp-idf 4.3.6 and build works fine. |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
LGTM
@radurentea |
Description
This pull request adds a new feature to improve the user experience when working with ESP-IDF projects in VS Code, particularly when using the Microsoft C/C++ extension.
Key changes:
compile_commands.json
file when opening an ESP-IDF project.For users using the Microsoft's C/C++
compile_commands.json
file is crucial for proper IntelliSense functionality in ESP-IDF projects.JIRA https://jira.espressif.com:8443/browse/VSC-1409
Type of change
Steps to test this pull request
compile_commands.json
file in itsbuild
directory.espIdf.idfReconfigureTask
command that generates thecompile_command.json
file inbuild
folder of the project.We should also test the following scenarios:
How has this been tested?
As described above
Test Configuration:
Checklist