-
Notifications
You must be signed in to change notification settings - Fork 122
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
IEP-1041: Parse Compile Commands File exception when using multiple esp-idf versions #835
Conversation
WalkthroughThe introduced change adds a condition in the IDFBuildConfiguration.java file to handle the scenario where a source file is not found. This adds a new exit point to the function, returning null when the source file is not found. Changes
TipsChat with CodeRabbit Bot (
|
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.
Review Status
Actionable comments generated: 0
Files selected for processing (1)
- bundles/com.espressif.idf.core/src/com/espressif/idf/core/build/IDFBuildConfiguration.java (1 hunks)
Additional comments (Suppressed): 2
bundles/com.espressif.idf.core/src/com/espressif/idf/core/build/IDFBuildConfiguration.java (2)
1248-1251: The new condition checks if
startIndex
is -1 and returns null if true. This introduces a new exit point in the function. Ensure that all calls to this function can handle a null return value and that this does not introduce null pointer exceptions elsewhere in the code.1252-1252: In the old hunk, if
startIndex
was -1,substring
would throw anIndexOutOfBoundsException
. The new hunk fixes this issue by adding a check forstartIndex == -1
before callingsubstring
. This is a good fix for preventing potential exceptions.
if (startIndex == -1) // source file still not found means it was part of another esp-idf | ||
{ | ||
return null; | ||
} |
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.
That meanspathtolookfor = getIdfToolsPath();
was not returning the correct IDF_PATH, I wonder why IDF_PATH is not configured correctly and what are the other issues it might cause!
If user switched to a different esp-idf version then IDF_PATH would have modified accordingly.
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 @kolipakakondal, the IDF_PATH from getIdfToolsPath() is correct, the issue happens because sourceFile is pointing to the different esp-idf. I think the sourceFile is provided based on the files from the build folder. This issue happens when we build the project with the different esp-idf version, then switch esp-idf and trying to build project again without cleaning build folder
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 Please check this Dependent areas need to be tested:
|
@sigmaaa hi ! Tested: Test: Repeat this one with custom build folder. LGTM 👍 |
Description
added one additional check which ignores the issue when switching esp-idf versions
Fixes # (IEP-1041)
Type of change
Please delete options that are not relevant.
How has this been tested?
Test 1:
Test Configuration:
Dependent components impacted by this PR:
Checklist
Summary by CodeRabbit