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

Inconsistent/incorrect search results and resolution of includes (IEP-1124) #862

Open
ammaree opened this issue Dec 6, 2023 · 23 comments
Open

Comments

@ammaree
Copy link

ammaree commented Dec 6, 2023

I have been having hassles with the plugin over the last 4 months, most of which I have simply ignored or tried to work around, but it is now getting worse. Starting with Eclipse 2023-03/06/09 and with each version of the plugin, religiously updated, I am consistently getting incorrect resolution of definitions.

All my source code starts with the exact same #include "hal_config.h" to ensure the hardware and software platforms are completely defined. Within this header a specific hardware platform and firmware configuration is defined

After upgrading today to Eclipse 2023-12 and Plugin 2.11.1.202310270725 I am nog getting additional problems.
If I do a text search for #define appUSE_ACTUATORS Eclipse finds 11 occurrences but only lists 7 below for selection.
Screenshot 2023-12-06 at 14 54 31

If I use F3 (Find Declarations) it finds 10 and not 11 with the important one (hal_dk41.h) missing:

Screenshot 2023-12-06 at 14 49 12

To make things worse, the process of resolving headers either does not accurately parse the headers or symbols defined and/or does not assign the correct values. Following the chain from 1) the source code to 2) the top level header and then 3) the 2nd level header...
1: Source code:

Screenshot 2023-12-06 at 15 00 46

2: Selection of the correct HW platform header

Screenshot 2023-12-06 at 15 02 52

3: Definitions in the HW platform header

Screenshot 2023-12-06 at 15 04 20

I have COMPLETELY removed all traces of Eclipse and the IDF plugin (including all my project configuration files) multiple times, reinstalled Eclipse according to the web site, symptoms remained the same. The code compiles correctly and functions as expected so I am 100% sure that cMake and the preprocessor/compiler finds the correct headers, definitions and values.

Lastly, the following warning/error occurs consistently:

Screenshot 2023-12-06 at 08 40 15

Any suggestions?

@github-actions github-actions bot changed the title Inconsistent/incorrect search results and resolution of includes Inconsistent/incorrect search results and resolution of includes (IEP-1124) Dec 6, 2023
@sigmaaa
Copy link
Collaborator

sigmaaa commented Dec 6, 2023

Hi @ammaree

Thank you for reporting this issue.

Lastly, the following warning/error occurs consistently:
image

this error could happen after switching to a different esp-idf without cleaning a project. To verify this scenario, you can check the project_description.json in the build folder and compare the "idf_path" property with the IDF_PATH environment variable (located in Preferences -> C/C++ -> Build -> Environment). If they are not the same, you can try to run full clean (right-click on project ESP-IDF: Project Full Clean) and build the project again.

@kolipakakondal
Copy link
Collaborator

Hi @ammaree Eclipse 2023-12 is not supported by the idf-eclipse-plugin yet. Please continue to use IEP plugin with the Eclipse CDT 2023-09.

I would also suggest switch to clangd indexer and editor features as eclipse cdt indexer is not maintained anymore and not compatible with the latest C/C++ 20 lang features. In future releases, we will automate these configuration steps.

@ammaree
Copy link
Author

ammaree commented Dec 7, 2023

Hi @ammaree

Thank you for reporting this issue.

Lastly, the following warning/error occurs consistently:
image

this error could happen after switching to a different esp-idf without cleaning a project. To verify this scenario, you can check the project_description.json in the build folder and compare the "idf_path" property with the IDF_PATH environment variable (located in Preferences -> C/C++ -> Build -> Environment). If they are not the same, you can try to run full clean (right-click on project ESP-IDF: Project Full Clean) and build the project again.

I went far further that just a full clean, I deleted the './build' and './managed_components' directories as well as the 'dependencies.lock' and 'sdkconfig' files.

@sigmaaa
Copy link
Collaborator

sigmaaa commented Dec 7, 2023

Hi @ammaree
Thank you for reporting this issue.

Lastly, the following warning/error occurs consistently:
image

this error could happen after switching to a different esp-idf without cleaning a project. To verify this scenario, you can check the project_description.json in the build folder and compare the "idf_path" property with the IDF_PATH environment variable (located in Preferences -> C/C++ -> Build -> Environment). If they are not the same, you can try to run full clean (right-click on project ESP-IDF: Project Full Clean) and build the project again.

I went far further that just a full clean, I deleted the './build' and './managed_components' directories as well as the 'dependencies.lock' and 'sdkconfig' files.

Hi @ammaree,

do you still have a "Parsing Job..." exception after this?

@ammaree
Copy link
Author

ammaree commented Dec 7, 2023

Yes I do, normally error comes up twice with exact same details

@sigmaaa
Copy link
Collaborator

sigmaaa commented Dec 7, 2023

Hi @ammaree,

one more question to clarify the root of the problem: after the build, did you compare the "idf_path" property from project_description.json with the IDF_PATH environment variable?

@ammaree
Copy link
Author

ammaree commented Dec 7, 2023 via email

@ammaree
Copy link
Author

ammaree commented Dec 7, 2023

I think your latest changes, last couple of hours, has completely disabled ANY install of the Plugin.
I have completely cleaned out all traces of Eclipse and the plugin, even the Eclipse project directories and related files in my project directory and 4 (four) times tried to install Eclipse:
2x cpp-2023-09
2x cpp-2023-03
Every time from a complete clean base.
Every time used the same 'Stable" link for the Plugin and gone through the complete process, no errors.
Every time after the install there is NO SIGN of the plugin on the menu.

List of software to be installed and proof of the Eclipse version:

Screenshot 2023-12-07 at 12 21 21 (2)

Updated info showing "modified" request:

Screenshot 2023-12-07 at 12 22 54 (2)

After install and restart, installation details:

Screenshot 2023-12-07 at 12 35 02

No sign of the plugin:

Screenshot 2023-12-07 at 12 39 20

What now?

@sigmaaa
Copy link
Collaborator

sigmaaa commented Dec 7, 2023

Hi @ammaree,

we were able to find the root of the problem that caused this installation issue. The problem is that while updating/installing the plugin some dependencies are fetching from the latest plugins Eclipse 2023-12 and that is causing version incompatibility with the UI plugin. While we are working on a fix, I recommend you use Espressif-IDE which comes with Eclipse 2023-09+ IEP v2.11.1:
https://dl.espressif.com/dl/idf-eclipse-plugin/ide/Espressif-IDE-2.11.1-win32.win32.x86_64.zip

@ammaree
Copy link
Author

ammaree commented Dec 7, 2023

Reasonably aware of what caused the problem, believe it was your rushed commit this morning to restrict the plugin installation on Eclipse 2023-12. It was done immediately after I raised my problem in spite of the fact that I made it clear I had tested my problem on 2023-03 and 2023-09, and only installed 2023-12 after all the tests.

I guess you did not look very carefully else you would have noticed that I use macOS not Windows so the link of no use.

@ammaree
Copy link
Author

ammaree commented Dec 7, 2023

@sigmaaa
@kolipakakondal

And by the way, when I download using (https://dl.espressif.com/dl/idf-eclipse-plugin/ide/Espressif-IDE-macosx-cocoa-x86_64/latest) it also does not work....

Screenshot 2023-12-07 at 20 04 48

@sigmaaa
Copy link
Collaborator

sigmaaa commented Dec 7, 2023

@sigmaaa @kolipakakondal

And by the way, when I download using (https://dl.espressif.com/dl/idf-eclipse-plugin/ide/Espressif-IDE-macosx-cocoa-x86_64/latest) it also does not work....

Screenshot 2023-12-07 at 20 04 48

@ammaree

it looks like you are using Java 14 on Mac, but Java 17 or higher is required

@ammaree
Copy link
Author

ammaree commented Dec 7, 2023

Using the Eclipse Installer the correct version of Java (17) is automatically installed. The problem, from what I can remember is that Eclipse does not recognise openjdk when installed with HomeBrew, and not aware of a fix for that. So without a solution installing Java 17 together with your Espressif-IDE for macOS it will remain a problem.

@igrr
I have personally lost at least 3 full days of work trying to get this going, probably ~2 weeks lost in total over last 2 months with all the hassles. Maybe it's time to invest the next 3 days into VSCode, just hope the Espressif plugin there is better. But I guess it is very unlikely (impossible?) to be worse than the Eclipse Plugin fiasco...

@ammaree
Copy link
Author

ammaree commented Dec 7, 2023

Against our policy I installed Oracle Java 17.0.9 with the macOS Espressif-IDE, first build of a 100% clean project....

Screenshot 2023-12-07 at 21 03 36

@sigmaaa
Copy link
Collaborator

sigmaaa commented Dec 7, 2023

Using the Eclipse Installer the correct version of Java (17) is automatically installed. The problem, from what I can remember is that Eclipse does not recognise openjdk when installed with HomeBrew, and not aware of a fix for that. So without a solution installing Java 17 together with your Espressif-IDE for macOS it will remain a problem.

@igrr I have personally lost at least 3 full days of work trying to get this going, probably ~2 weeks lost in total over last 2 months with all the hassles. Maybe it's time to invest the next 3 days into VSCode, just hope the Espressif plugin there is better. But I guess it is very unlikely (impossible?) to be worse than the Eclipse Plugin fiasco...

it's possible to provide any version of Java to Eclipse/Espressif-IDE. To do this you need to edit -vm option and specify the path to bin folder in eclipse.ini (or espressif-ide.ini respectively). Here is instruction https://wiki.eclipse.org/Eclipse.ini. We probably need to add this to our documentation as well.

@sigmaaa
Copy link
Collaborator

sigmaaa commented Dec 7, 2023

Against our policy I installed Oracle Java 17.0.9 with the macOS Espressif-IDE, first build of a 100% clean project....

Screenshot 2023-12-07 at 21 03 36

is it an imported project or a new one? Can you please check idf_path in project_description.json and IDF_PATH environment variable?

@ammaree
Copy link
Author

ammaree commented Dec 7, 2023 via email

@sigmaaa
Copy link
Collaborator

sigmaaa commented Dec 7, 2023

No “project_description.json” file exists other than historic copies in the bin.

Do I understand correctly, that after you click the build button you are getting a "Parsing Job" exception, and at this point, the build folder remains empty? If yes, then it's weird, because The "Parse Compile Commands File" task that throws the exception should only start after the build is complete. Then it parses the compile_commands.json file, which should exist in the build folder.

Btw, we already fixed the "Parse Compile Commands File" exception on master, but the root of the problem was switching versions of esp-idf. For example, after switching the version without cleaning the project the compile_commands.json was pointing to the files located in the wrong esp-idf folder, causing this exception. Here is a build with Espressif-IDE with this fix espressif-ide-macosx-cocoa-x86_64 and we will release it in version 2.12.0 soon. Even if the root of the problem is different, the provided build must fix this exception but I will investigate further to understand what could cause this issue in your case anyway. Thanks

@kolipakakondal
Copy link
Collaborator

Reasonably aware of what caused the problem, believe it was your rushed commit this morning to restrict the plugin installation on Eclipse 2023-12. It was done immediately after I raised my problem in spite of the fact that I made it clear I had tested my problem on 2023-03 and 2023-09, and only installed 2023-12 after all the tests.

To give you context, the IEP plugin stable update site is pointing to some of the latest CDT plugins (OpenOCD and GDB plugins) during installation. As a result, it was fetching the latest Eclipse CDT plugins (version 11.4), which has a API breaking change. Since we currently do not support Eclipse 2023-12, we have made changes to the CI build process to ensure that our plugins are built strictly with Eclipse 2023-09.

Here is what you can do -

  1. Download Espressif-IDE for macOS. As Denys pointed here, please use master build that comes with a compiler parser fix.
  2. If you have Java 17 issue, please set -vm argument as mentioned here

I think above two steps should sort out the problem what is caused by the eclipse update.

Apologies for the inconvenience. We will keep you informed once we have added support for the latest Eclipse version.

@kolipakakondal
Copy link
Collaborator

We have released IEP v2.12.0 which has a support for Eclipse 2023-12. Please check the release here https://github.com/espressif/idf-eclipse-plugin/releases/tag/v2.12.0

Please update to the latest and let us know if you see any issues.

@ammaree
Copy link
Author

ammaree commented Dec 26, 2023

Have a complete reinstall from scratch, steps as follows:
Deleted ~/.eclipse ~/.espressif ~/.p2 as well as the workspace ~/DevSpace/osx/.metadata directories
Installed Eclipse 2023-12 to ~/eclipse/2023-12 directory
Started Eclipse, checked for updates, think a single module was updated, restarted
Installed ESP-IDF Plugin using https://dl.espressif.com/dl/idf-eclipse-plugin/updates/latest/, restarted
Using the Plugin menu, started install using existing SDK v5.2.0, completed with errors, see log attached.

Eclipse install log
Installing tools...
This can take a while. Please be patient.
Executing /usr/bin/python3 /Users/andremaree/DevSpace/z-sdk/esp-idf.v5x/tools/idf_tools.py install all
Updating /Users/andremaree/.espressif/idf-env.json
Selected targets are: esp32h2, esp32, esp32s2, esp32s3, esp32c3, esp32c6, esp32p4, esp32c2
Current system platform: macos
Installing tools: xtensa-esp-elf-gdb, riscv32-esp-elf-gdb, xtensa-esp-elf, esp-clang, riscv32-esp-elf, esp32ulp-elf, cmake, openocd-esp32, ninja, esp-rom-elfs, qemu-xtensa, qemu-riscv32
Installing [email protected]_20221002
Downloading https://github.com/espressif/binutils-gdb/releases/download/esp-gdb-v12.1_20221002/xtensa-esp-elf-gdb-12.1_20221002-x86_64-apple-darwin14.tar.gz
Destination: /Users/andremaree/.espressif/dist/xtensa-esp-elf-gdb-12.1_20221002-x86_64-apple-darwin14.tar.gz.tmp
[==================================================] 100%Done
Extracting /Users/andremaree/.espressif/dist/xtensa-esp-elf-gdb-12.1_20221002-x86_64-apple-darwin14.tar.gz to /Users/andremaree/.espressif/tools/xtensa-esp-elf-gdb/12.1_20221002
Installing [email protected]_20221002
Downloading https://github.com/espressif/binutils-gdb/releases/download/esp-gdb-v12.1_20221002/riscv32-esp-elf-gdb-12.1_20221002-x86_64-apple-darwin14.tar.gz
Destination: /Users/andremaree/.espressif/dist/riscv32-esp-elf-gdb-12.1_20221002-x86_64-apple-darwin14.tar.gz.tmp
[==================================================] 100%Done
Extracting /Users/andremaree/.espressif/dist/riscv32-esp-elf-gdb-12.1_20221002-x86_64-apple-darwin14.tar.gz to /Users/andremaree/.espressif/tools/riscv32-esp-elf-gdb/12.1_20221002
Installing [email protected]_20230928
Downloading https://github.com/espressif/crosstool-NG/releases/download/esp-13.2.0_20230928/xtensa-esp-elf-13.2.0_20230928-x86_64-apple-darwin.tar.xz
Destination: /Users/andremaree/.espressif/dist/xtensa-esp-elf-13.2.0_20230928-x86_64-apple-darwin.tar.xz.tmp
[==================================================] 100%Done
Extracting /Users/andremaree/.espressif/dist/xtensa-esp-elf-13.2.0_20230928-x86_64-apple-darwin.tar.xz to /Users/andremaree/.espressif/tools/xtensa-esp-elf/esp-13.2.0_20230928
Installing [email protected]
Downloading https://github.com/espressif/llvm-project/releases/download/esp-16.0.0-20230516/llvm-esp-16.0.0-20230516-macos.tar.xz
Destination: /Users/andremaree/.espressif/dist/llvm-esp-16.0.0-20230516-macos.tar.xz.tmp
[==================================================] 100%Done
Extracting /Users/andremaree/.espressif/dist/llvm-esp-16.0.0-20230516-macos.tar.xz to /Users/andremaree/.espressif/tools/esp-clang/16.0.1-fe4f10a809
Installing [email protected]_20230928
Downloading https://github.com/espressif/crosstool-NG/releases/download/esp-13.2.0_20230928/riscv32-esp-elf-13.2.0_20230928-x86_64-apple-darwin.tar.xz
Destination: /Users/andremaree/.espressif/dist/riscv32-esp-elf-13.2.0_20230928-x86_64-apple-darwin.tar.xz.tmp
[==================================================] 100%Done
Extracting /Users/andremaree/.espressif/dist/riscv32-esp-elf-13.2.0_20230928-x86_64-apple-darwin.tar.xz to /Users/andremaree/.espressif/tools/riscv32-esp-elf/esp-13.2.0_20230928
Installing [email protected]_20220830
Downloading https://github.com/espressif/binutils-gdb/releases/download/esp32ulp-elf-v2.35_20220830/esp32ulp-elf-2.35_20220830-macos.tar.gz
Destination: /Users/andremaree/.espressif/dist/esp32ulp-elf-2.35_20220830-macos.tar.gz.tmp
[==================================================] 100%Done
Extracting /Users/andremaree/.espressif/dist/esp32ulp-elf-2.35_20220830-macos.tar.gz to /Users/andremaree/.espressif/tools/esp32ulp-elf/2.35_20220830
Installing [email protected]
Downloading https://github.com/Kitware/CMake/releases/download/v3.24.0/cmake-3.24.0-macos-universal.tar.gz
Destination: /Users/andremaree/.espressif/dist/cmake-3.24.0-macos-universal.tar.gz.tmp
[==================================================] 100%Done
Extracting /Users/andremaree/.espressif/dist/cmake-3.24.0-macos-universal.tar.gz to /Users/andremaree/.espressif/tools/cmake/3.24.0
Installing [email protected]
Downloading https://github.com/espressif/openocd-esp32/releases/download/v0.12.0-esp32-20230921/openocd-esp32-macos-0.12.0-esp32-20230921.tar.gz
Destination: /Users/andremaree/.espressif/dist/openocd-esp32-macos-0.12.0-esp32-20230921.tar.gz.tmp
[==================================================] 100%Done
Extracting /Users/andremaree/.espressif/dist/openocd-esp32-macos-0.12.0-esp32-20230921.tar.gz to /Users/andremaree/.espressif/tools/openocd-esp32/v0.12.0-esp32-20230921
Installing [email protected]
Downloading https://github.com/ninja-build/ninja/releases/download/v1.11.1/ninja-mac.zip
Destination: /Users/andremaree/.espressif/dist/ninja-mac-v1.11.1.zip.tmp
[==================================================] 100%Done
Extracting /Users/andremaree/.espressif/dist/ninja-mac-v1.11.1.zip to /Users/andremaree/.espressif/tools/ninja/1.11.1
Installing esp-rom-elfs@20230320
Downloading https://github.com/espressif/esp-rom-elfs/releases/download/20230320/esp-rom-elfs-20230320.tar.gz
Destination: /Users/andremaree/.espressif/dist/esp-rom-elfs-20230320.tar.gz.tmp
[==================================================] 100%Done
Extracting /Users/andremaree/.espressif/dist/esp-rom-elfs-20230320.tar.gz to /Users/andremaree/.espressif/tools/esp-rom-elfs/20230320
Installing qemu-xtensa@esp_develop_8.1.3_20231206
Downloading https://github.com/espressif/qemu/releases/download/esp-develop-8.1.3-20231206/qemu-xtensa-softmmu-esp_develop_8.1.3_20231206-x86_64-apple-darwin.tar.xz
Destination: /Users/andremaree/.espressif/dist/qemu-xtensa-softmmu-esp_develop_8.1.3_20231206-x86_64-apple-darwin.tar.xz.tmp
[==================================================] 100%Done
Extracting /Users/andremaree/.espressif/dist/qemu-xtensa-softmmu-esp_develop_8.1.3_20231206-x86_64-apple-darwin.tar.xz to /Users/andremaree/.espressif/tools/qemu-xtensa/esp_develop_8.1.3_20231206
Installing qemu-riscv32@esp_develop_8.1.3_20231206
Downloading https://github.com/espressif/qemu/releases/download/esp-develop-8.1.3-20231206/qemu-riscv32-softmmu-esp_develop_8.1.3_20231206-x86_64-apple-darwin.tar.xz
Destination: /Users/andremaree/.espressif/dist/qemu-riscv32-softmmu-esp_develop_8.1.3_20231206-x86_64-apple-darwin.tar.xz.tmp
[==================================================] 100%Done
Extracting /Users/andremaree/.espressif/dist/qemu-riscv32-softmmu-esp_develop_8.1.3_20231206-x86_64-apple-darwin.tar.xz to /Users/andremaree/.espressif/tools/qemu-riscv32/esp_develop_8.1.3_20231206
OK
Executing /usr/bin/python3 /Users/andremaree/DevSpace/z-sdk/esp-idf.v5x/tools/idf_tools.py install-python-env
Creating a new Python environment in /Users/andremaree/.espressif/python_env/idf5.2_py3.9_env
Requirement already satisfied: pip in /Users/andremaree/.espressif/python_env/idf5.2_py3.9_env/lib/python3.9/site-packages (21.2.4)
Collecting pip
Downloading pip-23.3.2-py3-none-any.whl (2.1 MB)
Requirement already satisfied: setuptools in /Users/andremaree/.espressif/python_env/idf5.2_py3.9_env/lib/python3.9/site-packages (58.0.4)
Collecting setuptools
Downloading setuptools-69.0.3-py3-none-any.whl (819 kB)
Installing collected packages: setuptools, pip
Attempting uninstall: setuptools
Found existing installation: setuptools 58.0.4
Uninstalling setuptools-58.0.4:
Successfully uninstalled setuptools-58.0.4
Attempting uninstall: pip
Found existing installation: pip 21.2.4
Uninstalling pip-21.2.4:
Successfully uninstalled pip-21.2.4
Successfully installed pip-23.3.2 setuptools-69.0.3
Downloading https://dl.espressif.com/dl/esp-idf/espidf.constraints.v5.2.txt
Destination: /Users/andremaree/.espressif/espidf.constraints.v5.2.txt.tmp
[==================================================] 100%Done
Installing Python packages
Constraint file: /Users/andremaree/.espressif/espidf.constraints.v5.2.txt
Requirement files:

Guess my only option is to invest the time required for VS Code....

@kolipakakondal
Copy link
Collaborator

Hi @ammaree Installation seems to be went fine and configured required paths. Please ignore the warnings reported related to esp-lang.

@ammaree
Copy link
Author

ammaree commented Dec 27, 2023 via email

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

3 participants